Opened 7 years ago

Last modified 6 years ago

#49169 reopened defect

port selfupdate fails with an imprecise error message when the Xcode license has not been accepted

Reported by: FoolishEwe@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.4
Keywords: Cc:
Port:

Description

I am getting an error when running port selfupdate and this machine's self update was reliable from this network in the past. This ticket should be used instead of the poorly formatted earlier attempt, Ticket #49168. Please note that my rsync appeared to work, hence it is likely different than Ticket #49140, which has a similar complaint but probably a different cause. Here I try it twice (note the user name is sanitized), the second time with the -v flag. Interestingly I the error appears to complain about the C compiler unable to create executables, but port installed shows "gcc49 @4.9.3_0 (active)", I've appended the full list to the end of this description. The file /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base/config.log is attached.

My-MacBook-Pro-2:~ FoolishEwe$ ls
Applications	Documents	Library		Music		Public		backup
Desktop		Downloads	Movies		Pictures	VirtualBox VMs	oozie-wman
My-MacBook-Pro-2:~ FoolishEwe$ cd /tmp
My-MacBook-Pro-2:tmp FoolishEwe$ sudo port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.3.3 installed,
MacPorts base version 2.3.4 downloaded.
--->  Updating the ports tree
--->  MacPorts base is outdated, installing new version 2.3.4
Installing new MacPorts release in /opt/local as root:admin; permissions 0755

Error: Error installing new MacPorts base: command execution failed
Please run `port -v selfupdate' for details.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
My-MacBook-Pro-2:tmp FoolishEwe$ sudo port -v selfupdate
--->  Updating MacPorts base sources using rsync
receiving file list ... done

sent 36 bytes  received 69 bytes  210.00 bytes/sec
total size is 27013120  speedup is 257267.81
receiving file list ... done

sent 36 bytes  received 76 bytes  224.00 bytes/sec
total size is 512  speedup is 4.57
MacPorts base version 2.3.3 installed,
MacPorts base version 2.3.4 downloaded.
--->  Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
receiving file list ... done

sent 36 bytes  received 70 bytes  212.00 bytes/sec
total size is 62689280  speedup is 591408.30
receiving file list ... done

sent 36 bytes  received 77 bytes  226.00 bytes/sec
total size is 512  speedup is 4.53
receiving file list ... done

sent 36 bytes  received 70 bytes  212.00 bytes/sec
total size is 13123669  speedup is 123808.20
receiving file list ... done

sent 36 bytes  received 77 bytes  226.00 bytes/sec
total size is 512  speedup is 4.53
--->  MacPorts base is outdated, installing new version 2.3.4
Installing new MacPorts release in /opt/local as root:admin; permissions 0755

checking build system type... i386-apple-darwin14.5.0
checking host system type... i386-apple-darwin14.5.0
checking target system type... i386-apple-darwin14.5.0
checking MacPorts version... 2.3.4
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.10.5
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 7.0.1
checking whether the C compiler works... no
configure: error: in `/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 77
Error: Error installing new MacPorts base: command execution failed
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

Now the output of port installed. Note that gcc 4.9 appears to be installed.

port installed | grep -y cc
  arpack @3.1.5_0+accelerate+gfortran (active)
  cctools @862_1+llvm35 (active)
  cdf @3.6.0.3_0+gcc49
  cdf @3.6.0.3_1+gcc49 (active)
  gcc49 @4.9.2_1
  gcc49 @4.9.2_2
  gcc49 @4.9.3_0 (active)
  gcc_select @0.1_8 (active)
  libgcc @4.9.2_1
  libgcc @5.1.0_0
  libgcc @5.1.0_1
  libgcc @5.2.0_0 (active)
  octave @3.8.2_7+atlas+gcc49+glgui
  octave @3.8.2_8+atlas+gcc49+glgui
  octave @3.8.2_9+atlas+gcc49+glgui
  octave @3.8.2_10+atlas+gcc49+glgui
  octave @3.8.2_11+atlas+gcc49+glgui (active)
  qrupdate @1.1.2_3+atlas+gcc49 (active)

Attachments (1)

config.log (10.1 KB) - added by FoolishEwe@… 7 years ago.
sanitized version of /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base/config.log

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by FoolishEwe@…

Attachment: config.log added

sanitized version of /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base/config.log

comment:1 Changed 7 years ago by mdeaudelin (Mathieu Deaudelin-Lemay)

MacPorts uses the system compiler to compile itself, not gcc49. The underlying error is this:

configure:3229: /usr/bin/cc --version >&5
	
You have not agreed to the Xcode license agreements, please run 'xcodebuild -license' (for user-level acceptance or 'sudo xcodebuild -license' (for system-wide acceptance) from within a Terminal window to review and agree to the Xcode license agreements.

In this case, you most likely need to accept it as root using sudo xcodebuild -license

comment:2 Changed 7 years ago by ryandesign (Ryan Schmidt)

Component: portsbase
Resolution: invalid
Status: newclosed

comment:3 Changed 6 years ago by fhgwright (Fred Wright)

Resolution: invalid
Status: closedreopened

I just ran across this on the 2.3.4 to 2.3.5 selfupdate. I believe it was triggered by having updated Xcode, with Apple's deciding that I needed to agree to the Xcode license *again* (sigh, must be the iTunes compatibilty feature).

The issue with MacPorts is just that it doesn't provide a very informative error message. Running "upgrade outdated" in this state says:

Error: It seems you have not accepted the Xcode license; most ports will fail to build.
Error: Agree to the license by opening Xcode or running `sudo xcodebuild -license'.
Error: Unable to upgrade port: 1

But selfupdate only says:

Error: Error installing new MacPorts base: command execution failed
Please run `port -v selfupdate' for details.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

It seems to me that selfupdate could be smart enough to provide the same error message that "upgrade outdated" does, rather than requiring the user to dig into it.

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

Summary: port selfupdate breaks when going from 2.3.3 to 2.3.4port selfupdate fails with an imprecise error message when the Xcode license has not been accepted
Note: See TracTickets for help on using tickets.