Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#67349 closed defect (fixed)

libxkbcommon @1.5.0: binaries link with libraries using @loader_path or @rpath and therefore don't work

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc:
Port: libxkbcommon

Description

The symptom is that port finds

Could not open /opt/local/bin/libxkbcommon.0.dylib: Error opening or reading file (referenced from /opt/local/bin/xkbcli)
DEBUG: Marking /opt/local/bin/xkbcli as broken
Could not open /opt/local/libexec/xkbcommon/libxkbcommon.0.dylib: Error opening or reading file (referenced from /opt/local/libexec/xkbcommon/xkbcli-compile-keymap)
DEBUG: Marking /opt/local/libexec/xkbcommon/xkbcli-compile-keymap as broken
DEBUG: Marking /opt/local/libexec/xkbcommon/xkbcli-how-to-type as broken
--->  Found 3 broken files, matching files to ports
--->  Found 1 broken port, determining rebuild order
DEBUG: Broken: libxkbcommon

and tries to:

DEBUG: Processing port libxkbcommon @0:1.5.0_0
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: libxkbcommon @1.5.0
Continue? [Y/n]: 

which fails every time. Additional symptoms:

ls -l /opt/local/bin/libxkbcommon.0.dylib /opt/local/bin/xkbcli
ls: /opt/local/bin/libxkbcommon.0.dylib: No such file or directory
-rwxr-xr-x   1 root  admin  25692  1 Mai 23:39 /opt/local/bin/xkbcli
otool -L /opt/local/bin/xkbcli
/opt/local/bin/xkbcli:
	@loader_path/libxkbcommon.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.12)

I uninstalled the software, no other port depends on it. It is rebuilding.

Attachments (1)

patch-libxkbcommon-linkages.diff (284 bytes) - added by kencu (Ken) 12 months ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 12 months ago by ballapete (Peter "Pete" Dyballa)

The rebuilt software is still faulty:

xkbcli --help
dyld: Library not loaded: @loader_path/libxkbcommon.0.dylib
  Referenced from: /opt/local/bin/xkbcli
  Reason: image not found
Trace/BPT trap (core dumped)

comment:2 Changed 12 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… removed
Keywords: tiger ppc removed
Owner: set to ryandesign
Status: newaccepted
Summary: libxkbcommon @1.5.0 on PPC Tiger, Mac OS X 10.4.11, has at least one faultily built binary,libxkbcommon @1.5.0: binaries link with libraries using @loader_path or @rpath and therefore don't work

It doesn't work on Monterey x86_64 either:

% otool -L /opt/local/{bin/xkbcli,lib/libxkbcommon.dylib}
/opt/local/bin/xkbcli:
	@rpath/libxkbcommon.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
/opt/local/lib/libxkbcommon.dylib:
	/opt/local/lib/libxkbcommon.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
% xkbcli 
dyld[24238]: Library not loaded: '@rpath/libxkbcommon.0.dylib'
  Referenced from: '/opt/local/bin/xkbcli'
  Reason: tried: '/usr/local/lib/libxkbcommon.0.dylib' (no such file), '/usr/lib/libxkbcommon.0.dylib' (no such file)
zsh: abort      xkbcli

comment:3 Changed 12 months ago by kencu (Ken)

these @rpath (and for Tiger, @loader_path) references are supposed to be rewritten by meson to full path names to the library on installation.

libxkbcommon doesn't seem to be doing anything special in it's Portfile to break this...

not sure why it is not doing it's usual thing

comment:4 Changed 12 months ago by kencu (Ken)

this looks like an upstream bug for libxkbcommon.

This patch fixes it for this one executable:

--- meson.build.orig	2023-05-01 22:52:49
+++ meson.build	2023-05-01 22:52:56
@@ -417,6 +417,7 @@
     )
 
     executable('xkbcli', 'tools/xkbcli.c',
+               link_with: libxkbcommon,
                dependencies: tools_dep, install: true)
     install_man('tools/xkbcli.1')
 

but I don't think it is the right generic fix to fix all the executables.

Changed 12 months ago by kencu (Ken)

comment:5 Changed 12 months ago by kencu (Ken)

and - if meson has been trying to bill itself as the "simpler build tool" because it is based on python which everyone knows and so therefore has no gobbleygook arcane commands in it -- well, it has turned out to be just as arcane as every other build system, in the end.

Reading through the meson.build file for this simple little library with a few command line tools that go with it is nauseatingly complicated, with all it's indirection of indirection of indirections.

comment:6 Changed 12 months ago by ballapete (Peter "Pete" Dyballa)

It built and installed on PPC Tiger, Mac OS X 10.4.11, but port found afterwards:

Could not open /opt/local/libexec/xkbcommon/libxkbcommon.0.dylib: Error opening or reading file (referenced from /opt/local/libexec/xkbcommon/xkbcli-compile-keymap)
DEBUG: Marking /opt/local/libexec/xkbcommon/xkbcli-compile-keymap as broken
DEBUG: Marking /opt/local/libexec/xkbcommon/xkbcli-how-to-type as broken
--->  Found 2 broken files, matching files to ports
--->  Found 1 broken port, determining rebuild order
DEBUG: Broken: libxkbcommon
DEBUG: Processing port libxkbcommon @0:1.5.0_0
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: libxkbcommon @1.5.0
Continue? [Y/n]:

Obviously an additional fix is necessary:

otool -L /opt/local/libexec/xkbcommon/*
/opt/local/libexec/xkbcommon/xkbcli-compile-keymap:
	@loader_path/libxkbcommon.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.12)
/opt/local/libexec/xkbcommon/xkbcli-how-to-type:
	@loader_path/libxkbcommon.0.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.12)

comment:8 Changed 12 months ago by ballapete (Peter "Pete" Dyballa)

--->  No broken files found.
--->  No broken ports found.

comment:9 Changed 12 months ago by kencu (Ken)

Resolution: fixed
Status: acceptedclosed

In add4ae40f8562d99f3ece1ecd890043d9c2add8f/macports-ports (master):

libxkbcommon: fix executable linkages

meson.build needs to declare that these
executables link against libxkbcommon.0.dylib in order
for meson to know to rewrite these linkages
on installation.

closes: #67349

comment:10 in reply to:  5 Changed 12 months ago by jmroot (Joshua Root)

Replying to kencu:

and - if meson has been trying to bill itself as the "simpler build tool" because it is based on python which everyone knows and so therefore has no gobbleygook arcane commands in it -- well, it has turned out to be just as arcane as every other build system, in the end.

Reading through the meson.build file for this simple little library with a few command line tools that go with it is nauseatingly complicated, with all it's indirection of indirection of indirections.

Sounds very similar to what scons was promising 20 years ago, with similar results.

Note: See TracTickets for help on using tickets.