Skip to content

Sync with upstream 2.34.6#386

Merged
edolstra merged 848 commits intomainfrom
sync-2.34
Apr 24, 2026
Merged

Sync with upstream 2.34.6#386
edolstra merged 848 commits intomainfrom
sync-2.34

Conversation

@edolstra
Copy link
Copy Markdown
Collaborator

@edolstra edolstra commented Mar 17, 2026

Motivation

Context

Summary by CodeRabbit

  • New Features

    • REPL: bindings parsing and improved diagnostics; Unix-socket server; build log viewer; installer now adds Nix manual pages by default.
  • Documentation

    • Added Nix32 and Nix Cache Info specs; updated release notes and installation/build guidance; removed deprecated NIX_DATA_DIR.
  • Tests / Benchmarks

    • New Windows config, HTTPS/MTLS cache tests, network test harness, and multiple benchmarks.
  • Bug Fixes

    • Restored AWS STS/WebIdentity and ECS credential support; improved cache/substituter behavior and various error-message/stability fixes.
  • Chores

    • CI artifact updates, .gitignore additions, version bumped to 2.34.3.

roberth and others added 30 commits February 16, 2026 16:43
…ause

ref<Derived> was already implicitly convertible to ref<Base>, but the
mechanism was unclear and error messages for rejected downcasts were
more cryptic than necessary. This change:

- Adds RefImplicitlyUpcastableTo concept to constrain the conversion
  operator, making the intent explicit and improving error messages
- Documents .cast() and .dynamic_pointer_cast() as alternatives for
  explicit downcasting
- Adds unit tests for covariance behavior
When ref::cast() fails, the error message was cryptic ("null pointer
cast to ref"). Now it throws a proper bad_ref_cast (a std::bad_cast
subclass) with a clear message showing the actual types involved:

    ref<nix::Base> cannot be cast to ref<nix::Derived>

This also adds a demangle.hh utility.
It is only supported on that host platform.
This adds a bunch of redundant-ish wiring logic, because the alternative
is accessing `meta.platforms` generically, but that would cause these
flake output attrsets *containing* the packages to be *strict in all
packages*, which is very bad for performance and robustness.

Checked:
- Cross-compilation still works for Linux targets (arm, riscv),
  even when build platform is Darwin
- No attributes for nix-nswrapper for native Darwin
Linux, macOS, and all 3 BSDs have it (according to man page google
search), so let's just drop this. Support for not having it was added in
d03f0d4 in 2006, things have changed in
the last 20 years!
… compression

Docker 28+ defaults to the containerd image store, which pushes layers
uncompressed instead of gzip. The GHA runner image updated Docker to
29.x (actions/runner-images#13633), causing the `nixos/nix:2.33.3`
image to balloon from 138 MB to 505 MB, with all 70 layers pushed as
`application/vnd.docker.image.rootfs.diff.tar` instead of `.tar.gzip`.
OCI clients that only support gzip (e.g. `go-containerregistry`, used
by Concourse CI) fail with "gzip: invalid header".

This commit disables the containerd snapshotter in the release workflow
before any Docker operations, restoring the classic storage driver that
preserves gzip compression through the `docker load` / `docker push`
pipeline.

Fixes NixOS#15246
`file-descriptor.{cc,hh}` was getting too big, split out
`file-system-at.{cc,hh}` for the FD-based file system stuff,
`file-descriptor.{cc,hh}` will only be for the fundamental primitives
that are file-system agnostic and work on almost all file types.

Review with `git show --color-moved` to see that this is indeed all
moving.
Remove suppport for not having `lchown`
Add missing temproots for cached sources and existing derivations
The NIX_BUILD_TOP test used regex matching with an unquoted path
variable. When the path contains `+` (or other regex operators),
the test fails because `+` is interpreted as a quantifier rather than
a literal character. Glob matching handles these characters correctly.
…h scheme

When a URL like `github:nixos/nixpkgs/nixpkgs.git?ref=<hash>` (using
`ref` instead of `rev`) failed the github input scheme, it fell
through to `parsePathFlakeRefWithFragment` which constructed a `path:`
`ParsedURL` with an empty authority but a relative path. This violated
RFC 3986 section 3.3 (authority present requires path starting with
`/`), causing an assertion failure in `renderAuthorityAndPath` when
`PathInputScheme` tried to format the URL for an error message.

This commit only sets the authority on absolute paths. Relative paths
get `std::nullopt` for authority, which is the correct representation
per the URL spec.

Fixes NixOS#15196. Fixes NixOS#14830.
Split `file-system-at.{cc,hh}` from `file-descriptor.{cc,hh}`
libflake: fix assertion crash when malformed URL falls through to path scheme
The tab completion handler in `completePrefix` only caught `ParseError`,
`EvalError`, `BadURL`, and `FileNotFound`. Other error types like
`JSONParseError` (which derives from `Error`, not `EvalError`) escaped
the catch block and propagated through editline's C code as undefined
behavior, crashing the REPL. This happened when tab-completing
expressions like `(builtins.fromJSON "invalid").` where evaluation
throws a non-`EvalError` exception.

This commit marks `completionCallback` and `listPossibleCallback` as
`noexcept` with function-try-blocks that catch all exceptions at the
C/C++ boundary, preventing any exception from reaching editline.

Fixes NixOS#15133.
…ssion

upload-release: disable containerd image store to preserve gzip layer compression
repl: catch all errors during tab completion
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 31.9.0 to 31.9.1.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](cachix/install-nix-action@4e002c8...2126ae7)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: 31.9.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/korthout/backport-action/releases)
- [Commits](korthout/backport-action@c656f5d...01619eb)

