Opened 2 years ago

Last modified 2 years ago

#64327 assigned defect

clang-9.0 @9.0.1_4+analyzer+libstdcxx+universal Failed to build on macOS Sierra 10.12.6 (16G2136) with Xcode 9.2 (9C40b)

Reported by: TallTed (Ted Thibodeau Jr) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: sierra Cc:
Port: clang-9.0

Description

:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/work/build'
:info:build [ 98%] Built target libclang
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/work/build'
:info:build make: *** [all] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/work/build" && /usr/bin/make -j8 -w all VERBOSE=ON 
:info:build Exit code: 2
:error:build Failed to build clang-9.0: command execution failed
:debug:build Error code: CHILDSTATUS 65637 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$callback {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec -callback portprogress::target_progress_callback build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/main.log for details.

Attachments (1)

main.log.gz (445.9 KB) - added by TallTed (Ted Thibodeau Jr) 2 years ago.
gzipped main.log

Download all attachments as: .zip

Change History (9)

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

Owner: set to jeremyhu
Status: newassigned
Summary: clang-9.0-9.0.1_4+analyzer+libstdcxx+universal.darwin_16.i386-x86_64.tbz2 Failed to build clang-9.0 on macOS Sierra 10.12.6 (16G2136) with Xcode 9.2 (9C40b)clang-9.0 @9.0.1_4+analyzer+libstdcxx+universal Failed to build on macOS Sierra 10.12.6 (16G2136) with Xcode 9.2 (9C40b)

Please attach the main.log (you can compress it first if it is large.)

Changed 2 years ago by TallTed (Ted Thibodeau Jr)

Attachment: main.log.gz added

gzipped main.log

comment:2 Changed 2 years ago by TallTed (Ted Thibodeau Jr)

In case it matters -- this error came up while upgrading from El Capitan to Sierra, late in processing the `sudo ./restore_ports.tcl myports.txt` command.

Please let me know if you need anything else.

comment:3 Changed 2 years ago by TallTed (Ted Thibodeau Jr)

jeremyhu (/cc jmroot)

(I'm wondering if the assignment to jeremyhu might have been accidental?)

Any progress on fixing this, or suggestions for a manual workaround that ensures that all previously installed ports are re-installed/updated?

I will be upgrading from Sierra to High Sierra in the next few months, which may moot the specific error above for me, but I do hope to not break anything nor lose any installed ports in the process.

Thanks for your time and efforts!

Last edited 2 years ago by TallTed (Ted Thibodeau Jr) (previous) (diff)

comment:4 Changed 2 years ago by kencu (Ken)

:info:build ld: in '/opt/local/lib/libpcap.A.dylib', file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libpcap.A.dylib for architecture i386
:info:build ld: in '/opt/local/lib/libpcap.A.dylib', file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libpcap.A.dylib for architecture i386

Looks like it wants to link against libpcap.A.dylib but is not finding it universal.

I didn't know it used that library, off the top of my head.

Either deactivate the port that provides it (found like this):

port provides /opt/local/lib/libpcap.A.dylib

or reinstall that port +universal to make the build happy.

In cases like this, it should either be forced to be skipped if present by the build, or specifically required for the build (and then will be subject to the usual +universal testing mechanisms).

comment:5 Changed 2 years ago by TallTed (Ted Thibodeau Jr)

Thanks for the suggestion, kencu ... but no joy.

/opt/local/lib/libpcap.A.dylib is provided by: libpcap so port install libpcap +universal

The ./restore_ports.tcl myports.txt still fails on clang-9.0.

Apparently the restore_ports.tcl installs the 64-bit libpcap even though the fat binary is already present, apparently because nmap requires it --

$ sudo port uninstall libpcap
The following versions of libpcap are currently installed:
 1) libpcap @1.10.1_0 (active)
 2) libpcap @1.10.1_0+universal
