Skip to content

[staging-next] Darwin stdenvBootstrap fixes 2025-10#448523

Merged
vcunat merged 2 commits intoNixOS:staging-nextfrom
dramforever:darwin-bootstrap-fixes-2025-10
Oct 5, 2025
Merged

[staging-next] Darwin stdenvBootstrap fixes 2025-10#448523
vcunat merged 2 commits intoNixOS:staging-nextfrom
dramforever:darwin-bootstrap-fixes-2025-10

Conversation

@dramforever
Copy link
Contributor

@dramforever dramforever commented Oct 4, 2025

Note: I haven't tested these. Also, I don't know what needs to be done for the --resource-dir thing to not run into it while bootstrapping Darwin stdenv next time.

For the {aarch64 => arm64}-apple-darwin rename, it seems to avoid rebuilding LLVM at all, which looks promising.

I haven't tested the --resource-dir thing at all.

Edit: stdenvBootstrapTools.{x86_64,arm64}-apple-darwin.{build,test} works

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.

Fix this config name for consistency with non-bootstrap platform config.
This also fixes a build failure of the bootstrap tools on
aarch64-darwin, where a test in LLVM 21 assumes it's spelt arm64, not
aarch64.

Also saves on having to rebuild LLVM just for bootstrap tools, now that
the config is consistent.
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 4, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: stdenv Standard environment labels Oct 4, 2025
@nix-owners nix-owners bot requested review from emilazy, reckenrode and toonn October 4, 2025 12:11
@dramforever dramforever force-pushed the darwin-bootstrap-fixes-2025-10 branch from cd13af0 to 8bfd3c8 Compare October 4, 2025 15:39
@dramforever

This comment was marked as outdated.

Since NixOS#420382, we set an absolute default CLANG_RESOURCE_DIR for LLVM
versions >= 21, which breaks the bootstrap tools because the absolute
path was removed by nuke-ref while building and isn't there while
bootstrapping.

Pass -resource-dir explicitly while testing Clang to make it work.
@dramforever dramforever force-pushed the darwin-bootstrap-fixes-2025-10 branch from 8bfd3c8 to b0ff7e6 Compare October 4, 2025 19:56
@@ -22,7 +22,7 @@
supportedSystems ? builtins.fromJSON (builtins.readFile ../../ci/supportedSystems.json),
# The platform triples for which we build bootstrap tools.
bootstrapConfigs ? [
"aarch64-apple-darwin"
"arm64-apple-darwin"
Copy link
Member

@LunNova LunNova Oct 5, 2025

Choose a reason for hiding this comment

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

has the triple we use for aarch64 darwin been inconsistent between pkgs vs bootstrap for ages? :c

aarch64-darwin's pkgs.hostPlatform.config does give arm64-apple-darwin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This has finally come to bite us.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I've ended up centralizing what we know here #444862 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

It seems like we're using darwinArch to turn aarch64 -> arm64 in some places, maybe we can clean those up in a followup if they were only needed due to this inconsistency.

  darwinArch = cpu: if cpu.name == "aarch64" then "arm64" else cpu.name;

@dramforever
Copy link
Contributor Author

cc @reckenrode: This will require fixes in darwin bootstrap next time the bootstrap tarballs are refreshed. Unfortunately I have no idea how.

@vcunat vcunat merged commit 463b83a into NixOS:staging-next Oct 5, 2025
31 of 33 checks passed
@github-project-automation github-project-automation bot moved this to Done in Stdenv Oct 5, 2025
@vcunat
Copy link
Member

vcunat commented Oct 5, 2025

Thanks. I think we'd better unblock now on Hydra. But feel free to improve further, anyone.

mdaniels5757 added a commit to mdaniels5757/nixpkgs that referenced this pull request Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants