Opened 9 years ago

Closed 9 years ago

#48926 closed defect (worksforme)

Xcode 7 update seems to cause /usr/bin/clang --version to hang which causes ./configure to hang

Reported by: davidfavor (David Favor) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc:
Port:

Description

Unfortunately I just upgraded to Xcode 7 on Yosemite.

It appears Apple has introduce an ugly bug where the update to Xcode 7 removes Xcode 6.x which also removes the macos10.10 SDK.

Besides the already reported problems, like wireshark build break, another more ugly oddity has surfaced.

Many builds hang in the configuration step, running ./configure.

I've attached a log file from ffmpeg with 'set +x' added to top of ./configure which illustrates the problem.

Inside the ./configure probe_cc() function around line 3555 I added...

    # DRF
    echo "DRF: probe_cc(): cc=$_cc"
    echo "DRF: probe_cc(): before: clang version"
    $_cc --version 2>&1 
    echo "DRF: probe_cc(): after: clang version"

I've attached the log file which shows clang hanging.

This makes no sense to me, as running /usr/bin/clang --version on the command line works.

Also changing --version to --help or --foo produce the same hang.

If I hack _cc to be /opt/local/bin/clang then the command works, so I suspect something's amiss in the Xcode update.

My question is... If anyone knows a work around to fix this, please update this ticket.

I've opened a bug with Apple asking how to reinstall Xcode 6.x in parallel with Xcode 7 + will update this ticket if they respond with any useful information.

Attachments (1)

ffmpeg-build.log (731.0 KB) - added by davidfavor (David Favor) 9 years ago.

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by davidfavor (David Favor)

Attachment: ffmpeg-build.log added

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Priority: HighNormal

It sounds like an Apple bug; nothing we can do about it in MacPorts.

You can reinstall Xcode 6 by downloading it from the Apple developer downloads web page. You can tell MacPorts to use it by selecting it with xcode-select.

comment:2 Changed 9 years ago by davidfavor (David Favor)

Here's how I fixed this, as someone else might hit the same problem.

  1. Run xcodebuild -showsdks + if there's no "-sdk macosx10.10" then continue
  2. Download Xcode-6.4.dmg (command line tools appear to be packaged in the Xcode dmg)
  3. mv /Applications/Xcode /Applications/Xcode-7.0
  4. Install Xcode-6.4.dmg
  5. If everything worked, you should see...
    imac# xcodebuild -showsdks
    OS X SDKs:
    	OS X 10.9                     	-sdk macosx10.9
    	OS X 10.10                    	-sdk macosx10.10
    
    /usr/bin/gcc --version
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
    Target: x86_64-apple-darwin14.5.0
    Thread model: posix
    

If not, navigate to /Applications/Xcode -> Preferences -> Locations -> Change "Command Line Tools" to 6.4

Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 9 years ago by davidfavor (David Favor)

This problem persisted for a while after I resinstalled Xcode-6.4 + now clang is working.

Unsure what I did, as the following show the same now as when I first switched back to Xcode-6.4 so all's well.

imac# xcode-select -p
/Applications/Xcode.app/Contents/Developer
imac# xcodebuild -showsdks
OS X SDKs:
	OS X 10.9                     	-sdk macosx10.9
	OS X 10.10                    	-sdk macosx10.10
Last edited 9 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 9 years ago by davidfavor (David Favor)

Now there's another problem.

Some builds hang + ps shows this...

imac# psall | grep -i make
macports        11474   0.0  0.0  2442588   1028 s002  S+   10:09AM   0:00.00 sh -c /Applications/Xcode-6.4.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null
macports        11472   0.0  0.0  2444092    684 s002  S+   10:09AM   0:00.00 make -v
macports        11471   0.0  0.0  2443612   1048 s002  S+   10:09AM   0:00.00 sh -c "make" -v 2>&1
macports        11382   0.0  0.0  2471900  14436 s002  S+   10:09AM   0:00.15 /opt/local/bin/perl5.20 Makefile.PL INSTALLDIRS=vendor CC=/usr/bin/clang LD=/usr/bin/clang
macports        11381   0.0  0.0  2435420   1060 s002  S+   10:09AM   0:00.03 sh -c  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-net-ssleay/p5.20-net-ssleay/work/Net-SSLeay-1.71" && /opt/local/bin/perl5.20 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" 
root            11955   0.0  0.0  2423552     24 s000  R+   10:11AM   0:00.00 grep -i make
macports        11475   0.0  0.1  2593712  27568 s002  S+   10:09AM   0:00.18 /Applications/Xcode-6.4.app/Contents/Developer/usr/bin/xcodebuild -sdk  -find make

Notice -sdk being passed with an empty sdk.

I've looked through the Macports developer guide + there appears to be now way to set the -sdk version to use.

Suggestions appreciated.

comment:5 Changed 9 years ago by davidfavor (David Favor)

I see OSX-10.11 release date is set for Sept 30th, so I say ignore this ticket + I'll update it after I upgrade to see if problem is resolved.

comment:6 in reply to:  4 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to david@…:

Some builds hang + ps shows this...

imac# psall | grep -i make
macports        11474   0.0  0.0  2442588   1028 s002  S+   10:09AM   0:00.00 sh -c /Applications/Xcode-6.4.app/Contents/Developer/usr/bin/xcodebuild -sdk '' -find make 2> /dev/null
macports        11472   0.0  0.0  2444092    684 s002  S+   10:09AM   0:00.00 make -v
macports        11471   0.0  0.0  2443612   1048 s002  S+   10:09AM   0:00.00 sh -c "make" -v 2>&1
macports        11382   0.0  0.0  2471900  14436 s002  S+   10:09AM   0:00.15 /opt/local/bin/perl5.20 Makefile.PL INSTALLDIRS=vendor CC=/usr/bin/clang LD=/usr/bin/clang
macports        11381   0.0  0.0  2435420   1060 s002  S+   10:09AM   0:00.03 sh -c  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-net-ssleay/p5.20-net-ssleay/work/Net-SSLeay-1.71" && /opt/local/bin/perl5.20 Makefile.PL INSTALLDIRS=vendor CC="/usr/bin/clang" LD="/usr/bin/clang" 
root            11955   0.0  0.0  2423552     24 s000  R+   10:11AM   0:00.00 grep -i make
macports        11475   0.0  0.1  2593712  27568 s002  S+   10:09AM   0:00.18 /Applications/Xcode-6.4.app/Contents/Developer/usr/bin/xcodebuild -sdk  -find make

Notice -sdk being passed with an empty sdk.

Maybe that's a bug in that particular port? Or maybe you need to rebuild the corresponding perl port (in this case, perl5.20) so that it understands you want to use a different Xcode location now? I know that some software, including perl, remembers such details about your build system, and tries to use those remembered details later—in the case of perl: when building modules.

I've looked through the Macports developer guide + there appears to be now way to set the -sdk version to use.

The sdk is influenced by the macports.conf variable macosx_sdk_version. So you can set, for example, "macosx_sdk_version 10.11" if you want to use the MacOSX10.11 sdk. This option is undocumented because we do not support users changing it. That means that for any particular port it might work, or it might have no effect. Or, in the case of perl, it might use a previously-remembered value. Also, if you change the sdk, you must set "buildfromsource always", otherwise you might get binaries from our build server that were not built with your sdk choice.

comment:7 Changed 9 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: newclosed

I assume this does not happen anymore.

Note: See TracTickets for help on using tickets.