Skip to content

guile-zlib: disable tests#494567

Closed
yzhou216 wants to merge 2 commits intoNixOS:masterfrom
yzhou216:guile-zlib-fix
Closed

guile-zlib: disable tests#494567
yzhou216 wants to merge 2 commits intoNixOS:masterfrom
yzhou216:guile-zlib-fix

Conversation

@yzhou216
Copy link
Copy Markdown
Contributor

Resolves #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.

@yzhou216 yzhou216 requested review from foo-dogsquared and quantenzitrone and removed request for quantenzitrone February 27, 2026 03:31
@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 Feb 27, 2026
@yzhou216 yzhou216 changed the title Guile zlib fix guile-zlib: disable tests Feb 28, 2026
@acid-bong acid-bong requested review from 7c6f434c, SFrijters and ghpzin and removed request for foo-dogsquared March 1, 2026 08:51
@ghpzin
Copy link
Copy Markdown
Contributor

ghpzin commented Mar 1, 2026

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 494567
Commit: e781d6b2b63adf8eb33dfb696382b8fd1322b5ad


x86_64-linux

❌ 1 package failed to build:
  • guix
✅ 1 package built:
  • guile-zlib

Error logs: `x86_64-linux`
guix
checking for guile-3.0... no
checking for guile3.0... no
checking for guile-3... no
checking for guile3... no
checking for guile... /nix/store/rh8msn5829s1yhziyjb3dnbqrcvmwrhd-guile-3.0.11/bin/guile
checking for Guile version >= 3.0... 3.0.11
checking for guild... /nix/store/rh8msn5829s1yhziyjb3dnbqrcvmwrhd-guile-3.0.11/bin/guild
checking for guile-config... /nix/store/rh8msn5829s1yhziyjb3dnbqrcvmwrhd-guile-3.0.11/bin/guile-config
checking for guile-3.0 >= 3.0.3... yes
checking for guile-3.0... yes
checking if (gnutls) is available... yes
checking if (git) is available... yes
checking if (git) exports `graph-descendant?'... yes
checking whether Guile-JSON is available and recent enough... yes
checking whether Guile-Sqlite3 is available and recent enough... yes
checking whether Guile-Gcrypt is available and recent enough... yes
checking whether Guile-Git is available and recent enough... yes
checking if (htmlprag) exports `%strict-tokenizer?'... yes
checking whether Guile-zlib is available and recent enough... no
configure: error: A recent Guile-zlib could not be found; please install it.

@ghpzin
Copy link
Copy Markdown
Contributor

ghpzin commented Mar 1, 2026

Considering the only thing depending on it - guix does not build, seems like tests at least are not the only problem.

@acid-bong
Copy link
Copy Markdown
Contributor

Guile maintainers didn't even update the main Guile binding to 3.0.11 due to failing Guix builds: https://codeberg.org/guix/guix/src/commit/5a08363c9ff09c5e6be2fa7b182e2ad13b9689de/gnu/packages/guile.scm#L523-L526

@ghpzin
Copy link
Copy Markdown
Contributor

ghpzin commented Mar 1, 2026

I do not think it matters for guile-zlib because right before last staging-next (#488406) merge (on 8011f7d) all of these things build fine and guile was already on 3.0.11.

The only relevant thing that changed during that staging cycle is zlib in #476830 (ff59162)
And revert of ff59162 on current master (d3ea5d7) fixes it - tests pass, guix builds. Thought revert is a stdenv rebuild.

So it seems to be a matter of figuring out how guile-zlib finds/uses zlib and how to fix it after that change.
#490608 (that is only in staging atm) may be relevant too.


This also seems to work, thought not sure why or if that is a "proper" solution:

diff --git a/pkgs/by-name/gu/guile-zlib/package.nix b/pkgs/by-name/gu/guile-zlib/package.nix
index 3815bb8b52..708668b705 100644
--- a/pkgs/by-name/gu/guile-zlib/package.nix
+++ b/pkgs/by-name/gu/guile-zlib/package.nix
@@ -29,7 +29,7 @@
     texinfo
   ];
   buildInputs = [ guile ];
-  propagatedBuildInputs = [ zlib ];
+  propagatedBuildInputs = [ (zlib.override { static = false; }) ];
   makeFlags = [ "GUILE_AUTO_COMPILE=0" ];

   doCheck = true;

Similar to #493695

@acid-bong
Copy link
Copy Markdown
Contributor

This also seems to work
zlib.override { static = false; }

worth including in #490999?

@ghpzin
Copy link
Copy Markdown
Contributor

ghpzin commented Mar 4, 2026

Not sure if this is strictly a zlib issue, but might be worth bringing up.


I looked a bit more into what guile-zlib does to find zlib.

configure.ac:

PKG_CHECK_MODULES([LIBZ], [zlib])
AC_MSG_CHECKING([libz library directory])
PKG_CHECK_VAR([LIBZ_LIBDIR], [zlib], [libdir])
AC_MSG_RESULT([$LIBZ_LIBDIR])
AS_IF([test "x$LIBZ_LIBDIR" = "x"], [
  AC_MSG_FAILURE([Unable to identify libz lib path.])
])
AC_SUBST([LIBZ_LIBDIR])

zlib.pc from zlib.dev:

prefix=/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1
exec_prefix=${prefix}
libdir=/nix/store/njwanmygmqc5vdhx22mnipiihqp39ysr-zlib-1.3.1-static/lib
sharedlibdir=/nix/store/vl8jkqpr0l3fac3cxiy4nwc5paiww1lv-zlib-1.3.1/lib
includedir=/nix/store/87y9237m9c9m9mxk9ajwdfmn78vz6w2y-zlib-1.3.1-dev/include

Name: zlib
Description: zlib compression library
Version: 1.3.1

Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}

It just loads libdir variable from zlib.pc and then tries to link to libz there (with .so seemingly appended by dynamic-link in guile):

configure.log:

configure:3313: checking for zlib
configure:3320: $PKG_CONFIG --exists --print-errors "zlib"
configure:3323: $? = 0
configure:3337: $PKG_CONFIG --exists --print-errors "zlib"
configure:3340: $? = 0
configure:3398: result: yes
configure:3402: checking libz library directory
configure:3409: $PKG_CONFIG --exists --print-errors "zlib"
configure:3412: $? = 0
configure:3428: result: /nix/store/njwanmygmqc5vdhx22mnipiihqp39ysr-zlib-1.3.1-static/lib

config.scm:

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

(define %libz
  "/nix/store/njwanmygmqc5vdhx22mnipiihqp39ysr-zlib-1.3.1-static/lib/libz")

zlib.scm:

(define %zlib
  (delay (dynamic-link %libz)))

libdir in zlib.pc changed to zlib.static if splitStaticOutput is true (default):

"--libdir=${placeholder (if splitStaticOutput then "static" else "out")}/lib"


Pointing it directly to correct path with env var seems to work:

--- a/pkgs/by-name/gu/guile-zlib/package.nix
+++ b/pkgs/by-name/gu/guile-zlib/package.nix
@@ -32,6 +32,8 @@
   propagatedBuildInputs = [ zlib ];
   makeFlags = [ "GUILE_AUTO_COMPILE=0" ];

+  env.LIBZ_LIBDIR = "${lib.getLib zlib}/lib";
+
   doCheck = true;

   meta = {

Might be a better solution than override.
At least it does not require extra fix for eval on staging.

@ghpzin ghpzin mentioned this pull request Mar 7, 2026
13 tasks
@marcin-serwin
Copy link
Copy Markdown
Contributor

Superseded by #497498

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: guile-zlib

4 participants