Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#33398 closed enhancement (fixed)

print full path in recommended xcode-select commands since some users have an old version

Reported by: theboergers@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.1.0
Component: base Version: 2.0.4
Keywords: Cc:
Port:

Description

A fresh install of MacPorts 2.0.4 on 10.7.3/Xcode 4.3 with command-line tools continues to display the error "Warning: xcodebuild exists but failed to execute".

A transcript of the MacPorts install and subsequent package installation is attached.

P.S. 2.0.4 is not an option for the version dropdown list in the submit ticket form.

Attachments (1)

xcodebuild-error-2.0.4.txt (50.0 KB) - added by theboergers@… 6 years ago.

Download all attachments as: .zip

Change History (12)

Changed 6 years ago by theboergers@…

comment:1 follow-up: Changed 6 years ago by danielluke (Daniel J. Luke)

Did you follow the instructions it printed just below that line?

Warning: xcodebuild exists but failed to execute
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`

comment:2 follow-up: Changed 6 years ago by ryandesign (Ryan Schmidt)

  • Component changed from ports to base
  • Priority changed from High to Normal
  • Version set to 2.0.4

comment:3 in reply to: ↑ 2 ; follow-up: Changed 6 years ago by theboergers@…

Replying to ryandesign@…: I did. It's there in the transcript.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 6 years ago by charliebrown2k@…

Replying to theboergers@…:

Replying to ryandesign@…: I did. It's there in the transcript.

with OS 10.7.3 (Lion) and Xcode 4.3 (with command-line utilities installed) I got it fixed with:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

comment:5 in reply to: ↑ 4 Changed 6 years ago by theboergers@…

Replying to charliebrown2k@…:

Replying to theboergers@…:

Replying to ryandesign@…: I did. It's there in the transcript.

with OS 10.7.3 (Lion) and Xcode 4.3 (with command-line utilities installed) I got it fixed with:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

That did the trick for me as well.

comment:6 in reply to: ↑ 1 ; follow-up: Changed 6 years ago by nicholas@…

Replying to dluke@…:

Did you follow the instructions it printed just below that line?

Warning: xcodebuild exists but failed to execute
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`

Please note: with OS X 10.7.3 Lion and XCode 4.3.2, I did NOT get this entire message. I ONLY got the first line that told me something was wrong. The last two lines—the explanation and instructions—were not present. I had no idea what to do until I found this bug. I am also on MacPorts 2.0.4.

comment:7 in reply to: ↑ 6 Changed 6 years ago by jasoncof@…

Replying to nicholas@…:

Replying to dluke@…:

Did you follow the instructions it printed just below that line?

Warning: xcodebuild exists but failed to execute
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`

Please note: with OS X 10.7.3 Lion and XCode 4.3.2, I did NOT get this entire message. I ONLY got the first line that told me something was wrong. The last two lines—the explanation and instructions—were not present. I had no idea what to do until I found this bug. I am also on MacPorts 2.0.4.

I have OS X 10.7.3 Lion and XCode 4.3.1 and I also did NOT get the entire message. I only got the first line: "Warning: xcodebuild exists but failed to execute".

comment:8 Changed 6 years ago by neverpanic (Clemens Lang)

This message is only being printed if you have /Applications/Xcode.app and are running any of the following commands: fetch, checksum, extract, patch, configure, build, test, destroot, install, activate, dmg, mdmg, pkg, mpkg, rpm, dpkg and srpm. So e.g. when running port version, port outdated, etc. it will only show the warning about xcodebuild, but not the instructions.

As already mentioned by charliebrown2k it sometimes is necessary to run xcode-select -switch /Applications/Xcode.app/Contents/Developer rather than only xcode-select -switch /Applications/Xcode.app. This depends on the version of the xcode-select tool you have installed and is fixed with a newer version that should have been installed with the 10.7.3 combo update (but sometimes apparently wasn't).

comment:9 Changed 6 years ago by urban.48@…

FYI, I had this same problem, and I was able to run

sudo xcode-select -switch /Applications/Xcode.app

without specifying the developer folder within Xcode.app and it seemed to fix the problem for me. Running

/usr/bin/xcodebuild -version

returns the correct information.

comment:10 Changed 6 years ago by jmroot (Joshua Root)

  • Milestone set to MacPorts Future
  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from xcodebuild error on fresh MacPorts 2.0.4 to print full path in recommended xcode-select commands since some users have an old version
  • Type changed from defect to enhancement

All we can really do is recommend using the full path, which works with both old and new versions of xcode-select. r91349

comment:11 Changed 6 years ago by jmroot (Joshua Root)

  • Milestone changed from MacPorts Future to MacPorts 2.1.0
Note: See TracTickets for help on using tickets.