Merging gprolog installs the package with broken links in /usr/bin: [i] ~$ qlist gprolog | xargs -I '{}' find '{}' -type l | xargs file /usr/bin/gplc: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/gplc /usr/bin/gprolog: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/gprolog /usr/bin/wam2ma: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/wam2ma /usr/bin/pl2wam: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/pl2wam /usr/bin/fd2c: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/fd2c /usr/bin/hexgplc: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/hexgplc /usr/bin/ma2asm: broken symbolic link to /var/tmp/portage/dev-lang/gprolog-1.5.0/image//usr/lib64/gprolog-1.5.0/bin/ma2asm [i] ~$ I initially thought this might be related to Clang 16 testing, but running the build without the hook also produced bad results. The hook does mark the package as clang16-broken though. Something to investigate later. Reproducible: Always Steps to Reproduce: 1. emerge =dev-lang/gprolog-1.5.0 2. file /usr/bin/gprolog Actual Results: /usr/bin/ contains links to /var/tmp/portage Expected Results: /usr/bin/ contains (relative) links to the correct executables [i] ~/.../repo/dev-lang/gprolog$ emerge --info Portage 3.0.39 (python 3.10.8-final-0, default/linux/amd64/17.1/desktop/plasma/systemd/merged-usr, gcc-12, glibc-2.36-r5, 5.19.15-gentoo-dist x86_64) ================================================================= System uname: Linux-5.19.15-gentoo-dist-x86_64-AMD_Ryzen_7_3800X_8-Core_Processor-with-glibc2.36 KiB Mem: 65794516 total, 17851452 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Tue, 22 Nov 2022 02:00:01 +0000 Head commit of repository gentoo: 0305ea926d6107adb5d9f432dca9614903481ce1 Timestamp of repository guru: Sun, 20 Nov 2022 01:16:51 +0000 Head commit of repository guru: 9ddb35db7e2fd51cc29f20e2ced3ff20251db48f Timestamp of repository haskell: Mon, 21 Nov 2022 03:16:45 +0000 Head commit of repository haskell: 5f7a7b3e62b76680aee4397b2ce6c9c331853b4d Timestamp of repository nix-guix: Sun, 13 Nov 2022 22:01:55 +0000 Head commit of repository nix-guix: b1de5a90affaa673957f16a8daa801a0c83ff452 Timestamp of repository qt: Mon, 21 Nov 2022 13:16:47 +0000 Head commit of repository qt: 0bffd920e32aa057e2fc07f95c1b7e60329b7d4b Timestamp of repository steam-overlay: Thu, 20 Oct 2022 06:32:14 +0000 Head commit of repository steam-overlay: f40a22632e77a46be0153821f4a7f7847029533b sh dash 0.5.11.5 ld GNU ld (Gentoo 2.39 p5) 2.39.0 distcc 3.4 x86_64-pc-linux-gnu [disabled] ccache version 4.7.3 [disabled] app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r2::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.36.0-r1::gentoo dev-lang/python: 2.7.18_p16::gentoo, 3.10.8_p3::gentoo, 3.11.0_p2::gentoo dev-lang/rust: 1.65.0::gentoo dev-util/ccache: 4.7.3::gentoo dev-util/cmake: 3.25.0::gentoo dev-util/meson: 0.64.0::gentoo sys-apps/baselayout: 2.9::gentoo sys-apps/sandbox: 2.29::gentoo sys-apps/systemd: 252.1::gentoo sys-devel/autoconf: 2.69-r8::localrepo, 2.71-r5::gentoo sys-devel/automake: 1.15.1-r3::localrepo, 1.16.5::gentoo sys-devel/binutils: 2.39-r4::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/clang: 14.0.6-r1::gentoo, 15.0.5::gentoo sys-devel/gcc: 12.2.1_p20221119::gentoo, 13.0.0_pre20221120::gentoo sys-devel/gcc-config: 2.8::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/lld: 15.0.5::gentoo sys-devel/llvm: 14.0.6-r2::gentoo, 15.0.5::gentoo sys-devel/make: 4.4::gentoo sys-kernel/linux-headers: 6.0::gentoo (virtual/os-headers) sys-libs/glibc: 2.36-r5::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 12 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: guru location: /var/db/repos/guru sync-type: git sync-uri: https://github.com/gentoo-mirror/guru.git masters: gentoo haskell location: /var/db/repos/haskell sync-type: git sync-uri: https://github.com/gentoo-mirror/haskell.git masters: gentoo localrepo location: /var/db/repos/localrepo masters: gentoo nix-guix location: /var/db/repos/nix-guix sync-type: git sync-uri: https://github.com/gentoo-mirror/nix-guix.git masters: gentoo qt location: /var/db/repos/qt sync-type: git sync-uri: https://github.com/gentoo-mirror/qt.git masters: gentoo steam-overlay location: /var/db/repos/steam-overlay sync-type: git sync-uri: https://github.com/gentoo-mirror/steam-overlay.git masters: gentoo crossdev location: /usr/local/portage-crossdev masters: gentoo priority: 10 Installed sets: @imhex, @rockbox, @solaar, @steam, @xsecurelock ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-O2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--keep-going --ask --ask-enter-invalid --quiet-build" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS=" http://tux.rainside.sk/gentoo/ http://mirror.wheel.sk/gentoo https://mirror.wheel.sk/gentoo " LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j17 -l16" PKGDIR="/var/cache/binpkgs" PORTAGE_COMPRESS="" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="X a52 aac acl acpi activities amd64 bash-completion bluetooth branding bzip2 cairo cdda cdr cli completion crypt cups dbus declarative dist-kernel dri dts dvd dvdr emacs encode exif flac fortran gdbm gif gpm gtk gui hunspell iconv icu introspection ipv6 jpeg kde kwallet lcms libglvnd libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl offensive ogg opengl openmp openssl pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt5 readline sdl seccomp semantic-desktop spell ssl startup-notification svg systemd test-rust tiff truetype udev udisks unicode upower usb vdpau vorbis wayland widgets wxwidgets x264 xattr xcb xinerama xml xv xvid zlib zsh-completion" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx f16c fma3 pclmul popcnt rdrand sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="openssl" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="WebAssembly BPF AMDGPU NVPTX" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10 pypy3" RUBY_TARGETS="ruby31" USERLAND="GNU" VIDEO_CARDS="nvidia intel i915" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS [i] ~/.../repo/dev-lang/gprolog$
I wrote a patch that replaces the -links.patch and does fix the build on my end: diff --git a/src/Makefile.in b/src/Makefile.in index 5048e2f..603e194 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -4,11 +4,12 @@ ROOT_DIR = @ROOT_DIR@ PKG_NAME = @PKG_NAME@ -INSTALL_DIR = $(DESTDIR)@INSTALL_DIR@ -LINKS_DIR = $(DESTDIR)@LINKS_DIR@ -DOC_DIR = $(DESTDIR)@DOC_DIR@ -HTML_DIR = $(DESTDIR)@HTML_DIR@ -EXAMPLES_DIR = $(DESTDIR)@EXAMPLES_DIR@ +INSTALL_DIR_RAW = @INSTALL_DIR@ +INSTALL_DIR = $(DESTDIR)@INSTALL_DIR@ +LINKS_DIR = $(DESTDIR)@LINKS_DIR@ +DOC_DIR = $(DESTDIR)@DOC_DIR@ +HTML_DIR = $(DESTDIR)@HTML_DIR@ +EXAMPLES_DIR = $(DESTDIR)@EXAMPLES_DIR@ TXT_FILES = @TXT_FILES@ BIN_FILES = @BIN_FILES@ @@ -87,7 +88,9 @@ uninstall: uninstall-links uninstall-html uninstall-doc uninstall-examples install-links: uninstall-links if test $(LINKS_DIR) != none; then \ ./mkinstalldirs $(LINKS_DIR); \ - (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR)/bin/* .); \ + for i in $(BIN_FILES); do \ + (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR_RAW)/bin/"$$i" .); \ + done; \ fi uninstall-links: ... however, this is still quite bad, since it still relies on absolute rather than relative links. The build system also appears to be broken in other ways. Maybe it'd be best to automakeify it upstream? All the Makefiles in total add up to about 2.6kLOC, so that sound doable.
(In reply to Arsen Arsenovic from comment #1) > I wrote a patch that replaces the -links.patch and does fix the build on my > end: > > diff --git a/src/Makefile.in b/src/Makefile.in > index 5048e2f..603e194 100644 > --- a/src/Makefile.in > +++ b/src/Makefile.in > @@ -4,11 +4,12 @@ > ROOT_DIR = @ROOT_DIR@ > PKG_NAME = @PKG_NAME@ > > -INSTALL_DIR = $(DESTDIR)@INSTALL_DIR@ > -LINKS_DIR = $(DESTDIR)@LINKS_DIR@ > -DOC_DIR = $(DESTDIR)@DOC_DIR@ > -HTML_DIR = $(DESTDIR)@HTML_DIR@ > -EXAMPLES_DIR = $(DESTDIR)@EXAMPLES_DIR@ > +INSTALL_DIR_RAW = @INSTALL_DIR@ > +INSTALL_DIR = $(DESTDIR)@INSTALL_DIR@ > +LINKS_DIR = $(DESTDIR)@LINKS_DIR@ > +DOC_DIR = $(DESTDIR)@DOC_DIR@ > +HTML_DIR = $(DESTDIR)@HTML_DIR@ > +EXAMPLES_DIR = $(DESTDIR)@EXAMPLES_DIR@ > > TXT_FILES = @TXT_FILES@ > BIN_FILES = @BIN_FILES@ > @@ -87,7 +88,9 @@ uninstall: uninstall-links uninstall-html uninstall-doc > uninstall-examples > install-links: uninstall-links > if test $(LINKS_DIR) != none; then \ > ./mkinstalldirs $(LINKS_DIR); \ > - (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR)/bin/* .); \ > + for i in $(BIN_FILES); do \ > + (cd $(LINKS_DIR) ; $(LN_S) $(INSTALL_DIR_RAW)/bin/"$$i" .); \ > + done; \ > fi > > uninstall-links: > > > ... however, this is still quite bad, since it still relies on absolute > rather than relative links. The build system also appears to be broken in > other ways. Maybe it'd be best to automakeify it upstream? All the > Makefiles in total add up to about 2.6kLOC, so that sound doable. Thanks for reporting this bug. I think relative links are the way to go.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9938a9f418166aac77505654f75ea83e83c64e5c commit 9938a9f418166aac77505654f75ea83e83c64e5c Author: Keri Harris <keri@gentoo.org> AuthorDate: 2022-11-26 12:18:46 +0000 Commit: Keri Harris <keri@gentoo.org> CommitDate: 2022-11-26 12:18:46 +0000 dev-lang/gprolog: use relative symlinks for gprolog binaries Thanks to Arsen Arsenovic for diagnosing the root cause of this. Closes: https://bugs.gentoo.org/882519 Signed-off-by: Keri Harris <keri@gentoo.org> dev-lang/gprolog/files/gprolog-1.4.5-links.patch | 2 +- dev-lang/gprolog/files/gprolog-1.5.0-destdir.patch | 2 +- dev-lang/gprolog/files/gprolog-1.5.0-links.patch | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
\o/ thanks!