From f1166c662975ae591f4699f79a94ecb0f73386e9 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 22 Dec 2025 20:29:49 +0100 Subject: [PATCH 1/3] pkgs/stdenv/linux: update x86_64-unknown-linux-musl bootstrap-files sha256sum of files to be uploaded: $ sha256sum /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools/on-server/* 5b0038ab424d11d9d20214f070f188af0b8e85adf74f46911bbb51fd8800ecbe /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools/on-server/bootstrap-tools.tar.xz ec6a468f2f6716b851612ed36e6db877cbef4c555321344ff229f4cca68483b4 /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools/on-server/busybox Suggested commands to upload files to 'tarballs.nixos.org': $ nix-store --realize /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools $ aws s3 cp --recursive --acl public-read /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools/on-server/ s3://nixpkgs-tarballs/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c $ aws s3 cp --recursive s3://nixpkgs-tarballs/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c ./ $ sha256sum bootstrap-tools.tar.xz busybox $ sha256sum /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools/on-server/* --- .../x86_64-unknown-linux-musl.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/stdenv/linux/bootstrap-files/x86_64-unknown-linux-musl.nix b/pkgs/stdenv/linux/bootstrap-files/x86_64-unknown-linux-musl.nix index 283b12b0d578..fb9f4827b298 100644 --- a/pkgs/stdenv/linux/bootstrap-files/x86_64-unknown-linux-musl.nix +++ b/pkgs/stdenv/linux/bootstrap-files/x86_64-unknown-linux-musl.nix @@ -2,20 +2,20 @@ # $ ./refresh-tarballs.bash --targets=x86_64-unknown-linux-musl # # Metadata: -# - nixpkgs revision: 125cefd4cf8f857e5ff1aceaef9230ba578a033d +# - nixpkgs revision: 8c29968b3a942f2903f90797f9623737c215737c # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.x86_64-unknown-linux-musl.build/latest -# - resolved hydra build: https://hydra.nixos.org/build/247890807 -# - instantiated derivation: /nix/store/gqri9n85rsf2983r6m8lkz0h69k4n7xi-stdenv-bootstrap-tools.drv -# - output directory: /nix/store/b0x0qcbf1gsp50jzw52sbbgdp3jlwcjf-stdenv-bootstrap-tools -# - build time: Fri, 26 Jan 2024 22:09:22 +0000 +# - resolved hydra build: https://hydra.nixos.org/build/315356522 +# - instantiated derivation: /nix/store/783rl6mlrc2wpp9apclcvc8x7vwi842s-stdenv-bootstrap-tools.drv +# - output directory: /nix/store/f881dxkvjal4vflnznfbz7g6pn4q0c56-stdenv-bootstrap-tools +# - build time: Mon, 01 Dec 2025 18:29:47 +0000 { bootstrapTools = import { - url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/125cefd4cf8f857e5ff1aceaef9230ba578a033d/bootstrap-tools.tar.xz"; - hash = "sha256-t0W2MR7UwtPyYEGcRo9UOuXfaP4uUZKZXEmYGcBOuOA="; + url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/bootstrap-tools.tar.xz"; + hash = "sha256-WwA4q0JNEdnSAhTwcPGIrwuOha33T0aRG7tR/YgA7L4="; }; busybox = import { - url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/125cefd4cf8f857e5ff1aceaef9230ba578a033d/busybox"; - hash = "sha256-0U2r3EU61oqhs+oyzFABIFTCVqXOWSP0qEtnyHwjzm0="; + url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/busybox"; + hash = "sha256-XJTiB2U3KkP31G5s68Ho7wQY5yz72CZkLSarR+56zKw="; executable = true; }; } From 795dd44a9f83e9cfa085ebf00c36681457613c21 Mon Sep 17 00:00:00 2001 From: Yureka Date: Tue, 23 Dec 2025 10:09:42 +0100 Subject: [PATCH 2/3] pkgs/stdenv/linux: update aarch64-unknown-linux-musl bootstrap-files sha256sum of files to be uploaded: $ sha256sum /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/* 9f0fcf155c18646f683ee4127fbeb4552c0acc728a640debf97a83afc1cbcad8 /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/bootstrap-tools.tar.xz 9924c4f1d2605d79716073d0a86a0ed8c1b31388724ffdf289f8198a476ca101 /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/busybox Suggested commands to upload files to 'tarballs.nixos.org': $ nix-store --realize /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools $ aws s3 cp --recursive --acl public-read /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/ s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c $ aws s3 cp --recursive s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c ./ $ sha256sum bootstrap-tools.tar.xz busybox $ sha256sum /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/* --- .../aarch64-unknown-linux-musl.nix | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix b/pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix index c1a96e66013c..3493721ba5da 100644 --- a/pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix +++ b/pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix @@ -1,25 +1,21 @@ +# Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: +# $ ./refresh-tarballs.bash --targets=aarch64-unknown-linux-musl # -# Files came from this Hydra build: -# -# https://hydra.nixos.org/build/246470544 -# -# …which used nixpkgs revision dd5621df6dcb90122b50da5ec31c411a0de3e538 -# to instantiate: -# -# /nix/store/g480ass2vjmakaq03z7k2j95xnxh206a-stdenv-bootstrap-tools.drv -# -# …and then built: -# -# /nix/store/95lm0y33dayag4542s8bi83s31bw68dr-stdenv-bootstrap-tools -# +# Metadata: +# - nixpkgs revision: 8c29968b3a942f2903f90797f9623737c215737c +# - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.aarch64-unknown-linux-musl.build/latest +# - resolved hydra build: https://hydra.nixos.org/build/315356516 +# - instantiated derivation: /nix/store/zd9i77gp51l3chdkfyqhffzfnmbmf02y-stdenv-bootstrap-tools.drv +# - output directory: /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools +# - build time: Mon, 01 Dec 2025 18:29:46 +0000 { + bootstrapTools = import { + url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/bootstrap-tools.tar.xz"; + hash = "sha256-nw/PFVwYZG9oPuQSf760VSwKzHKKZA3r+XqDr8HLytg="; + }; busybox = import { - url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/dd5621df6dcb90122b50da5ec31c411a0de3e538/busybox"; - sha256 = "sha256-WuOaun7U5enbOy8SuuCo6G1fbGwsO16jhy/oM8K0lAs="; + url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/busybox"; + hash = "sha256-ASctUeTLD/TC6aZHX9xuRsmlacwCDxt9zsb/gy6Ia1g="; executable = true; }; - bootstrapTools = import { - url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/dd5621df6dcb90122b50da5ec31c411a0de3e538/bootstrap-tools.tar.xz"; - hash = "sha256-ZY9IMOmx1VOn6uoFDpdJbTnPX59TEkrVCzWNtjQ8/QE="; - }; } From 893e5e74d2d6f6828299a3dfa78868a7e9d48aee Mon Sep 17 00:00:00 2001 From: Yureka Date: Fri, 26 Dec 2025 16:08:32 +0100 Subject: [PATCH 3/3] gnumake: fix build with musl The patch for getopt.{c,h} was sent to the mailing list in March and did not get any replies: https://lists.gnu.org/archive/html/bug-make/2025-03/msg00032.html I added the second patch fixing the same issue in lib/fnmatch.c. This commit has musl-only patches as an exception, because the staging-next cycle has already progressed too far to introduce new mass-rebuild changes for non-musl. These patches will be applied unconditionally starting from the next staging cycle: https://github.com/NixOS/nixpkgs/pull/473403 --- .../tools/build-managers/gnumake/default.nix | 4 +- ...004-Fix-signatures-for-getenv-getopt.patch | 50 +++++++++++++++++++ ...005-Fix-signatures-for-getenv-getopt.patch | 34 +++++++++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/tools/build-managers/gnumake/musl-patches/0004-Fix-signatures-for-getenv-getopt.patch create mode 100644 pkgs/development/tools/build-managers/gnumake/musl-patches/0005-Fix-signatures-for-getenv-getopt.patch diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix index 277f9be89d16..f43157fa8d65 100644 --- a/pkgs/development/tools/build-managers/gnumake/default.nix +++ b/pkgs/development/tools/build-managers/gnumake/default.nix @@ -36,7 +36,9 @@ stdenv.mkDerivation (finalAttrs: { # TODO: stdenv’s setup.sh should be aware of patch directories. It’s very # convenient to keep them in a separate directory but we can defer listing the # directory until derivation realization to avoid unnecessary Nix evaluations. - patches = lib.filesystem.listFilesRecursive ./patches; + patches = + lib.filesystem.listFilesRecursive ./patches + ++ lib.optionals stdenv.hostPlatform.isMusl (lib.filesystem.listFilesRecursive ./musl-patches); nativeBuildInputs = [ autoreconfHook diff --git a/pkgs/development/tools/build-managers/gnumake/musl-patches/0004-Fix-signatures-for-getenv-getopt.patch b/pkgs/development/tools/build-managers/gnumake/musl-patches/0004-Fix-signatures-for-getenv-getopt.patch new file mode 100644 index 000000000000..f37b7a49e341 --- /dev/null +++ b/pkgs/development/tools/build-managers/gnumake/musl-patches/0004-Fix-signatures-for-getenv-getopt.patch @@ -0,0 +1,50 @@ +From 776f707b5bb67d4c0c15f981b5a1b6d7f3a9cebc Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 22 Mar 2025 14:24:57 -0700 +Subject: [PATCH 4/5] Fix signatures for getenv/getopt + +GCC-15 complains about missing parameters, this gets found +out when using non-glibc ( e.g. musl ) C library + +Fixes +lib/fnmatch.c:124:14: error: conflicting types for 'getenv'; have 'char *(void)' +| 124 | extern char *getenv (); +| | ^~~~~~ + +src/getopt.c: Define parameters of getenv() and getopt(). +src/getopt.h: Ditto. +--- +Link: https://lists.gnu.org/archive/html/bug-make/2025-03/msg00032.html + src/getopt.c | 2 +- + src/getopt.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/getopt.c b/src/getopt.c +index 7a792de8..76251ccb 100644 +--- a/src/getopt.c ++++ b/src/getopt.c +@@ -202,7 +202,7 @@ static char *posixly_correct; + whose names are inconsistent. */ + + #ifndef getenv +-extern char *getenv (); ++extern char *getenv (const char *); + #endif + + static char * +diff --git a/src/getopt.h b/src/getopt.h +index df18ceeb..d8bb2263 100644 +--- a/src/getopt.h ++++ b/src/getopt.h +@@ -102,7 +102,7 @@ struct option + errors, only prototype getopt for the GNU C library. */ + extern int getopt (int argc, char *const *argv, const char *shortopts); + #else /* not __GNU_LIBRARY__ */ +-extern int getopt (); ++extern int getopt (int, char * const*, const char *); + #endif /* __GNU_LIBRARY__ */ + extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +-- +2.51.2 + diff --git a/pkgs/development/tools/build-managers/gnumake/musl-patches/0005-Fix-signatures-for-getenv-getopt.patch b/pkgs/development/tools/build-managers/gnumake/musl-patches/0005-Fix-signatures-for-getenv-getopt.patch new file mode 100644 index 000000000000..c594ba27c2a9 --- /dev/null +++ b/pkgs/development/tools/build-managers/gnumake/musl-patches/0005-Fix-signatures-for-getenv-getopt.patch @@ -0,0 +1,34 @@ +From a4169ae60a7cb2c2bc788daa2c91441cc807acbc Mon Sep 17 00:00:00 2001 +From: Yureka +Date: Mon, 22 Dec 2025 20:53:31 +0100 +Subject: [PATCH 5/5] Fix signatures for getenv/getopt + +As the previous commit, this fixes GCC-15 complaining about mismatching +definitions with non-glibc (musl) C library. + +Fixes +lib/fnmatch.c:124:14: error: conflicting types for 'getenv'; have 'char *(void)' +| 124 | extern char *getenv (); +| | ^~~~~~ + +lib/fnmatch.c: Define parameters of getenv() +--- + lib/fnmatch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/fnmatch.c b/lib/fnmatch.c +index 01da376b..cb1c856b 100644 +--- a/lib/fnmatch.c ++++ b/lib/fnmatch.c +@@ -121,7 +121,7 @@ USA. */ + whose names are inconsistent. */ + + # if !defined _LIBC && !defined getenv +-extern char *getenv (); ++extern char *getenv (const char *); + # endif + + # ifndef errno +-- +2.51.2 +