Skip to content

guile-zlib: fix path to zlib#497498

Merged
sikmir merged 1 commit intoNixOS:masterfrom
ghpzin:pr-guile-zlib-fix-zlib-path
Mar 7, 2026
Merged

guile-zlib: fix path to zlib#497498
sikmir merged 1 commit intoNixOS:masterfrom
ghpzin:pr-guile-zlib-fix-zlib-path

Conversation

@ghpzin
Copy link
Copy Markdown
Contributor

@ghpzin ghpzin commented Mar 7, 2026

  • add patch changing path to libz.so from libdir to sharedlibdir
    variable from zlib.pc

In guile-zlib default way of finding libz.so is to load zlib.pc
with PKG_CHECK_MODULES macro and take path from libdir variable
inside.

After change in:
#476830
ff59162
libdir variable in zlib.pc points to zlib.static, so only libz.a
is there.
Add patch fixing configure.ac to load path from sharedlibdir instead.

Fixes build failure of guile-zlib:

make  check-TESTS
make[1]: Entering directory '/build/source'
make[2]: Entering directory '/build/source'
make[2]: *** [Makefile:873: tests/zlib.log] Error 1
make[2]: Leaving directory '/build/source'
make[1]: *** [Makefile:856: check-TESTS] Error 2
make[1]: Leaving directory '/build/source'
make: *** [Makefile:1059: check-am] Error 2

zlib.log:

Backtrace:
          19 (primitive-load-path "tests/zlib.scm")
...
In unknown file:
           2 (primitive-load-path "zlib" #<procedure 7fffeee418c0 at
ice-9/boot-9.scm:3603:37 ()>)
In zlib.scm:
   486:25  1 (_)
   486:25  0 (_)

zlib.scm:486:25: Wrong type to apply: #f

See comments in #494567 for extra context.

Fixes #493503

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. labels Mar 7, 2026
@ghpzin

This comment was marked as outdated.

@ghpzin ghpzin marked this pull request as ready for review March 7, 2026 09:19
@marcin-serwin
Copy link
Copy Markdown
Contributor

If they expect shared objects in libdir then I'd argue it's an upstream bug and it would be preferable to send them a patch like this one:

diff --git a/configure.ac b/configure.ac
index dc2534d..dc5726e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,7 @@ fi
 
 PKG_CHECK_MODULES([LIBZ], [zlib])
 AC_MSG_CHECKING([libz library directory])
-PKG_CHECK_VAR([LIBZ_LIBDIR], [zlib], [libdir])
+PKG_CHECK_VAR([LIBZ_LIBDIR], [zlib], [sharedlibdir])
 AC_MSG_RESULT([$LIBZ_LIBDIR])
 AS_IF([test "x$LIBZ_LIBDIR" = "x"], [
   AC_MSG_FAILURE([Unable to identify libz lib path.])

@nixpkgs-ci nixpkgs-ci bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Mar 7, 2026
@ghpzin
Copy link
Copy Markdown
Contributor Author

ghpzin commented Mar 7, 2026

Unfortunately upstream repo is gone (at least temporarily):
https://notabug.org/guile-zlib/guile-zlib -- returns 404

Main instance - https://notabug.org says:

Due to relentless AI scrapers notabug.org is currently down.
We are attempting to come up with a solution to this problem.

I can convert to patch if that is preferable (so it may be submitted upstream someday).

- add patch changing path to `libz.so` from `libdir` to `sharedlibdir`
variable from `zlib.pc`

In `guile-zlib` default way of finding `libz.so` is to load `zlib.pc`
with `PKG_CHECK_MODULES` macro and take path from `libdir` variable
inside.

After change in:
https://www.github.com/NixOS/nixpkgs/pull/476830
NixOS@ff59162
`libdir` variable in `zlib.pc` points to `zlib.static`, so only `libz.a`
is there.
Add patch fixing `configure.ac` to load path from `sharedlibdir` instead.

Fixes build failure of `guile-zlib`:
```
make  check-TESTS
make[1]: Entering directory '/build/source'
make[2]: Entering directory '/build/source'
make[2]: *** [Makefile:873: tests/zlib.log] Error 1
make[2]: Leaving directory '/build/source'
make[1]: *** [Makefile:856: check-TESTS] Error 2
make[1]: Leaving directory '/build/source'
make: *** [Makefile:1059: check-am] Error 2
```

zlib.log:
```
Backtrace:
          19 (primitive-load-path "tests/zlib.scm")
...
In unknown file:
           2 (primitive-load-path "zlib" #<procedure 7fffeee418c0 at
ice-9/boot-9.scm:3603:37 ()>)
In zlib.scm:
   486:25  1 (_)
   486:25  0 (_)

zlib.scm:486:25: Wrong type to apply: #f
```
@ghpzin ghpzin force-pushed the pr-guile-zlib-fix-zlib-path branch from dcb3ca8 to 682ba25 Compare March 7, 2026 10:13
@ghpzin
Copy link
Copy Markdown
Contributor Author

ghpzin commented Mar 7, 2026

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 497498
Commit: 682ba25a29558983ba7196eb95c7f700959d0061


x86_64-linux

✅ 2 packages built:
  • guile-zlib
  • guix

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Mar 7, 2026
@sikmir sikmir added this pull request to the merge queue Mar 7, 2026
Merged via the queue into NixOS:master with commit 2a48194 Mar 7, 2026
28 checks passed
@ghpzin ghpzin deleted the pr-guile-zlib-fix-zlib-path branch March 7, 2026 11:00
@marcin-serwin marcin-serwin mentioned this pull request Mar 7, 2026
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: guile-zlib

3 participants