Skip to content

[staging] fix pkgsMusl.stdenv#473403

Merged
yuyuyureka merged 3 commits intoNixOS:stagingfrom
yuyuyureka:musl-stdenv
Jan 11, 2026
Merged

[staging] fix pkgsMusl.stdenv#473403
yuyuyureka merged 3 commits intoNixOS:stagingfrom
yuyuyureka:musl-stdenv

Conversation

@yuyuyureka
Copy link
Contributor

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.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: stdenv Standard environment labels Dec 22, 2025
@alyssais
Copy link
Member

Might be nice to put the URLs you got the patches from somewhere.

@alyssais
Copy link
Member

@NixOS/infra could somebody please upload the bootstrap files here to tarballs.nixos.org?

(Drafting to prevent accidental merge before the bootstrap files are uploaded.)

@alyssais alyssais marked this pull request as draft December 22, 2025 20:48
@ghpzin
Copy link
Contributor

ghpzin commented Dec 22, 2025

Just checking, but bootstrap for aarch64-unknown-linux-musl does not need similar update ?

@alyssais
Copy link
Member

Good point. I think it does — I at least saw the build failures on aarch64.

@mweinelt
Copy link
Member

@NixOS/infra could somebody please upload the bootstrap files here to tarballs.nixos.org?

Mentioned in the internal team chat. We sadly lack documentation for the workflow.

@Mic92
Copy link
Member

Mic92 commented Dec 23, 2025

@NixOS/infra could somebody please upload the bootstrap files here to tarballs.nixos.org?

Mentioned in the internal team chat. We sadly lack documentation for the workflow.

Where do you want this documentation to life? The aws commands are usually generated by the code in nixpkgs itself.
Same case here: 17306d9
Do we need more documentation than that?

@vcunat
Copy link
Member

vcunat commented Dec 23, 2025

Sounds OK to me to have it in nixpkgs, at a glance, with infra as codeowner for that file. It could be cross-linked from some places, e.g. from maintainers/scripts/bootstrap-files/refresh-tarballs.bash

EDIT: ah, I didn't realize that the generated commits have lots of info already.

@Mic92
Copy link
Member

Mic92 commented Dec 23, 2025

Uploaded.

~/git/nixos-infra/terraform main
nix-shell-env %  aws s3 cp --recursive s3://nixpkgs-tarballs/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c ./
download: s3://nixpkgs-tarballs/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/busybox to ./busybox
download: s3://nixpkgs-tarballs/stdenv/x86_64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/bootstrap-tools.tar.xz to ./bootstrap-tools.tar.xz

~/git/nixos-infra/terraform main
nix-shell-env % sha256sum bootstrap-tools.tar.xz busybox
5b0038ab424d11d9d20214f070f188af0b8e85adf74f46911bbb51fd8800ecbe  bootstrap-tools.tar.xz
ec6a468f2f6716b851612ed36e6db877cbef4c555321344ff229f4cca68483b4  busybox

@vcunat vcunat marked this pull request as ready for review December 23, 2025 07:29
@yuyuyureka
Copy link
Contributor Author

Updated aarch64 bootstrap too

@yuyuyureka yuyuyureka marked this pull request as draft December 23, 2025 09:12
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C patches and docs looks good to me.

@mweinelt
Copy link
Member

mweinelt commented Dec 28, 2025

That should be it.

$ git pr 473403
[...]

