Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 877383 - dev-scheme/guile-zlib-0.1.0 fails tests
Summary: dev-scheme/guile-zlib-0.1.0 fails tests
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Scheme Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-17 06:53 UTC by Agostino Sarubbo
Modified: 2024-02-28 08:46 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,46.79 KB, text/plain)
2022-10-17 06:53 UTC, Agostino Sarubbo
Details
zlib.log (zlib.log,1.75 KB, text/plain)
2022-10-17 15:00 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-10-17 06:53:12 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: dev-scheme/guile-zlib-0.1.0 fails tests.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2022-10-17 06:53:14 UTC
Created attachment 824499 [details]
build.log

build log and emerge --info
Comment 2 Maciej Barć gentoo-dev 2022-10-17 14:37:51 UTC
Agostino, could You please post the .log & .trs files from the ${S}/tests directory?
Comment 3 Agostino Sarubbo gentoo-dev 2022-10-17 15:00:08 UTC
Created attachment 824607 [details]
zlib.log

zlib.log
Comment 4 Sergei Trofimovich 2024-02-27 23:14:01 UTC
I got a similar report at https://github.com/trofi/nix-guix-gentoo/issues/23

I suspect it's an effect of https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9efb6a33633d85afc85372f0a2f92516b20294f "sys-libs/zlib: remove usr-ldscript support"

The reproducer:

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

`guile` fails to find `/usr/lib/libz.so`:

    $ 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)
Comment 5 Sergei Trofimovich 2024-02-27 23:19:28 UTC
Possibly because `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")
```
Comment 6 Sergei Trofimovich 2024-02-27 23:27:41 UTC
I think we need to drop `LIBZ_LIBDIR` assignment to let `pkg-config` detect /usr/lib64 at:

    src_configure() {
        # Gentoo installs zlib to /${libdir} and to /usr/${libdir}.
        # We need /${libdir} with shared library here.
        econf LIBZ_LIBDIR="${EPREFIX}/$(get_libdir)"
    }
Comment 7 Maciej Barć gentoo-dev 2024-02-28 08:32:39 UTC
(In reply to Sergei Trofimovich from comment #6)
> I think we need to drop `LIBZ_LIBDIR` assignment to let `pkg-config` detect
> /usr/lib64 at:
> 
>     src_configure() {
>         # Gentoo installs zlib to /${libdir} and to /usr/${libdir}.
>         # We need /${libdir} with shared library here.
>         econf LIBZ_LIBDIR="${EPREFIX}/$(get_libdir)"
>     }

That function is to blame. Fails for me with this, passes otherwise.
Comment 8 Larry the Git Cow gentoo-dev 2024-02-28 08:46:34 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0011cfe79cc62c70148f90026adbbe6f3367f6fc

commit 0011cfe79cc62c70148f90026adbbe6f3367f6fc
Author:     Maciej Barć <xgqt@gentoo.org>
AuthorDate: 2024-02-28 08:39:33 +0000
Commit:     Maciej Barć <xgqt@gentoo.org>
CommitDate: 2024-02-28 08:46:32 +0000

    dev-scheme/guile-zlib: let pkg-config find zlib dir
    
    See-also: https://github.com/trofi/nix-guix-gentoo/commit/30bafb179db756c568ee498856a1f137cfa50530
    Bug: https://github.com/trofi/nix-guix-gentoo/issues/23
    Closes: https://bugs.gentoo.org/877383
    Signed-off-by: Maciej Barć <xgqt@gentoo.org>

 ...-0.1.0-r1.ebuild => guile-zlib-0.1.0-r2.ebuild} | 29 +++++++++++++---------
 1 file changed, 17 insertions(+), 12 deletions(-)