Opened 4 years ago

Closed 4 years ago

#60845 closed defect (fixed)

qscintilla-qt5: libqscintilla2_qt5.15.0.0.dylib's install_name contains @rpath

Reported by: mcmara (Jack McMara) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: michaelld (Michael Dickens), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: qscintilla-qt5

Description

During the build process of octave 5.2.0_3 somehow @rpath is not set:

$ otool -L /opt/local/libexec/octave/5.2.0/exec/x86_64-apple-darwin19.x.x/octave-gui 
/opt/local/libexec/octave/5.2.0/exec/x86_64-apple-darwin19.x.x/octave-gui:
	/opt/local/lib/octave/5.2.0/liboctgui.5.dylib (compatibility version 6.0.0, current version 6.1.0)
	/opt/local/lib/octave/5.2.0/liboctinterp.7.dylib (compatibility version 8.0.0, current version 8.1.0)
	/opt/local/lib/octave/5.2.0/liboctave.7.dylib (compatibility version 8.0.0, current version 8.1.0)
	@rpath/libqscintilla2_qt5.15.dylib (compatibility version 15.0.0, current version 15.0.0)
	/opt/local/lib/libhdf5.103.dylib (compatibility version 106.0.0, current version 106.0.0)
	/opt/local/lib/libGraphicsMagick++.12.dylib (compatibility version 17.0.0, current version 17.3.0)
	/opt/local/lib/libGraphicsMagick.3.dylib (compatibility version 25.0.0, current version 25.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/opt/local/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
	/opt/local/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.2.0)
	/opt/local/lib/libgl2ps.1.dylib (compatibility version 1.0.0, current version 1.4.2)
	/opt/local/lib/libcurl.4.dylib (compatibility version 11.0.0, current version 11.0.0)
	/opt/local/lib/libcholmod.3.dylib (compatibility version 3.0.0, current version 3.0.14)
	/opt/local/lib/libumfpack.5.dylib (compatibility version 5.0.0, current version 5.7.9)
	/opt/local/lib/libamd.2.dylib (compatibility version 2.0.0, current version 2.4.6)
	/opt/local/lib/libcamd.2.dylib (compatibility version 2.0.0, current version 2.4.6)
	/opt/local/lib/libcolamd.2.dylib (compatibility version 2.0.0, current version 2.9.6)
	/opt/local/lib/libccolamd.2.dylib (compatibility version 2.0.0, current version 2.9.6)
	/opt/local/lib/libcxsparse.3.dylib (compatibility version 3.0.0, current version 3.2.0)
	/opt/local/lib/libsuitesparseconfig.5.dylib (compatibility version 5.0.0, current version 5.7.2)
	/opt/local/lib/libarpack.2.dylib (compatibility version 4.0.0, current version 4.0.0)
	/opt/local/lib/libqrupdate.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libfftw3_threads.3.dylib (compatibility version 9.0.0, current version 9.8.0)
	/opt/local/lib/libfftw3.3.dylib (compatibility version 9.0.0, current version 9.8.0)
	/opt/local/lib/libfftw3f_threads.3.dylib (compatibility version 9.0.0, current version 9.8.0)
	/opt/local/lib/libfftw3f.3.dylib (compatibility version 9.0.0, current version 9.8.0)
	/opt/local/lib/libvecLibFort.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/local/lib/libreadline.8.dylib (compatibility version 8.0.0, current version 8.0.0)
	/opt/local/lib/libncurses.6.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libpcre.1.dylib (compatibility version 4.0.0, current version 4.12.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
	/opt/local/lib/libgcc/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
	/opt/local/lib/libgcc/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)
	/opt/local/libexec/qt5/lib/QtCore.framework/Versions/5/QtCore (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtXml.framework/Versions/5/QtXml (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtSql.framework/Versions/5/QtSql (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtGui.framework/Versions/5/QtGui (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtHelp.framework/Versions/5/QtHelp (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtPrintSupport.framework/Versions/5/QtPrintSupport (compatibility version 5.14.0, current version 5.14.2)
	/opt/local/libexec/qt5/lib/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.14.0, current version 5.14.2)
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 162.0.0)
	/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 902.1.0)

This causes failure to run:

$ octave
dyld: Library not loaded: @rpath/libqscintilla2_qt5.15.dylib
  Referenced from: /opt/local/libexec/octave/5.2.0/exec/x86_64-apple-darwin19.x.x/octave-gui
  Reason: image not found
Abort trap: 6

Prior macports versions of octave were ok, with the @rpath above correctly pointing to /opt/local/libexec/qt5/lib. Also, since octave is used during the build of (some of?) its relative packages (e.g. the octave-statistics macport), this issue causes error and abort of the installation of such package(s).

My system:

$ uname -a
Darwin xxxxxxxxxxxxx.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

$ port version
Version: 2.6.2

$ xcodebuild -version
Xcode 11.5
Build version 11E608c

Change History (12)

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

Issue might be with libqscintilla2_qt5.15.dylib rather than octave, as every other library is correctly referenced.

could find libqscintilla2_qt5.15.dylib and give us the installed name of that library?

comment:2 Changed 4 years ago by mcmara (Jack McMara)

Here it is what I have:

ls -al /opt/local/libexec/qt5/lib/libqscintilla2*
-rwxr-xr-x  1 root  admin  1874456 Jul 15 17:08 /opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.0.dylib
lrwxr-xr-x  1 root  admin       31 Jul 15 17:08 /opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.dylib -> libqscintilla2_qt5.15.0.0.dylib
lrwxr-xr-x  1 root  admin       31 Jul 15 17:08 /opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.dylib -> libqscintilla2_qt5.15.0.0.dylib
lrwxr-xr-x  1 root  admin       31 Jul 15 17:08 /opt/local/libexec/qt5/lib/libqscintilla2_qt5.dylib -> libqscintilla2_qt5.15.0.0.dylib

Symlink seems there...?

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

Cc: michaelld MarcusCalhoun-Lopez added
Keywords: octave rpath octave-gui removed
Port: qscintilla-qt5 added; octave @5.2.0_3 removed
Summary: octave @5.2.0_3: rpath unset in octave-guiqscintilla-qt5: libqscintilla2_qt5.15.0.0.dylib's install_name contains @rpath

Yes, but what is its install name?

On my system:

$ otool -L /opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.0.dylib | head -n 2
/opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.0.dylib:
	@rpath/libqscintilla2_qt5.15.dylib (compatibility version 15.0.0, current version 15.0.0)

That's probably not what we want to see. It shouldn't be using @rpath.

comment:4 Changed 4 years ago by reneeotten (Renee Otten)

see also #60796

comment:5 Changed 4 years ago by mcmara (Jack McMara)

Here it is mine, same as yours:

$ otool -L /opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.0.dylib | head -n 2
/opt/local/libexec/qt5/lib/libqscintilla2_qt5.15.0.0.dylib:
	@rpath/libqscintilla2_qt5.15.dylib (compatibility version 15.0.0, current version 15.0.0)

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

have to fix this, and then revbump absolutely everything that uses it.... sigh.

comment:7 Changed 4 years ago by mcmara (Jack McMara)

While waiting for the fixes, a temporary workaround for using octave and for installing further MacPorts' octave packages such as octave-statistics may be the following:

sudo install_name_tool -add_rpath /opt/local/libexec/qt5/lib octave-gui

That will add a LC_RPATH to the executable:

 $ otool -l /opt/local/libexec/octave/5.2.0/exec/x86_64-apple-darwin18.x.x/octave-gui | tail -4
Load command 59
          cmd LC_RPATH
      cmdsize 40
         path /opt/local/libexec/qt5/lib (offset 12)

Now octave launches and sudo port install octave-statistics works.

comment:8 Changed 4 years ago by josmithiii

Thanks for the workaround! I had to say it like this:

sudo install_name_tool -add_rpath /opt/local/libexec/qt5/lib /opt/local/libexec/octave/5.2.0/exec/x86_64-apple-darwin19.x.x/octave-gui

comment:9 in reply to:  6 Changed 4 years ago by reneeotten (Renee Otten)

Replying to kencu:

have to fix this, and then revbump absolutely everything that uses it.... sigh.

@kencu: I opened a PR for this - would you mind taking a look at that? It works for me, but I am not sure if it's the "correct" solution and/or something else is needed. If it looks good, all ports depending on this will need a rev-bump of course.

Version 0, edited 4 years ago by reneeotten (Renee Otten) (next)

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

I suppose the official method to fix this would be the patch you found in that mailing list topic, by adding that info referenced to the PRO file during the build.... although having us do it in post-destroot is not a lot different.

Upstream should understand why the @rpath is no good -- if you use @rpath, as we have seen, EVERY piece of software that uses the library has to have it's build changed to accomodate the @rpath location, and has to be made aware of where the library is actually installed. This is not a useful experience.

@rpath based library links have their uses -- application bundles, for example -- but for the most part, it is just an extra pain to manage, and has the fun aspect of it often not being easy to be sure which @rpath'd library actually loaded, if there are more than one.

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

comment:11 Changed 4 years ago by reneeotten (Renee Otten)

In 3d3a2d7864b7619cd0b8b0f271456b10c3b8693d/macports-ports (master):

qscintilla-qt5: fix rpath in install_name

Closes: #60796
See: #60845

comment:12 Changed 4 years ago by reneeotten (Renee Otten)

Resolution: fixed
Status: newclosed

other ports were rev-bumped in a second commit that should have closed this ticket.

Note: See TracTickets for help on using tickets.