Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63099 closed defect (worksforme)

Selfupdate failure to 2.7.1: /usr/bin/cc can't link -lSystem

Reported by: gallafent Owned by:
Priority: Normal Milestone:
Component: base Version: 2.7.1
Keywords: Cc: jmroot (Joshua Root)
Port:

Description

This is a really strange one (to me at least!).

While running the configure script of selfupdate, the compiler at /usr/bin/cc can't build executables, claiming that it can't link -lSystem. If I run the same command on the command line, on a similarly trival do-nothing source file containing a trivial main function returning 0, with or without sudo, I get a working executable.

On a hunch, I gave /usr/bin/cc “full disk access” using System Preferences, in case this was causing problems, and tried running again, but that made no difference.

The only unusual thing about my config is that /opt/local is not on the system drive of my mac, it's on an external drive. Because / is mounted read only these days, I was unable to delete /opt and replace it with a symlink to the right location on the external drive, I instead symlinked one level down so that inside /opt, there's the symlink:

williamg@forth /opt % ls -l
total 0
lrwxr-xr-x  1 root  wheel  27  8 Mar 10:32 local -> /Volumes/S860E1TB/opt/local

(Moving everything below /opt back to the system drive isn't an option, it's too full).

config.log from /Volumes/S860E1TB/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/base will be attached.

Output of port -v selfupdate:

williamg@forth base % sudo port -v selfupdate
Password:
--->  Updating MacPorts base sources using rsync

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done

sent 16 bytes  received 55 bytes  142.00 bytes/sec
total size is 85857280  speedup is 1209257.46

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done

sent 16 bytes  received 62 bytes  156.00 bytes/sec
total size is 512  speedup is 6.56
MacPorts base version 2.7.0 installed,
MacPorts base version 2.7.1 downloaded.
--->  Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done
./

sent 68 bytes  received 99 bytes  111.33 bytes/sec
total size is 84753920  speedup is 507508.50

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done

sent 16 bytes  received 56 bytes  48.00 bytes/sec
total size is 15837700  speedup is 219968.06

Willkommen auf dem RSYNC-server auf ftp.fau.de.
Nicht all unsere Mirror sind per rsync verfuegbar.

Welcome to the RSYNC daemon on ftp.fau.de.
Not all of our mirrors are available through rsync.


receiving file list ... done

sent 16 bytes  received 63 bytes  158.00 bytes/sec
total size is 512  speedup is 6.48
--->  MacPorts base is outdated, installing new version 2.7.1
Installing new MacPorts release in /opt/local as _unknown:_unknown; permissions 0755

checking build system type... x86_64-apple-darwin20.5.0
checking host system type... x86_64-apple-darwin20.5.0
checking target system type... x86_64-apple-darwin20.5.0
checking MacPorts version... 2.7.1
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking macOS version... 11.4
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 12.5
checking whether the C compiler works... no
configure: error: in `/Volumes/S860E1TB/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/base':
configure: error: C compiler cannot create executables
See `config.log' for more details
Command failed: CC=/usr/bin/cc SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk ./configure --prefix=/opt/local --with-install-user=_unknown --with-install-group=_unknown --with-directory-mode=0755 --enable-readline && SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 77
Error: Error installing new MacPorts base: command execution failed
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

Any advice welcome / further testing or information required, let me know!

Attachments (1)

config.log (8.9 KB) - added by gallafent 3 years ago.
config.log from port -v selfupdate (trying to update to 2.7.1)

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by gallafent

Attachment: config.log added

config.log from port -v selfupdate (trying to update to 2.7.1)

comment:1 Changed 3 years ago by jmroot (Joshua Root)

Odd that the SDK found is 11.0 when your Xcode is 12.5. Does /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/lib/libSystem.tbd exist? Can you try updating your Command Line Tools as per ProblemHotlist#reinstall-clt?

comment:2 Changed 3 years ago by jmroot (Joshua Root)

Cc: jmroot added

comment:3 Changed 3 years ago by gallafent

Hmm. Not much present in that SDK's lib directory, certainly:

williamg@forth ~ % ls /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/usr/lib              
libecpg.6.5.tbd			libecpg_compat.3.tbd		libpgtypes.tbd			libviolet_nocatch.tbd
libecpg.6.tbd			libecpg_compat.tbd		libpq.5.6.tbd			libviolet_verifier.tbd
libecpg.tbd			libpgtypes.3.4.tbd		libpq.5.tbd			libviolet_verifier_qemu.tbd
libecpg_compat.3.5.tbd		libpgtypes.3.tbd		libpq.tbd

These were the available SDK directories at that point:

williamg@forth ~ % ls /Library/Developer/CommandLineTools/SDKs/                      
MacOSX10.14.sdk	MacOSX10.15.sdk	MacOSX11.0.sdk

Following your advice, I went to download the Command Line Tools to reinstall them, and noticed there's a new point release of Xcode available, 2.5.1, so I installed that (drive space problems meaning I tend to install from the archive rather than allowing the App Store to manage and update my Xcode installation, it feels as if you need about 50GB free on the system drive if you want that to work!). After that, this is still true (no libSystem.tbd in the 11.0 SDK), but now there's some more stuff there:

williamg@forth ~ % ls /Library/Developer/CommandLineTools/SDKs 
MacOSX.sdk	MacOSX10.14.sdk	MacOSX10.15.sdk	MacOSX11.0.sdk	MacOSX11.3.sdk	MacOSX11.sdk

… and MacOSX.sdk and MacOSX11.sdk are both symlinks to MacOSX11.3.sdk … and the selfupdate appears to proceed and complete successfully.

Thanks for accurately intuiting where the problem was! I wonder what caused my SDK installation to be broken …

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

Resolution: worksforme
Status: newclosed

Great, so we'll call this resolved then. However I opened #63130 to have port diagnose check for this situation.

Last edited 3 years ago by jmroot (Joshua Root) (previous) (diff)

comment:5 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

I don't think you should still have MacOSX11.0.sdk at that point, and if you do, you should probably remove it.

Note: See TracTickets for help on using tickets.