Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#62797 closed defect (fixed)

legacy-support @1.0.0_0 dyld: Library not loaded: @executable_path/../lib/libMacportsLegacySupport.dylib Reason: image not found

Reported by: cave-canem Owned by: cjones051073 (Chris Jones)
Priority: Normal Milestone:
Component: ports Version: 2.6.99
Keywords: Cc: evd6219@…, kencu (Ken)
Port: legacy-support

Description

Port "rust" built with "legacy-support @ 0.15_2".

port -v installed active and legacy-support; port -v installed rust
The following ports are currently installed:
  legacy-support @0.15_2 (active) platform='darwin 13' archs='x86_64' date='2021-05-01T16:20:20+0300'
The following ports are currently installed:
  rust @1.51.0_2 (active) platform='darwin 13' archs='x86_64' date='2021-05-03T00:49:02+0300'

Trying to build port "rust" with "legacy-support @ 1.0.0_0" without changing anything else.

sudo port activate legacy-support @1.0.0_0; sudo port -k -vt upgrade -n --force rust
Password:
--->  Deactivating legacy-support @0.15_2
--->  Cleaning legacy-support
--->  Activating legacy-support @1.0.0_0
--->  Cleaning legacy-support
--->  Computing dependencies for rust.
--->  Fetching distfiles for rust
--->  Verifying checksums for rust
--->  Checksumming rustc-1.51.0-src.tar.gz
--->  Checksumming rust-std-1.50.0-x86_64-apple-darwin.tar.gz
--->  Checksumming rustc-1.50.0-x86_64-apple-darwin.tar.gz
--->  Checksumming cargo-1.50.0-x86_64-apple-darwin.tar.gz
--->  Extracting rust
--->  Extracting rustc-1.51.0-src.tar.gz
...
dyld: Library not loaded: @executable_path/../lib/libMacportsLegacySupport.dylib
  Referenced from: /opt/MacPorts/lib/libMacportsLegacySystem.B.dylib
  Reason: image not found
...
Command failed:  cd "/opt/MacPorts/var/macports/build/_opt_macports-ports_lang_rust/rust/work/rustc-1.51.0-src" && /usr/bin/make -j4 -w all VERBOSE=1 BOOTSTRAP_ARGS="-vv -j4"
Exit code: 2
The following files would have been hidden from the build system by trace mode if they existed:
  /usr/gnu/include
  /usr/local/MacPorts/var/macports/home/.CFUserTextEncoding
  /usr/local/include
Error: Failed to build rust: command execution failed
Error: See /opt/MacPorts/var/macports/logs/_opt_macports-ports_lang_rust/rust/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

See attached "main.log"

Attachments (1)

main.log (84.9 KB) - added by cave-canem 4 years ago.
main.log

Download all attachments as: .zip

Change History (16)

Changed 4 years ago by cave-canem

Attachment: main.log added

main.log

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

hmm. Looks like the library is being built with the @executable_path embedded in it for testing as expected:

https://github.com/macports/macports-legacy-support/blob/9e9e6bf62bb6e835eff9a9c1aca6ddde1bd09a40/Makefile#L40

and there is an install phase that is supposed to rewrite that @executable_path to a full path here:

https://github.com/macports/macports-legacy-support/blob/9e9e6bf62bb6e835eff9a9c1aca6ddde1bd09a40/Makefile#L316

but -- it appears to be not changing the reference to libMacportsLegacySupport.dylib in libMacportsLegacySystem.B.dylib.

Mine look OK:

$ port contents legacy-support | grep dylib | xargs ls -la
-rwxr-xr-x  1 root  admin  67576 26 Apr 11:25 /opt/local/lib/libMacportsLegacySupport.dylib
-rwxr-xr-x  1 root  admin  67576 26 Apr 11:25 /opt/local/lib/libMacportsLegacySystem.B.dylib


$ port contents legacy-support | grep dylib | xargs otool -L 
/opt/local/lib/libMacportsLegacySupport.dylib:
	/opt/local/lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
/opt/local/lib/libMacportsLegacySystem.B.dylib:
	/opt/local/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
Last edited 4 years ago by kencu (Ken) (previous) (diff)

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

Cc: kencu added
Owner: set to cjones051073
Status: newassigned

comment:3 Changed 4 years ago by cave-canem

I have:

port contents legacy-support | rg "dylib" | xargs ls -la
-rwxr-xr-x  1 root  wheel  19684 May  2 15:02 /opt/MacPorts/lib/libMacportsLegacySupport.dylib
-rwxr-xr-x  1 root  wheel  23780 May  2 15:02 /opt/MacPorts/lib/libMacportsLegacySystem.B.dylib
port contents legacy-support | rg "dylib" | xargs otool -L
/opt/MacPorts/lib/libMacportsLegacySupport.dylib:
	/opt/MacPorts/lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/MacPorts/lib/libMacportsLegacySystem.B.dylib:
	/opt/MacPorts/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1, reexport)
	@executable_path/../lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.0)

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

