trofi / nix-guix-gentoo

Gentoo overlay for nix and guix functional package managers.
110 stars 9 forks source link

guix pull fails after upgrading zstd #23

Closed Gooberpatrol66 closed 2 years ago

Gooberpatrol66 commented 2 years ago
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
  guix      https://git.savannah.gnu.org/git/guix.git   43b8df4
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: Backtrace:
substitute: In guix/scripts/substitute.scm:
substitute:     350:7 19 (process-query #<output: file 4> _ #:cache-urls _ #:acl _)
substitute: In srfi/srfi-1.scm:
substitute:     634:9 18 (for-each #<procedure 7f0ac5a3e0e0 at guix/scripts/sub���> ���)
substitute: In guix/scripts/substitute.scm:
substitute:    295:16 17 (_ #<<narinfo> path: "/gnu/store/9mcbqzvg6jl2xw8md53cnx���>)
substitute: In guix/narinfo.scm:
substitute:     316:4 16 (narinfo-best-uri #<<narinfo> path: "/gnu/store/9mcbqz���> ���)
substitute: In unknown file:
substitute:           15 (filter #<procedure 7f0ac5a59f80 at guix/narinfo.scm:3���> ���)
substitute: In ice-9/threads.scm:
substitute:     390:8 14 (_ _)
substitute: In ice-9/boot-9.scm:
substitute:   3252:13 13 (_)
substitute: In ice-9/threads.scm:
substitute:     390:8 12 (_ _)
substitute: In ice-9/boot-9.scm:
substitute:   3536:20 11 (_)
substitute:    2835:4 10 (save-module-excursion #<procedure 7f0ac47fcb70 at ice-���>)
substitute:   3556:26  9 (_)
substitute: In unknown file:
substitute:            8 (primitive-load-path "zstd" #<procedure 7f0ac5a59cc0 at���>)
substitute: In zstd.scm:
substitute:      43:2  7 (_)
substitute: In unknown file:
substitute:            6 (dynamic-link "/usr/lib64/libzstd.so.1")
substitute: In system/foreign-library.scm:
substitute:     183:4  5 (load-foreign-library _ #:extensions _ # _ #:search-path ���)
substitute: In ice-9/boot-9.scm:
substitute:   1685:16  4 (raise-exception _ #:continuable? _)
substitute:   1685:16  3 (raise-exception _ #:continuable? _)
substitute:   1780:13  2 (_ #<&compound-exception components: (#<&error> #<&orig���>)
substitute:   1685:16  1 (raise-exception _ #:continuable? _)
substitute:   1685:16  0 (raise-exception _ #:continuable? _)
substitute: 
substitute: ice-9/boot-9.scm:1685:16: In procedure raise-exception:
substitute: In procedure load-foreign-library: file: "/usr/lib64/libzstd.so.1", message: "file not found"
guix pull: error: `/usr/bin/guix substitute' died unexpectedly
trofi commented 2 years ago

substitute: In procedure load-foreign-library: file: "/usr/lib64/libzstd.so.1", message: "file not found"

Likely a side-effect of libzstd.so.1 moving from /usr/lib to /lib:

# qlist app-arch/zstd | fgrep libzstd
/usr/lib64/pkgconfig/libzstd.pc
/usr/lib64/libzstd.so
/lib64/libzstd.so.1
/lib64/libzstd.so.1.5.2

Looking.

trofi commented 2 years ago

Hm, this overlay's dev-scheme/guile-zstd should already point at /lib form of is. Can you show your putput of emerge --info dev-scheme/guile-zstd?

Gooberpatrol66 commented 2 years ago
WARNING: One or more repositories have missing repo_name entries:

    /var/lib/layman/arcan-overlay/profiles/repo_name

NOTE: Each repo_name entry should be a plain text file containing a
unique name for the repository on the first line.

Portage 3.0.38.1 (python 3.10.6-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.3.0, glibc-2.35-r8, 5.15.69-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.15.69-gentoo-x86_64-x86_64-AMD_Ryzen_5_3600_6-Core_Processor-with-glibc2.35
KiB Mem:    32778864 total,   9505084 free
KiB Swap:   33519612 total,  33519612 free
Timestamp of repository gentoo: Tue, 04 Oct 2022 21:17:49 +0000
Head commit of repository gentoo: 5594559802a3050d817eaa8e1e5f1d3076d3af2d

sh bash 5.1_p16-r1
ld GNU ld (Gentoo 2.38 p4) 2.38
ccache version 4.5.1 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.8.13_p8::gentoo, 3.9.13_p6::gentoo, 3.10.6_p4::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/ccache:           4.5.1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          251.4::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

aeon-gentoo-overlay
    location: /var/lib/layman/aeon-gentoo-overlay
    sync-type: laymansync
    sync-uri: https://github.com/aeon-engine/aeon-gentoo-overlay.git
    masters: gentoo
    priority: 50

arcan-overlay
    location: /var/lib/layman/arcan-overlay
    sync-type: laymansync
    sync-uri: https://github.com/vquicksilver/arcan-overlay.git
    masters: gentoo
    priority: 50

audio-overlay
    location: /var/lib/layman/audio-overlay
    sync-type: laymansync
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo
    priority: 50

darthgandalf-overlay
    location: /var/lib/layman/darthgandalf-overlay
    sync-type: laymansync
    sync-uri: https://github.com/DarthGandalf/gentoo-overlay.git
    masters: gentoo
    priority: 50

deadbeef-overlay
    location: /var/lib/layman/deadbeef-overlay
    sync-type: laymansync
    sync-uri: https://github.com/damex/deadbeef-overlay.git
    masters: gentoo
    priority: 50

dev1990-overlay
    location: /var/lib/layman/dev1990-overlay
    sync-type: laymansync
    sync-uri: https://github.com/dev-0x7C6/dev1990-overlay.git
    masters: gentoo
    priority: 50

dmchurch
    location: /var/lib/layman/dmchurch
    sync-type: laymansync
    sync-uri: https://github.com/dmchurch/portage-overlay.git
    masters: gentoo
    priority: 50

dotnet
    location: /var/lib/layman/dotnet
    sync-type: laymansync
    sync-uri: https://github.com/gentoo/dotnet.git
    masters: gentoo
    priority: 50

gooby-overlay
    location: /var/lib/layman/gooby-overlay
    sync-type: laymansync
    sync-uri: https://gentooserver.dehnel.info/gitea/nathan/gooby-overlay.git
    masters: gentoo dotnet
    priority: 50

guru
    location: /var/lib/layman/guru
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/repo/proj/guru.git
    masters: gentoo
    priority: 50

interactive-fiction
    location: /var/lib/layman/interactive-fiction
    sync-type: laymansync
    sync-uri: git://repo.or.cz/gentoo-interactive-fiction.git
    masters: gentoo
    priority: 50

lmiphay
    location: /var/lib/layman/lmiphay
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/user/lmiphay.git
    masters: gentoo
    priority: 50

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: laymansync
    sync-uri: https://github.com/InBetweenNames/gentooLTO.git
    masters: gentoo mv
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/user/mv.git
    masters: gentoo
    priority: 50

nix-guix
    location: /var/lib/layman/nix-guix
    sync-type: laymansync
    sync-uri: https://github.com/trofi/nix-guix-gentoo.git
    masters: gentoo
    priority: 50

reagentoo
    location: /var/lib/layman/reagentoo
    sync-type: laymansync
    sync-uri: https://gitlab.com/reagentoo/gentoo-overlay.git
    masters: gentoo
    priority: 50

sabayon
    location: /var/lib/layman/sabayon
    sync-type: laymansync
    sync-uri: git://github.com/Sabayon/for-gentoo.git
    masters: gentoo
    priority: 50

src_prepare-overlay
    location: /var/lib/layman/src_prepare-overlay
    sync-type: laymansync
    sync-uri: https://gitlab.com/src_prepare/src_prepare-overlay.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

torbrowser
    location: /var/lib/layman/torbrowser
    sync-type: laymansync
    sync-uri: https://github.com/MeisterP/torbrowser-overlay.git
    masters: gentoo
    priority: 50

unity-gentoo
    location: /var/lib/layman/unity-gentoo
    sync-type: laymansync
    sync-uri: https://github.com/shiznix/unity-gentoo.git
    masters: gentoo
    priority: 50

vapoursynth
    location: /var/lib/layman/vapoursynth
    sync-type: laymansync
    sync-uri: https://github.com/4re/vapoursynth-portage.git
    masters: gentoo
    priority: 50

viperML-overlay
    location: /var/lib/layman/viperML-overlay
    sync-type: laymansync
    sync-uri: https://github.com/viperML/viperML-overlay.git
    masters: gentoo
    priority: 50

voyageur
    location: /var/lib/layman/voyageur
    sync-type: laymansync
    sync-uri: https://cafarelli.fr/git/voyageur-overlay/
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 12 --autounmask"
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="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
MAKEOPTS="-j12"
PKGDIR="/var/cache/binpkgs"
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"
RUSTFLAGS="-C opt-level=3 -C target-cpu=native -C codegen-units=1"
SHELL="/bin/bash"
USE="X a52 aac acl acpi activities alsa amd64 bluetooth bluray branding bzip2 cairo caps cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode eselect-ldso exif flac fortran gdbm gif gpm gtk gui hardened hwaccel iconv icu infinality ipv6 jack jit jpeg kde kwallet lcms libglvnd libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses nfs nls nptl ogg opencl opengl openmp orc pam pango pcre pdf pgo pie plasma png policykit ppds qml qt5 readline realtime sdl seccomp semantic-desktop spell split-usr ssl ssp startup-notification svg systemd threads tiff truetype udev udisks unicode upower usb vaapi vdpau verify-sig vorbis vulkan widgets wxwidgets x264 xattr xcb xml xtpax xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2020" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" CURL_SSL="gnutls" 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" INPUT_DEVICES="libinput wacom evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" 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" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" 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, LANG, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

dev-scheme/guile-zstd-0.1.1::nix-guix was built with the following:
USE="" ABI_X86="(64)"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=12 -fuse-linker-plugin -pipe"
trofi commented 2 years ago

dev-scheme/guile-zstd-0.1.1::nix-guix was built with the following:

That is an old (unfixed) version. Could it be you did not sync the overlay for a while? Or did not update your system?

https://github.com/trofi/nix-guix-gentoo/tree/master/dev-scheme/guile-zstd has only dev-scheme/guile-zstd-0.1.1-r1 version with a https://github.com/trofi/nix-guix-gentoo/commit/8f194519982fbfabb6b3ca84c0806b1a379b5d06 fix applied in July.

trofi commented 2 years ago

I did a minor dependency tweak to make the upgrade more eager. But I think you just need to update and it would fix it for you. Please reopen if that is not the case.

jaccarmac commented 8 months ago

I'm seeing similar (but maybe mirrored?) breakage again recently. I have app-arch/zstd 1.5.5-r1 and dev-scheme/guile-zstd 0.1.1-r1 (-r2 from here was installed but I replaced with -r1 after noticing it was gone; breaks under both). My libzstd object file seems to be under /usr/lib.

jaccarmac commented 8 months ago

Looking to debug the build order issue, emerge -1 sys-apps/guix fails with "A recent Guile-zlib could not be found; please install it."

trofi commented 8 months ago

The overlay state seems to work for me as is. Let's check where your system differs from my test one. Can you post your build.log and emerge --info?

jaccarmac commented 8 months ago

Sure thing, let me sync up and see if any of my package information is in a weird state.

jaccarmac commented 8 months ago

build.log emerge --info '=sys-apps/guix-1.4.0-r2::nix-guix' emerge -pqv '=sys-apps/guix-1.4.0-r2::nix-guix'

trofi commented 8 months ago

Aha, thank you! Can you also upload /var/tmp/portage/sys-apps/guix-1.4.0-r2/work/guix-1.4.0/config.log as well?

jaccarmac commented 8 months ago

config.log

trofi commented 8 months ago

Aha, I have reproduced the similar failure on one of the chroots as:

scheme@(guile-user)> (use-modules (zlib))
While compiling expression:
Wrong type to apply: #f

Trying to debug locally to figure out the cause.

trofi commented 8 months ago

The following fails to import adler32 function from zlib library:

$ guile --fresh-auto-compile -c '(use-modules (zlib))'
...
zlib.scm:416:25: Wrong type to apply: #f
(define %zlib
  (delay (dynamic-link %libz)))

(define (zlib-procedure ret name parameters)
  "Return a procedure corresponding to C function NAME in libz, or #f if
either zlib or the function could not be found."
  (match (false-if-exception (dynamic-func name (force %zlib)))
    ((? pointer? ptr)
     (pointer->procedure ret ptr parameters))
    (#f
     #f)))
;; ...
(define %default-adler32 (%adler32 0 %null-pointer 0))
(define %default-crc32   (%crc32   0 %null-pointer 0))
$ nm -D /usr/lib64/libz.so |& fgrep adler32
0000000000003880 T adler32
0000000000003890 T adler32_combine@@ZLIB_1.2.2
0000000000003970 T adler32_combine64@@ZLIB_1.2.3.3
0000000000003400 T adler32_z@@ZLIB_1.2.9

$  nm -D /usr/lib64/libz.so |& fgrep crc32
0000000000003e80 T crc32
0000000000003f50 T crc32_combine@@ZLIB_1.2.2
0000000000003e90 T crc32_combine64@@ZLIB_1.2.3.3
0000000000003fe0 T crc32_combine_gen@@ZLIB_1.2.12
0000000000003f60 T crc32_combine_gen64@@ZLIB_1.2.12
0000000000003ff0 T crc32_combine_op@@ZLIB_1.2.12
0000000000003a60 T crc32_z@@ZLIB_1.2.9
$ strace -f -y guile --fresh-auto-compile -c '(use-modules (zlib))' |& fgrep libz
[pid 1899114] newfstatat(AT_FDCWD</>, "/lib64/libz.so.1", 0x7ffeb4869f80, 0) = -1 ENOENT (No such file or directory)
[pid 1899114] newfstatat(AT_FDCWD</>, "/lib64/.libs/libz.so.1", 0x7ffeb4869f80, 0) = -1 ENOENT (No such file or directory)
...
[pid 1899114] newfstatat(AT_FDCWD</>, "/lib64/libz.so.1", 0x7ffeb4869f80, 0) = -1 ENOENT (No such file or directory)
[pid 1899114] newfstatat(AT_FDCWD</>, "/lib64/.libs/libz.so.1", 0x7ffeb4869f80, 0) = -1 ENOENT (No such file or directory)

guile does not consider /usr/lib part at all when searches the libraries:

$ qlist zlib | fgrep libz.so
/usr/lib64/libz.so.1.3.1
/usr/lib64/libz.so
/usr/lib64/libz.so.1

I think it was broken by this ::gentoo change: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9efb6a33633d85afc85372f0a2f92516b20294f

trofi commented 8 months ago

Found a similar report and added a note to it: https://bugs.gentoo.org/877383#c4

trofi commented 8 months ago

guile-zlib hardcodes the absolute path to zlib:

$ cat /usr/share/guile/site/3.0/zlib/config.scm

(define-module (zlib config)
  #:export (%libz))

(define %libz
  "/lib64/libz.so.1")
trofi commented 8 months ago

Meanwhile I attempted to work it around in the overlay with these two commits:

Please give it a try.

jaccarmac commented 8 months ago

Thank you for finding that underlying issue; It's definitely beyond my ken. As of my latest attempt, I can build the Guix package again but I still get the substitute: ... "file not found" error

xgqt commented 8 months ago

@trofi I pushed guile-zlib fix to ::gentoo

@jaccarmac

substitute: ... "file not found" error

when running guix?...

trofi commented 8 months ago

Reproduced guix failure locally:

$ guix shell re2c
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
substitute: Backtrace:
substitute: In guix/scripts/substitute.scm:
substitute:     352:7 19 (process-query #<output: file 4> _ #:cache-urls _ #:acl _)
substitute: In srfi/srfi-1.scm:
substitute:     634:9 18 (for-each #<procedure 7fa58787e300 at guix/scripts/sub…> …)
substitute: In guix/scripts/substitute.scm:
substitute:    297:13 17 (_ #<<narinfo> path: "/gnu/store/z3ak4c44p3msh214ybf395…>)
substitute: In guix/narinfo.scm:
substitute:     319:4 16 (narinfo-best-uri #<<narinfo> path: "/gnu/store/z3ak4c…> …)
substitute: In unknown file:
substitute:           15 (filter #<procedure 7fa58788cca0 at guix/narinfo.scm:3…> …)
substitute: In ice-9/threads.scm:
substitute:     390:8 14 (_ _)
substitute: In ice-9/boot-9.scm:
substitute:   3253:13 13 (_)
substitute: In ice-9/threads.scm:
substitute:     390:8 12 (_ _)
substitute: In ice-9/boot-9.scm:
substitute:   3544:20 11 (_)
substitute:    2836:4 10 (save-module-excursion #<procedure 7fa57eca4d50 at ice-…>)
substitute:   3564:26  9 (_)
substitute: In unknown file:
substitute:            8 (primitive-load-path "zstd" #<procedure 7fa58788c9c0 at…>)
substitute: In zstd.scm:
substitute:      43:3  7 (_)
substitute: In unknown file:
substitute:            6 (dynamic-link "/lib64/libzstd.so.1")
substitute: In system/foreign-library.scm:
substitute:     183:4  5 (load-foreign-library _ #:extensions _ # _ #:search-path …)
substitute: In ice-9/boot-9.scm:
substitute:   1685:16  4 (raise-exception _ #:continuable? _)
substitute:   1685:16  3 (raise-exception _ #:continuable? _)
substitute:   1780:13  2 (_ #<&compound-exception components: (#<&error> #<&orig…>)
substitute:   1685:16  1 (raise-exception _ #:continuable? _)
substitute:   1685:16  0 (raise-exception _ #:continuable? _)
substitute:
substitute: ice-9/boot-9.scm:1685:16: In procedure raise-exception:
substitute: In procedure load-foreign-library: file: "/lib64/libzstd.so.1", message: "file not found"
guix shell: error: `/usr/bin/guix substitute' died unexpectedly

I think we'll need an equivalent fix for zstd as well.

trofi commented 8 months ago

For completeness ::gentoo's change of https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0655eb884a394fdd8048617b8888b8be74adc5e dropped ldscripts from app-arch/zstd and moved libzstd.so location again.

trofi commented 8 months ago

Something like the following should be enough to fix it (will push it's equivalent to ::nix-guix this evening):

--- a/dev-scheme/guile-zstd/guile-zstd-0.1.1-r1.ebuild
+++ b/dev-scheme/guile-zstd/guile-zstd-0.1.1-r1.ebuild
@@ -31,17 +31,6 @@ QA_PREBUILT='*[.]go'
 src_prepare() {
        default

-       # Workaround gentoo-specific deviation where
-       # /usr/lib64/libzstd.so is a linker script that points to:
-       #   GROUP ( /lib64/libzstd.so.1 )
-       # This confuses guile-zstd and fails to open the library:
-       #   substitute: ice-9/boot-9.scm:1685:16: In procedure raise-exception:
-       #   substitute: In procedure load-foreign-library: file: "/usr/lib64/libzstd.so.1",
-       #     message: "file not found"
-       #   guix environment: error: `/usr/bin/guix substitute' died unexpectedly
-       sed "s|@ZSTD_LIBDIR@/libzstd.so.1|/$(get_libdir)/libzstd.so.1|" \
-               -i "${S}"/zstd/config.scm.in || die
-
        # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38112
        find "${S}" -name "*.scm" -exec touch {} + || die
trofi commented 8 months ago

Attempted to fix zstd loading failure with these two changes:

Please give it a try: you'll need to sync both ::nix-guix and ::gentoo and then update guix. At least this state loads guix shell re2c for me.

xgqt commented 8 months ago

@trofi re guile-zstd -- care to do PR to ::gentoo?

xgqt commented 8 months ago

@trofi re guile-zstd -- care to do PR to ::gentoo?

Just updated in ::gentoo

jaccarmac commented 8 months ago

Looks like that works (guix shell does, at least, and that's what broke). Not sure if anything else needs to be upstreamed, but thanks for the fixes!

trofi commented 8 months ago

We should be all clear now. Thank you for the report and for the test!

Apologies for the breakage and for so many backs and forths.