---
updated-dependencies:
- dependency-name: korthout/backport-action
  dependency-version: 4.1.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
The external-builders test expands `$PATH` into a heredoc without quotes,
so any `PATH` entry containing spaces causes bash to parse the line as a
command instead of an assignment, failing the test.
…ders-path

tests: quote `PATH` in external-builders test heredoc
…sage printing

Consolidates all the error message formatting in one place. It was very weird
and tiring to remember to call git_error_last() in all the places.
This reduces the churn when changing up the order of
values in a follow-up commit. This should have been done
from the start ideally to improve readability.
This makes sure that ExprVar::eval inlines lookupVar call. In practice
this seems to reduce instruction count by ~2%, though it doesn't have
a statistically significant impact on the wall time.
Using nix::unreachable() in getInternalType() and type() turns
out to be quite expensive and prevents inlining. Also Value::type
got compiled to a jump table which has a high overhead from indirect
jumps. Using an explicit lookup table turns out to be more efficient.

This does mean that we lose out on nice diagnostics from nix::unreachable
calls, but this code is probably one of the hottests functions in the whole
evaluator, so I think the tradeoff is worth it. The nixUnreachableWhenHardened
boils down to nix::unreachable when UBSan is enabled so we still have good
coverage there.
libfetchers/git-utils: Add GitError class for deduplicating error…
libexpr: Optimise `Value::type()`, `ValueStorage::getInternalType()`
libexpr: Make sure `EvalState::lookupVar` is inlined
This comes in two parts: a `nix store roots-daemon` command that
can run as root and list runtime roots,
and client logic to find runtime roots for a `LocalStore` by connecting
to that daemon.

This may be useful with an unprivileged nix daemon, as it would
otherwise be unable to find runtime roots from process open files
and maps.
…inimal

Support garbage collection in external daemon
@github-actions github-actions Bot temporarily deployed to pull request April 13, 2026 18:11 Inactive
@github-actions github-actions Bot temporarily deployed to pull request April 14, 2026 11:03 Inactive
@edolstra edolstra changed the title Sync with upstream 2.34.4 Sync with upstream 2.34.6 Apr 20, 2026
@github-actions github-actions Bot temporarily deployed to pull request April 21, 2026 08:21 Inactive
@github-actions github-actions Bot temporarily deployed to pull request April 21, 2026 09:48 Inactive
cole-h
cole-h previously approved these changes Apr 22, 2026
@github-actions github-actions Bot temporarily deployed to pull request April 23, 2026 20:42 Inactive
@github-actions github-actions Bot temporarily deployed to pull request April 23, 2026 20:42 Inactive
cole-h
cole-h previously approved these changes Apr 23, 2026
@edolstra edolstra added this pull request to the merge queue Apr 24, 2026
@edolstra edolstra removed this pull request from the merge queue due to a manual request Apr 24, 2026
@edolstra edolstra added this pull request to the merge queue Apr 24, 2026
Use `statusOk`/`statusToString` consistently when checking child process
wait statuses, so that failures produce human-readable messages (e.g.
"exited with code 2") rather than raw integer comparisons or nothing at
all.

Also give distinct exit codes to each failure path in the
`fchmodatTryNoFollow` test for easier debugging.

Note that `status == 0` and `statusOk(status)` do not do the same thing,
because the latter does not check all the bits. So by changing the code
from the former to the latter, we are technically changing behavior.
However, it is not really proper to check the other bits, rather than
use the macros which (essentially) parse a discriminated union. The
other bits are probably guaranteed to be 0 in practice, but in theory,
they are reserved for future use, and we should not guessing that that
future use is / what the bits mean in that case.
@edolstra edolstra removed this pull request from the merge queue due to a manual request Apr 24, 2026
@github-actions github-actions Bot temporarily deployed to pull request April 24, 2026 11:46 Inactive
@github-actions github-actions Bot temporarily deployed to pull request April 24, 2026 12:37 Inactive
@edolstra edolstra added this pull request to the merge queue Apr 24, 2026
Merged via the queue into main with commit 962e041 Apr 24, 2026
30 checks passed
@edolstra edolstra deleted the sync-2.34 branch April 24, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.