Just because I have no idea what is going on, can you please do this:

sudo port -f uninstall legacy-support
sudo port -v -s install legacy-support

and then run your grep lines again and see if anything is better?

Last edited 4 years ago by kencu (Ken) (previous) (diff)

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

There was a bit of race condition that Chris fixed -- maybe that is related to this in some way? If you get the same wonky @executable_path link, please make sure you have run sudo port selfupdate to pick up those latest Portfile fixes.

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

Oh oh -- I just rebuilt it and now I get that too:

$ otool -L libMacportsLegacySystem.B.dylib
libMacportsLegacySystem.B.dylib:
	/opt/local/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
	@executable_path/../lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.0)

maybe Chris's race condition changes have resulted in this happening.

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

It looks like 0.15 was OK, but 1.0.0 is not:

$ otool -L /opt/local/lib/libMacportsLegacySystem.B.dylib
/opt/local/lib/libMacportsLegacySystem.B.dylib:
	/opt/local/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
	@executable_path/../lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.0)

$ port -v installed legacy-support
The following ports are currently installed:
  legacy-support @0.14.2_0 platform='darwin 11' archs='x86_64' date='2021-04-16T17:43:41-0700'
  legacy-support @0.14.2_1 platform='darwin 11' archs='x86_64' date='2021-04-23T07:45:00-0700'
  legacy-support @0.15_0 platform='darwin 11' archs='x86_64' date='2021-04-29T07:32:07-0700'
  legacy-support @1.0.0_0 (active) platform='darwin 11' archs='x86_64' date='2021-05-02T23:39:15-0700'

$ sudo port activate legacy-support
The following versions of legacy-support are currently installed:
 1) legacy-support @0.14.2_0
 2) legacy-support @0.14.2_1
 3) legacy-support @0.15_0
 4) legacy-support @1.0.0_0 (active)
Enter a number to select an option: 3
--->  Deactivating legacy-support @1.0.0_0
--->  Cleaning legacy-support
--->  Activating legacy-support @0.15_0


$ otool -L /opt/local/lib/libMacportsLegacySystem.B.dylib
/opt/local/lib/libMacportsLegacySystem.B.dylib:
	/opt/local/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)


comment:9 Changed 4 years ago by cjones051073 (Chris Jones)

Hmmm. Let me take a look as I never saw this in my testing. That Make change is supposed to just force them to be built in a certain order...

comment:10 Changed 4 years ago by cjones051073 (Chris Jones)

OK, can reproduce in my 10.9 VM...

comment:11 Changed 4 years ago by cjones051073 (Chris Jones)

OK, have a fix. Will update asap...

comment:12 Changed 4 years ago by Chris Jones <jonesc@…>

Resolution: fixed
Status: assignedclosed

In feb341993ce4cd3ace2e1677e24cbcc4b74794f8/macports-ports (master):

legacy-support: Update to 1.0.1
Fixes: #62797

comment:13 Changed 4 years ago by cjones051073 (Chris Jones)

Above should fix it

MacVM109 ~/Projects/MacPorts/ports > otool -L /opt/local/lib/libMacportsLegacyS*.dylib
/opt/local/lib/libMacportsLegacySupport.dylib:
	/opt/local/lib/libMacportsLegacySupport.dylib (compatibility version 1.0.0, current version 1.0.1)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/opt/local/lib/libMacportsLegacySystem.B.dylib:
	/opt/local/lib/libMacportsLegacySystem.B.dylib (compatibility version 1.0.0, current version 1.0.1)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
MacVM109 ~/Projects/MacPorts/ports > 

comment:14 Changed 4 years ago by cave-canem

Hello Chris!

The "rust" port is currently being compiled with "legacy-support @ 1.0.1_0".

This is a very, very long process ...

comment:15 Changed 4 years ago by cave-canem

port -v installed active and legacy-support; sudo port -k -vt upgrade -n --force rust
The following ports are currently installed:
  legacy-support @1.0.1_0 (active) platform='darwin 13' archs='x86_64' date='2021-05-03T16:02:40+0300'
Portfile changed since last build; discarding previous state.
--->  Computing dependencies for rust.
--->  Fetching distfiles for rust
--->  Verifying checksums for rust
...
x ./opt/MacPorts/bin/rustfmt
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.

Thanks Chris!

Everything seems to work now (and seems no pitfalls).

Good job!

Note: See TracTickets for help on using tickets.