Opened 3 years ago

Closed 3 years ago

#63264 closed defect (fixed)

libnotify needs to set DYLD_LIBRARY_PATH during destroot to allow build on Tiger with meson

Reported by: evanmiller (Evan Miller) Owned by: git@…
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: tiger Cc: kencu (Ken)
Port: meson libnotify

Description

I am seeing an error when attempting to install libnotify for the first time:

:info:destroot Building documentation for libnotify
:info:destroot ERROR: Error in gtkdoc helper script:
:info:destroot ERROR: ['/opt/local/bin/gtkdoc-scangobj', '--types=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/libnotify-0.7.9/docs/reference/libnotify.types', '--module=libnotify', '--run=', '--cflags=\'-DG_LOG_DOMAIN="libnotify"\' -D_REENTRANT -I/opt/local/include/gdk-pixbuf-2.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/build/. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/libnotify-0.7.9/. -pipe -Os -arch ppc -I/opt/local/include', '--ldflags=-L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/build/libnotify -lnotify -L/opt/local/lib -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lgio-2.0 -pipe -Os -arch ppc -L/opt/local/lib -Wl,-headerpad_max_install_names -arch ppc', '--cc=/opt/local/bin/gcc-apple-4.2', '--ld=/opt/local/bin/gcc-apple-4.2', '--output-dir=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/build/docs/reference'] failed with status 251
:info:destroot dyld: Library not loaded: @loader_path/libnotify.4.dylib:info:destroot   Referenced from: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libnotify/libnotify/work/build/./libnotify-scan
:info:destroot   Reason: image not found

The Build phase completes just fine. It appears that the libnotify-scan binary can't find the libnotify.4.dylib prior to installation (i.e. during Staging). I postulate that this error will not be visible during an upgrade.

System information:

:debug:sysinfo Mac OS X 10.4.11 (darwin/8.11.0) arch powerpc
:debug:sysinfo MacPorts 2.7.1
:debug:sysinfo Xcode 2.5
:debug:sysinfo SDK 10.4
:debug:sysinfo MACOSX_DEPLOYMENT_TARGET: 10.4

Full log to follow.

Attachments (2)

libnotify-main.log (15.4 KB) - added by evanmiller (Evan Miller) 3 years ago.
Main installation log
original-libnotify-main.log (85.9 KB) - added by evanmiller (Evan Miller) 3 years ago.
Complete installation log

Download all attachments as: .zip

Change History (11)

Changed 3 years ago by evanmiller (Evan Miller)

Attachment: libnotify-main.log added

Main installation log

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

Hm. Well, the build would need to set DYLD_LIBRARY_PATH to the location where libnotify.4.dylib is located during the build for this to succeed. Per the port health indicators, we have successful (non-upgrade) builds on our build system on Mac OS X 10.6 and later (and we do not attempt builds on 10.5 or earlier), so presumably this is already happening on those systems. I wonder why it is not happening for you on 10.4. The log you attached is not from a clean build (it contains lines like Skipping completed org.macports.build (libnotify)) so we cannot see the commands that were used during the build. It might be helpful if you sudo port clean libnotify, then try building it again, then attach the full log.

Changed 3 years ago by evanmiller (Evan Miller)

Attachment: original-libnotify-main.log added

Complete installation log

comment:2 Changed 3 years ago by evanmiller (Evan Miller)

Thank you for your attention here. I have attached the original installation log, which should include all build steps. Let me know if you need anything else.

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

Cc: kencu added
Port: meson added

This port builds using the meson build system. When I build on macOS 10.13.6, the only occurrence of DYLD_LIBRARY_PATH within the work directory is in build/meson-private/build.dat, which is a binary file whose format I am not familiar with but inspecting it in an editor does seem to suggest that it is set to the right path. I'm using meson 0.58.1.

Meson did not used to support macOS dynamic libraries at all, and when support for them was added, it was done in such a way that relied on rpath, a feature introduced in Mac OS X 10.5. To support 10.4, special patches were added to the meson port, and the meson port was pegged to an earlier version 0.55.3 presumably because some problems were encountered when attempting to use newer versions on 10.4, or maybe just because it had not yet been tested on those older systems.

The code in meson that sets DYLD_LIBRARY_PATH was not added until version 0.58.0, which is why it's not present for you in 0.55.3 on 10.4.

Cc'ing Ken who handles much of our older systems support. Ken, is there a way to update meson to 0.58.0 or newer on 10.4, or to backport this patch?

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

Keywords: tiger added

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

Owner: set to git@…
Port: libnotify removed
Status: newassigned
Summary: libnotify @0.7.9_0: "image not found" when building docs on 1st installmeson @0.55.3 does not set DYLD_LIBRARY_PATH during build

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

most of the time, my meson hack for Tiger actually works, which surprises me sometimes to be honest.

For ports that run software during the build or install phases, a hand-tweaked workaround is needed.

See for example ati-spi2-core , where I added this block:

platform darwin 8 {
    # meson on Tiger cannot use rpaths, so we workaround with this to find dylib
    destroot.env-append    "DYLD_LIBRARY_PATH=${build_dir}/atspi"
}

to allow the binaries to find the dylib during the destroot phase.

This is the best I have for now. A proper fix for meson, that does not use @rpaths, is possible -- they do it on Windows -- but is hard to do.

Some method that might allow Tiger to support @rpaths would be great, but that seems very hard to do.

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

Port: libnotify added
Summary: meson @0.55.3 does not set DYLD_LIBRARY_PATH during buildlibnotify needs to set DYLD_LIBRARY_PATH during destroot to allow build on Tiger with meson

comment:8 Changed 3 years ago by evanmiller (Evan Miller)

Proposed fix, inspired by @kencu and tested on a G3: https://github.com/macports/macports-ports/pull/11633

comment:9 Changed 3 years ago by evanmiller (Evan Miller)

Resolution: fixed
Status: assignedclosed

In 45bb60e2932ed89f267cf01174d7f8e5039641a2/macports-ports (master):

libnotify: Fix build on Tiger

Closes: #63264

Note: See TracTickets for help on using tickets.