Enter option(s) [1-2/all]: all
Note: It is not recommended to uninstall/deactivate a port that has dependents as it breaks the dependents.
The following ports will break: nmap @7.92_3
Continue? [y/N]: y
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating libpcap @1.10.1_0
--->  Cleaning libpcap
--->  Uninstalling libpcap @1.10.1_0
Note: It is not recommended to uninstall/deactivate a port that has dependents as it breaks the dependents.
The following ports will break: nmap @7.92_3
Continue? [y/N]: y
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Uninstalling libpcap @1.10.1_0+universal
$ sudo port install libpcap +universal
--->  Fetching archive for libpcap
--->  Attempting to fetch libpcap-1.10.1_0+universal.darwin_16.i386-x86_64.tbz2 from https://packages.macports.org/libpcap
--->  Attempting to fetch libpcap-1.10.1_0+universal.darwin_16.i386-x86_64.tbz2.rmd160 from https://packages.macports.org/libpcap
--->  Installing libpcap @1.10.1_0+universal
--->  Activating libpcap @1.10.1_0+universal
--->  Cleaning libpcap
--->  Scanning binaries for linking errors
--->  No broken files found.                             
--->  No broken ports found.
...
$ file /opt/local/lib/libpcap.A.dylib
/opt/local/lib/libpcap.A.dylib: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit dynamically linked shared library x86_64] [i386:Mach-O dynamically linked shared library i386]
/opt/local/lib/libpcap.A.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64
/opt/local/lib/libpcap.A.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
$ sudo ./restore_ports.tcl myports.txt 
...
--->  Fetching archive for libpcap
--->  Attempting to fetch libpcap-1.10.1_0.darwin_16.x86_64.tbz2 from https://packages.macports.org/libpcap
--->  Attempting to fetch libpcap-1.10.1_0.darwin_16.x86_64.tbz2.rmd160 from https://packages.macports.org/libpcap
--->  Installing libpcap @1.10.1_0
--->  Deactivating libpcap @1.10.1_0+universal
--->  Cleaning libpcap
--->  Activating libpcap @1.10.1_0
--->  Cleaning libpcap
...
--->  Computing dependencies for clang-9.0
--->  Fetching archive for clang-9.0
--->  Attempting to fetch clang-9.0-9.0.1_4+analyzer+libstdcxx+universal.darwin_16.i386-x86_64.tbz2 from https://packages.macports.org/clang-9.0
--->  Attempting to fetch clang-9.0-9.0.1_4+analyzer+libstdcxx+universal.darwin_16.i386-x86_64.tbz2 from https://ywg.ca.packages.macports.org/mirror/macports/packages/clang-9.0
--->  Attempting to fetch clang-9.0-9.0.1_4+analyzer+libstdcxx+universal.darwin_16.i386-x86_64.tbz2 from https://mse.uk.packages.macports.org/clang-9.0
--->  Building clang-9.0
Error: Failed to build clang-9.0: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_llvm-9.0/clang-9.0/main.log for details.
...
$ file /opt/local/lib/libpcap.A.dylib
/opt/local/lib/libpcap.A.dylib: Mach-O 64-bit dynamically linked shared library x86_64

comment:6 Changed 2 years ago by kencu (Ken)

remove pcap from your myports.txt and install it manually universal.

Then run your restore ports again.

comment:7 Changed 2 years ago by kencu (Ken)

As an aside, sometimes when you are upgrading like this, you need to look through the ports in "myports.txt" and do some culling.

Things advance, what is used on one system version as a compiler is not used on a newer system version, things that build on an older system might not build on a newer system, or might be quite inappropriate.

I would say remove anything in myports.txt that looks like it is related to a compiler or toolchain element. Like anything that has clang or gcc or ld64 or cctools in the name or in the variant.

Then your myports.txt will just have the actual software you want, and not the (likely out-of-date) toolchain elements. When you run the restore script, any needed toolchain items will be automatically (and correctly!) added, updating your toolchain to what it needs to be now to support your currently requested ports.

comment:8 Changed 2 years ago by TallTed (Ted Thibodeau Jr)

Ahhhh, got it. Edited myports.txt from --

  libpcap @1.10.1_0 (active) requested_variants='' platform='darwin 15' archs='x86_64' date='2021-06-10T09:46:26-0400'

-- to --

  libpcap @1.10.1_0 (active) requested_variants='+universal' platform='darwin 15' archs='i386 x86_64' date='2021-06-10T09:46:26-0400'

Manually uninstalled libpcap and clang-9.0, and then reran the sudo ./restore_ports.tcl myports.txt.

Not only did it succeed, but it finished MUCH more quickly than the previous failures.

Regarding your suggestion to cull what's in myports.txt... I'm a dumb user, and only installed a few ports with intent (the one that gets most use is mtr). So I've really very little clue about what's "related to a compiler or toolchain element".

I *do* periodically run sudo port selfupdate, sudo port upgrade outdated, and sudo port reclaim, but I guess these don't quite do what they say on the tin?

At any rate... Hopefully this sequence provides enough clues to the relevant port manager(s) that they can fix the bit(s) that build(s) requested_variants='' platform='darwin 15' archs='x86_64' instead of requested_variants='+universal' platform='darwin 15' archs='i386 x86_64', and this won't bite anyone else in future.

Note: See TracTickets for help on using tickets.