Commit Graph

479 Commits

Author SHA1 Message Date
Michael Daniels
4ab6d24e9a stdenv: compose custom and cross stages without recursive imports (#543332) 2026-08-17 01:37:36 +00:00
Aliaksandr
f8b9b7a087 stdenv/darwin: move the libiconv alias assertion into tests.stdenv
The final stage asserted

    assert prevStage.libiconv == prevStage.darwin.libiconv;

On Darwin `libiconv` is `darwin.libiconv`, so this compares a value with
itself. Nix does not notice: `eqValues` short-circuits only on pointer
identity of the two value slots, and these are two slots that resolve to
one attribute set. It therefore falls through to the derivation case,
which compares `outPath`.

`lib.extendDerivation` guards `outPath` behind the derivation's validity,
which reads `config.allowUnfree`, so the assertion demanded a `config`
option while the package set was still being assembled. When `config` is a
function it is passed `pkgs`, and the loop closes:

    (import <nixpkgs> {
      system = "aarch64-darwin";
      config = { pkgs, lib, ... }: { allowUnfree = lib.isAttrs pkgs; };
    }).config.allowUnfree

failed with an infinite recursion on Darwin while evaluating on Linux,
whose stdenv never forces a derivation that early. It now evaluates on
both.

Keep checking the invariant, from `tests.stdenv` instead. By then the
package set is complete, so forcing `outPath` is just a read.
The other twelve assertions in the stage read `passthru` and
`stdenv.cc.cc`, which are ungated, and stay where they are.

Assisted-by: claude-code with claude-opus-5[1m]-high
2026-08-10 00:50:54 +03:00
Ben Siraphob
b5e73a0b2d pkgs: fix typos in stdenv, build-support, top-level and test
Assisted-by: Claude Code (claude-opus-5)
2026-08-02 11:15:27 -07:00
Aliaksandr
2dd1349006 stdenv: stop passing crossSystem to local stages
The dispatcher now constructs local bootstrap stages directly, so their target is represented entirely by localSystem. Remove the redundant crossSystem arguments and equality assertions from each local stage implementation.

Assisted-by: codex with gpt-5.6-sol-high
2026-07-19 00:11:51 +03:00
Emily
fa7fbd4ac9 darwin.Csu: drop 2026-06-26 18:28:11 +01:00
Emily
17a4d7bc6a stdenv/darwin: drop x86_64-darwin bootstrap tools 2026-06-26 07:36:05 +01:00
nixpkgs-ci[bot]
92fd31e931 Merge staging-next into staging 2026-06-23 00:19:28 +00:00
Emily
c6e7a2d1b3 stdenv/darwin/stdenv-bootstrap-tools: drop x86_64-darwin special case (#492105) 2026-06-23 00:09:43 +00:00
nixpkgs-ci[bot]
7fa1388d2b Merge staging-next into staging 2026-06-06 18:29:05 +00:00
Aliaksandr
125de9a4c3 stdenv: do not pass crossOverlays redundantly
crossOverlays only needed for stageCross, so lets pass them only there
2026-06-06 06:04:25 +03:00
nixpkgs-ci[bot]
d644c92282 Merge staging-next into staging 2026-06-01 19:39:24 +00:00
Randy Eckenrode
8fc19d25f3 darwin.stdenv: fix infinite recursion due to Python 3.14 upgrade 2026-05-30 03:53:16 +02:00
Eman Resu
159a6daf6b stdenv/generic: memoise passing config to mkDerivation unless overriden 2026-05-29 16:51:25 -04:00
Eman Resu
ada7d723b1 stdenv/darwin: remove no-ops 2026-05-09 15:50:14 -04:00
Emily
ba5aeed0cb stdenv/darwin/stdenv-bootstrap-tools: drop x86_64-darwin special case
This no longer seems to be necessary.
2026-03-28 17:31:34 +00:00
Vladimír Čunát
b6a2b6c48f stdenv-bootstrap-tools: fixup eval on darwin in coreutils
It was defining NIX_LDFLAGS both directly and via env:
> error: The `env` attribute set cannot contain any attributes passed to derivation.
2026-02-21 07:55:17 +01:00
nixpkgs-ci[bot]
79424fc2c3 Merge staging-next into staging 2026-01-30 12:11:07 +00:00
Colin
44b893a9f0 gnu-config: enable strictDeps
it would be as simple as setting `strictDeps = true` and
`buildInputs = [ bashNonInteractive ]` except this package is used
during the bootstrap of `stdenv`: this method of manually patching
seems to be the least complex way to get correct behavior while
avoiding cyclic when deriving `stdenv` itself.

successfully built the following, from x86_64-linux:
- `gnu-config`
- `pkgsCross.aarch64-multiplatform.buildPackages.gnu-config` (equivalent)
- `pkgsCross.aarch64-multiplatform.gnu-config`
- `pkgsCross.musl32.gnu-config`
- `pkgsMusl.gnu-config`
- `pkgsStatic.gnu-config`
- `pkgsi686Linux.gnu-config`

successfully eval'd `gnu-config` for the following systems:
- `aarch64-darwin`
- `aarch64-freebsd`
- `aarch64-linux-musl`
- `aarch64-linux`
- `x86_64-cygwin`
- `x86_64-darwin`
- `x86_64-freebsd`
- `x86_64-linux-musl`
- `x86_64-linux`
2026-01-25 21:42:05 +00:00
Michael Daniels
006ecdbdeb treewide: fix typos (#479869) 2026-01-24 21:36:44 +00:00
nixpkgs-ci[bot]
bbad422ad5 Merge staging-next into staging 2026-01-21 18:15:13 +00:00
Vladimír Čunát
31e093d3b0 stdenv-bootstrap-tools: coreutils might miss bin/runcon
This fixes the build, tested
nix build -f pkgs/top-level/release.nix stdenvBootstrapTools.x86_64-unknown-linux-gnu.test

https://hydra.nixos.org/build/319154291/nixlog/8/tail
https://github.com/NixOS/nixpkgs/pull/460517#issuecomment-3779280430
2026-01-21 17:36:31 +01:00
Randy Eckenrode
ad2b074402 stdenv/darwin: work around override with overrideScope
Co-authored-by: Emily <vcs@emily.moe>
2026-01-14 19:42:02 -05:00
Ben Siraphob
c7e10647ea treewide: fix typos 2026-01-13 14:45:11 -05:00
Randy Eckenrode
0adefff506 stdenv/darwin: drop unnecessary llvm-manpages override 2026-01-11 12:08:11 -05:00
Randy Eckenrode
ff91b8ca87 stdenv/darwin: remove unnecessary override 2026-01-11 12:08:11 -05:00
Randy Eckenrode
1e15717339 stdenv/darwin: manually propagate libc++
This is the libc++ from the bootstrap. Once the past the xclang stage,
the bootstrap uses the system libc++. Unfortunately, it doesn’t seem to
work with the bootstrap tools.
2026-01-11 12:08:11 -05:00
Randy Eckenrode
2869d09ae9 stdenv/darwin: drop custom wrappers for the standard ones
This removes the need to keep these in sync, which should (hopefully)
simplify maintenance.
2026-01-11 12:08:10 -05:00
Randy Eckenrode
d474ba3a83 stdenv/darwin: build expand-response-params with an unwrapped compiler
Building `expand-response-params` early in the bootstrap will allow the
custom wrappers (for `cc` and `bintools`) to be dropped.
2026-01-11 12:08:10 -05:00
Randy Eckenrode
1d7ad26261 stdenv/darwin: use top-level libc 2026-01-11 12:08:10 -05:00
Randy Eckenrode
d8513416ec stdenv/darwin: clean up allowedRequisites
The Darwin bintools were moved to have all `darwin` packages in the same
place. The LLVM ones are using the original, unaliased names.
2026-01-11 12:08:10 -05:00
Randy Eckenrode
ecf7a3e955 stdenv/darwin: clean up LLVM overrides at the end
This change allows `overrideScope` to work correctly outside of the
bootstrap. Packages have to be overriden manually with the final
`libllvm` to make sure any overrides to `libllvm` are picked up. The
workaround is being dropped because rebuilds are expected.

Note that the top-level `clang` is being dropped because it is an alias
for `llvmPackages.clang`. Not overlaying it preserves the expected
behavior if someone overlays `llvmPackages.clang` in their config (which
is that the top-level one will be the same derivation as the overlay).
2026-01-11 12:08:10 -05:00
Randy Eckenrode
6e9c55e202 stdenv/darwin: align LLVM tool package overrides with derivation
The LLVM derivation defines `llvm` as an alias for `libllvm`. The same
is true for `clang-unwrapped` and `clang`. Doing the overrides this way
allows overrides to work as expected (especially at the end).
2026-01-11 12:08:10 -05:00
Randy Eckenrode
8abaff6042 stdenv/darwin: use a versioned llvmPackages
It’s not ideal that the version has to be hardcoded, but right now it’s
not recorded in any configuration accessible from the bootstrap outside
of a package set. If that changes in the future, this should be changed
to get `llvmVersion` from that source.
2026-01-11 12:08:10 -05:00
Randy Eckenrode
21f149763f stdenv/darwin: overlay llvmLibrariesDarwinDepsNoCC where needed 2026-01-11 12:08:09 -05:00
Johannes Kirschbauer
4ad85b485d various: lib usage improvements - prefer removeAttrs over filterAttrs (#455787) 2025-10-27 16:17:52 +00:00
h7x4
b6625b9f01 stdenv/darwin: lib.filterAttrs -> lib.removeAttrs 2025-10-27 19:07:34 +09:00
Luna Nova
9106b7cd22 pkgs/stdenv/darwin: rebuild avoidance for LLVM scope
- Setting recurseForDerivations again post overrideScope
- Hackily propagating initial value llvmPackages.override
2025-10-25 20:06:32 +01:00
Tristan Ross
62d59194b8 pkgs/development/compilers/llvm: use makeScopeWithSplicing'
Co-authored-by: Luna Nova <git@lunnova.dev>
Co-authored-by: Emily <vcs@emily.moe>
2025-10-25 20:06:32 +01:00
K900
fb73ccd10d Merge remote-tracking branch 'origin/staging-next' into staging 2025-10-07 08:19:36 +03:00
Silvan Mosberger
56f680d915 fetchurl: Allow hashed mirror overriding with config.hashedMirrors
Allows having alternate hashed mirrors as fallbacks. Useful in case the
default hashed mirror is not accessible or doesn't have everything
needed.

Co-authored-by: Johan Herland <johan.herland@tweag.io>
Co-authored-by: Yuriy Taraday <yuriy.taraday@tweag.io>
Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru>
2025-10-06 14:15:10 +02:00
nixpkgs-ci[bot]
39338c0b09 Merge staging-next into staging 2025-10-05 06:05:50 +00:00
Vladimír Čunát
463b83a00d Darwin stdenvBootstrap fixes 2025-10 (#448523) 2025-10-05 07:58:18 +02:00
nixpkgs-ci[bot]
e23d356469 Merge staging-next into staging 2025-10-05 00:18:23 +00:00
dramforever
b0ff7e6b3a freshBootstraptools.test: Fix Clang test on Darwin
Since #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.
2025-10-05 03:56:36 +08:00
K900
f8d669f413 Merge remote-tracking branch 'origin/master' into staging-next 2025-10-04 21:10:21 +03:00
NAHO
c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
dramforever
54ae3fdcd9 release.nix: Use arm64-apple-darwin in bootstrapConfigs, not aarch64
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.
2025-10-04 19:48:11 +08:00
Randy Eckenrode
475f17b865 apple-sdk: link CUPS headers into the sysroot
Not having the CUPS headers in the sysroot causes problems for Swift’s
module importer when it tries to import AppKit, which depends on CUPS
headers. The module importer is effectively an unwrapped Clang, so the
headers need to be symlinked there instead of just propagated.
2025-09-22 09:36:50 -04:00
Emily
1b180b82af darwin.libcxx: (╯°□°)╯︵ ┻━┻ (#398727) 2025-09-15 19:43:28 +01:00
Randy Eckenrode
c4c5d25f13 pkgs/stdenv/darwin: switch to using the system libc++ by default 2025-09-15 19:24:08 +01:00