[MacPorts] #29214: xcodeversion portgroup: Don't fail if Xcode.app can't be found (was: Don't fail if Xcode.app can't be found)

MacPorts noreply at macports.org
Tue Apr 19 17:34:01 PDT 2011


#29214: xcodeversion portgroup: Don't fail if Xcode.app can't be found
------------------------------+---------------------------------------------
 Reporter:  eturro@…          |       Owner:  macports-tickets@…                   
     Type:  defect            |      Status:  new                                  
 Priority:  Normal            |   Milestone:                                       
Component:  ports             |     Version:  1.9.2                                
 Keywords:                    |        Port:  xcodeversion                         
------------------------------+---------------------------------------------
Changes (by ryandesign@…):

 * cc: ryandesign@… (added)
  * port:  => xcodeversion


Comment:

 Replying to [ticket:29214 eturro@…]:
 > In the age of expensive SSDs, many of us like to delete /Developer
 (10GB!) after having installed Xcode. AFAIK, MacPorts don't need anything
 in /Developer.

 I understand your motivation for wanting to free space on an expensive
 SSD, however I can't really support your way of going about it.
 /Developer/SDKs, for example, is essential to many ports.

 > Most ports issue a warning if /Developer has been removed: "Warning:
 Xcode does not appear to be installed; most ports will likely fail to
 build", after which the port proceeds to being successfully built.

 Actually, that's
 [browser:trunk/base/src/port1.0/portutil.tcl?rev=77511#L2639 MacPorts
 base] checking for that and printing that message. It does so for all
 ports, if the problem exists.

 > zlib, however, does its own manual check to see if Xcode.app exists and
 fails with an error "Error: Couldn't find Xcode; expected it to be at
 /Developer/Applications/Xcode.app".

 Actually, zlib is using the
 [browser:trunk/dports/_resources/port1.0/group/xcodeversion-1.0.tcl?rev=74403#L47
 xcodeversion portgroup] to perform this check. Many ports use this
 portgroup besides zlib, but since zlib is a dependency for so many other
 programs, it's often the first port that gets installed. That makes it a
 great place to check to make sure the user's Xcode is installed properly.
 The xcodeversion portgroup was added before MacPorts base had the similar
 check above, but I prefer the xcodeversion check precisely because it
 actually errors out and makes the user fix the problem.
 /Developer/Applications/Xcode.app is a standard part of Xcode; if you
 don't have that, how can I know that the rest of the developer tools are
 installed correctly?

 > Could you please change the code so zlib behaves like other ports (i.e.
 issues a warning but doesn't quit with an error).

 The xcodeversion check was deliberately added to the zlib port because
 many users had upgraded Mac OS X but had not realized they needed to
 upgrade Xcode manually as well. This caused many problems across the
 board. There was a problem with zlib that I believe was traced back to
 this as well: zlib would appear to install without error, but in fact did
 not contain the zlib library, a rather important feature of the zlib port.
 Therefore I added the xcodeversion check to ensure that users with
 nonfunctional Xcode installations were prevented from creating this broken
 situation in the first place, thus saving time for both users (the don't
 have to ask us what's wrong) and us (we don't have to spend time answering
 questions about known situations).

 Perhaps your need can be met another way. 9GB of the 11GB in my /Developer
 directory are taken up by the Platforms directory. All but 16MB of those
 9GB relate to iOS development; if you're not doing iOS development, you
 could delete those directories and keep the rest.

 Apple used to provide an Xcode installer that did not include the iOS
 development components, but they appear to have stopped doing so a few
 versions ago. Our Guide says you can
 [http://guide.macports.org/#installing.xcode download Xcode 3.2.2 without
 iOS], then use Software Update to update it to the latest version 3.2.6; I
 assume that means it won't pull in all the iOS parts in the process. So
 you could also uninstall Xcode using Apple's script, then install Xcode
 without iOS. (I'm not sure if there are parts other than those in
 /Platforms that would be omitted by doing this, which might give even
 greater space savings.) The Documentation and Examples directories are
 also relatively safe candidates for deletion, though they're not that
 large on my system.

-- 
Ticket URL: <https://trac.macports.org/ticket/29214#comment:1>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list