$ ./maintainers/scripts/bootstrap-files/refresh-tarballs.bash --targets=aarch64-unknown-linux-musl
fetching path input 'path:/nix/store/nvbxpqz09a51djx10kwf0yfifhwq3lmx-source'
INFO: Fetching latest successful build from 'https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.aarch64-unknown-linux-musl.build/latest'
INFO: Fetching oldest eval details from 'https://hydra.nixos.org/eval/1820664' (can take a minute)
INFO: Fetching bootstrap tools to calculate hashes from '/nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools'
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools
INFO: Writing 'pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix'
path is '/nix/store/w847lcsnx0195zjn5nsx2l73zbgjpcpc-bootstrap-tools.tar.xz'
path is '/nix/store/4mdf6d3mrfp0wrdpsxz2vw09il3dv8am-busybox'
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/*
INFO: DRY RUN: git commit pkgs/stdenv/linux/bootstrap-files/aarch64-unknown-linux-musl.nix -F aarch64-unknown-linux-musl.commit_message

$ nix-store --realize /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools

$ 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

$ aws s3 cp --recursive --acl public-read /nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/ s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c
upload: ../../../../../../nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/busybox to s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/busybox
upload: ../../../../../../nix/store/c3qpy1mlcrqklpak5lkgdy0l0kbsndl1-stdenv-bootstrap-tools/on-server/bootstrap-tools.tar.xz to s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/bootstrap-tools.tar.xz

$ aws s3 cp --recursive s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c ./
download: s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/busybox to ./busybox
download: s3://nixpkgs-tarballs/stdenv/aarch64-unknown-linux-musl/8c29968b3a942f2903f90797f9623737c215737c/bootstrap-tools.tar.xz to ./bootstrap-tools.tar.xz

$ sha256sum bootstrap-tools.tar.xz busybox
9f0fcf155c18646f683ee4127fbeb4552c0acc728a640debf97a83afc1cbcad8  bootstrap-tools.tar.xz
9924c4f1d2605d79716073d0a86a0ed8c1b31388724ffdf289f8198a476ca101  busybox

$ 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/busybo

@mweinelt mweinelt marked this pull request as ready for review December 28, 2025 16:48
yuyuyureka added a commit to yuyuyureka/nixpkgs that referenced this pull request Dec 29, 2025
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: NixOS#473403
yuyuyureka added a commit to yuyuyureka/nixpkgs that referenced this pull request Dec 29, 2025
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: NixOS#473403
@LordGrimmauld LordGrimmauld mentioned this pull request Dec 29, 2025
13 tasks
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the patches look sane to me. I'm looking to have one of the musl committers hit the merge button.

Copy link
Contributor

@LordGrimmauld LordGrimmauld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been running this patch stack on my toy msul VM just fine, so at least x86_64-linux-musl should be good with this. There are still other musl breaks from the last staging cycle, but this gets a large chunk of what was broken.

The changes to the extern stubs are trivial, and hexa pushed the bootstrap files to cache already. I believe we are only waiting for the tiny doc change suggested in https://github.com/NixOS/nixpkgs/pull/473403/files#r2649808444 now?

@nixpkgs-ci nixpkgs-ci bot requested a review from mdaniels5757 January 6, 2026 23:03
@nixpkgs-ci nixpkgs-ci bot removed the 6.topic: stdenv Standard environment label Jan 6, 2026
Copy link
Member

@mdaniels5757 mdaniels5757 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we not gating the gnumake patches to musl? As the comment explained just above the changed code, various libcs have conflicting prototypes for getopt and getenv. Doing this unconditionally could break other non-glibc libcs.

@alyssais
Copy link
Member

alyssais commented Jan 7, 2026

Why are we not gating the gnumake patches to musl? As the comment explained just above the changed code, various libcs have conflicting prototypes for getopt and getenv. Doing this unconditionally could break other non-glibc libcs.

We avoid conditional patch application where possible in Nixpkgs because it causes patches to get missed when doing package updates, and multiple conditional patches can end up conflicting with each other. The prototypes of getopt and getenv are specified by POSIX, so libcs with conflicting prototypes would be non-conforming. The upstream behaviour of GNU Make, which will hopefully be fixed when they accept the patches, is not compatible with modern C because an empty argument list now means "no arguments" instead of "arguments unspecified".

@alyssais alyssais added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 7, 2026
yuyuyureka and others added 3 commits January 7, 2026 14:02
This reverts commit 893e5e7.
The change is re-introduced in the following commit without gating patches to 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.
@yuyuyureka
Copy link
Contributor Author

yuyuyureka commented Jan 7, 2026

See also https://lists.gnu.org/archive/html/which-bugs/2025-04/msg00003.html (for GNU which, not GNU make, but same issue), which @mdaniels5757 posted in #477577 . I'm out of ideas though on how to address it, since it doesn't work like the GNU maintainers intended anymore (but adding a special case for each libc is also not a real option).

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 7, 2026
@mdaniels5757 mdaniels5757 dismissed their stale review January 7, 2026 21:40

Looks like the comment I was talking about pre-dates getopt being part of the POSIX standard (which happened in 2001, per the manpage). Probably safe to ignore then: everyone's had plenty of time to conform.

@yuyuyureka
Copy link
Contributor Author

Merging as this is actually only the cleanup making the patches unconditional...

@yuyuyureka yuyuyureka added this pull request to the merge queue Jan 11, 2026
Merged via the queue into NixOS:staging with commit 3115501 Jan 11, 2026
32 of 34 checks passed
@yuyuyureka yuyuyureka deleted the musl-stdenv branch January 11, 2026 11:33
@github-project-automation github-project-automation bot moved this from In Progress to Done in Stdenv Jan 11, 2026
@uninsane uninsane added the 6.topic: musl Running or building packages with musl libc label Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: musl Running or building packages with musl libc 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

10 participants