Question regarding Xcode version check

Juan Manuel Palacios jmpp at macports.org
Fri Apr 3 08:43:38 PDT 2009


On Apr 2, 2009, at 1:58 AM, Ryan Schmidt wrote:

> On Apr 1, 2009, at 20:17, Juan Manuel Palacios wrote:
>
>> 	Hey Ryan! Believe it or not, I'm still alive ;-)
>>
>> 	Today I was putting together a MAMP installation on a Mac at work,  
>> with our beautiful MacPorts of course, and stumbled on a rather  
>> annoying glitch, or what at least looks like one. The tiff port has  
>> the standard check for the minimum Xcode version on Leopard, 3.1.2,  
>> as introduced by you in r48210; but said check happens at pre- 
>> extract time, which means port has already wasted time downloading  
>> the distfile if the target Mac has Xcode < 3.1.2, which was my case  
>> this time round. Is it possible to move the check up to pre-fetch?
>>
>> 	I'm not gonna commit that change just now, one 'cause the port is  
>> not openmaintainer and, two, 'cause I don't know if pre-fetch was  
>> explicitly avoided for a reason.
>>
>> 	Let me know, thanks! Regards,...
>
> Hi Juan!
>
> This was a deliberate decision, and I'm copying macports-dev on this  
> answer since I never explained the rationale before, so let me do so  
> now.
>
> Some of my ports do checks and issue fatal error messages in the pre- 
> fetch phase. I reserve this for ports which can never be installed  
> on the given system at all. For example, if you try to install wine  
> on a PowerPC Mac, or oracle-instantclient on an Intel Mac with Tiger  
> or earlier. It can't be done. There is no way those ports will ever  
> work on those systems, so there's no point allowing the user to  
> download the distfile.
>
> For other ports, like tiff, as you found, and any others where I've  
> added the Xcode version check, and other ports like pango and cairo  
> and pure which check the version of other installed ports, the check  
> is in pre-extract, specifically so that the user can still fetch and  
> verify the distfile. Most likely, the user wants to install the  
> software, so after encountering the message that they need to  
> upgrade their Xcode, they will seek out and download the new Xcode,  
> and then be able to install the software. I did not want to put the  
> check in the pre-fetch phase because that would prevent the user  
> from doing something like "port fetch outdated" or "port fetch some  
> long list of ports" which the user may want to do if they have a  
> slow network connection and/or want to download these files  
> unattended. The user might be annoyed to have left the machine alone  
> for hours while they expect it to be downloading many ports, only to  
> find when they come back that it has exited with an error after  
> failing to download only a few files. Sure, the user won't be able  
> to install this specific port without downloading the newer Xcode,  
> but they can still install the others they fetched.
>
> Anyway, not sure if these hypothetical uses actually occur, but that  
> was why I decided to do it this way.
>


	Yeah, seems like a legit reasoning to me, and indeed I updated Xcode  
and went on to install the already downloaded tiff port, so in this  
case your theory did hold true ;-) All in all, pre-fetch is for sort- 
of irrecoverable errors and pre-extract for sort-of soft errors, which  
I agree is a good compromise.

	Thanks for the explanation! (which should probably go in a portfile  
writing tips document ;-) Regards,...


-jmpp



More information about the macports-dev mailing list