Universal issues

Joshua Root jmr at macports.org
Tue Jun 10 21:00:30 PDT 2008


Ryan Schmidt wrote:
> Does universal mean "it works at full performance on all  
> architectures"? In this case, ports like this that install no  
> architecture-specific files should be modified to have an empty  
> universal variant selected by default.
> 
> Or does universal mean "it has more than one architecture of compiled  
> software"? In this case, no-arch ports should be modified to turn off  
> the universal variant to indicate that a universal build of this port  
> is not applicable. I believe this definition of universal has been  
> used in several other no-arch ports before.

It means the latter. Universal is short for "universal binary" which is 
marketing-speak for "fat binary" which means a binary with code for more 
than one arch.

> For the sake of ports like apr and isightcapture and others in the  
> same boat, we need a way to indicate in each port which architectures  
> are supported. MacPorts would by default assume that all ports can be  
> built for all four architectures, but individual ports could add  
> lines to change this. For example, apr could add "supported_archs  
> i386 ppc" until their bug is fixed. wine could add "supported_archs  
> i386 x86_64". This could solve a number of problems. 1) If the user  
> requests the universal variant but the list of supported  
> architectures doesn't include all the architectures the user  
> requested in their universal_archs definition in macports.conf, a  
> warning can be issued informing the user. 2) If a port isn't  
> available at all on the user's local architecture (for example, the  
> user is on ppc and tries to install wine which only supplies i386 and  
> x86_64) port can issue an error and halt. Then we could eliminate  
> from the portfile the code that currently checks the architecture and  
> warns the user and exits.

Sounds good to me. Noarch ports could specify 'all' in supported_archs, 
which could be another trigger for turning off the default universal 
variant, like 'use_configure no' is now. Supported_archs should be 
displayed by 'port info'.

> I proposed last month that we need a way (e.g. in "port installed")  
> to see for which architectures a given universal binary was built:
> 
> http://lists.macosforge.org/pipermail/macports-dev/2008-May/005314.html
> 
> When a port is installed, we need to record somewhere what  
> architectures were requested. Ideally this should happen regardless  
> of whether the universal variant was used or not. If it wasn't used,  
> then the requested architecture is just "i386" or "ppc".

Another good idea. Technically the non-universal arch should be obtained 
from "--target=" in the output of gcc -v, for future-proofing.

- Josh


More information about the macports-dev mailing list