Skip to content

Comments

libstore/store-api: Do not query all substituters for substitutable p…#14837

Merged
Ericson2314 merged 1 commit intomasterfrom
fix-query-substitutable
Dec 19, 2025
Merged

libstore/store-api: Do not query all substituters for substitutable p…#14837
Ericson2314 merged 1 commit intomasterfrom
fix-query-substitutable

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Dec 19, 2025

…ath infos

Motivation

This was broken in 11d7c80.

Context

Fixes #14836.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Dec 19, 2025
@xokdvium xokdvium added backport 2.32-maintenance Automatically creates a PR against the branch backport 2.33-maintenance Automatically creates a PR against the branch labels Dec 19, 2025
@thomasjm
Copy link
Contributor

Thanks for the quick turnaround! I'm running my tests on this now...

@thomasjm
Copy link
Contributor

Fixes my tests!

Copy link
Contributor

@philipwilk philipwilk left a comment

Choose a reason for hiding this comment

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

makes sense, didn't catch it in my pr mb

@philipwilk
Copy link
Contributor

nitty: personally would change the commit message to "libstore/store-api: do not query remaining substituters after first success"

it very much is still trying to query all of them if the previous one fails 🙂

@Ericson2314 Ericson2314 added this pull request to the merge queue Dec 19, 2025
Merged via the queue into master with commit 5cf1c0e Dec 19, 2025
23 checks passed
@Ericson2314 Ericson2314 deleted the fix-query-substitutable branch December 19, 2025 14:48
@internal-nix-ci
Copy link

@internal-nix-ci
Copy link

philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Jan 5, 2026
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues

---

Diff: NixOS/nix@2.32.4...2.32.5
philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Jan 5, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 8, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 9, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 10, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 11, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 12, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 13, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
vdemeester pushed a commit to vdemeester/nixpkgs that referenced this pull request Jan 14, 2026
# Changelog: Nix 2.32.5

## Bug Fixes

### Critical Crashes Fixed

- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

  Fixed a daemon segfault that could occur under high build load. The issue was caused by the `initialOutputs` field referencing data from an activation frame that had gone out of scope during coroutine tail-call optimization in the build scheduler.

- **Fix segfault when querying non-existent derivation files** ([NixOS#14571](NixOS/nix#14571), [NixOS#14572](NixOS/nix#14572))

  Running `nix derivation show /nix/store/...-doesnotexist.drv` would crash with a segfault. Now properly returns an "invalid store path" error.

- **Fix RestrictedStore::addDependency crash** ([NixOS#14729](NixOS/nix#14729))

  Fixed a crash caused by incorrect non-virtual interface pattern implementation that led to bad recursion/UB in `addDependencyPrep`.

### Regressions Fixed

- **Fix "dynamic attributes not allowed in let" regression** ([NixOS#14642](NixOS/nix#14642), [NixOS#14646](NixOS/nix#14646))

  Expressions like `let a = 1; "b" = 2; ${"c"} = 3; in [ a b c ]` that worked in 2.30 would incorrectly fail in 2.32.x. This was caused by the ExprString arena optimization, which has been reverted.

- **Fix fetchGit with `ref = "HEAD"` regression** ([NixOS#13948](NixOS/nix#13948), [NixOS#14672](NixOS/nix#14672))

  `fetchGit { url = "..."; ref = "HEAD"; }` was broken and returned "revspec 'HEAD' not found".

- **Fix unnecessary substituter queries** ([NixOS#14836](NixOS/nix#14836), [NixOS#14837](NixOS/nix#14837))

  Fixed a regression where Nix would query all substituters (including `cache.nixos.org`) even when a higher-priority local substituter already had the path. This caused unnecessary network traffic.

### Platform-Specific Fixes

- **Fix curl with c-ares failing DNS resolution in macOS sandbox** ([NixOS#14792](NixOS/nix#14792))

  When curl is built with c-ares (as in recent nixpkgs), DNS resolution would fail inside the Nix build sandbox on macOS with "Could not contact DNS servers".

### Store & File System Fixes

- **Fix file system race conditions in store optimization** ([NixOS#14676](NixOS/nix#14676), [NixOS#7273](NixOS/nix#7273))

  Multiple fixes to `optimizePath_`:
  - Actually call `remove()` when `rename()` fails
  - Propagate error codes in `createSymlink()`
  - Make `AutoDelete` non-copyable and non-movable to prevent use-after-free

## Improvements

- **Include path in world-writable error messages** ([NixOS#14785](NixOS/nix#14785))

  The error message for world-writable directory checks now includes the specific path that failed, making debugging easier.

- **Documentation: correct `build-dir` error information** ([NixOS#14745](NixOS/nix#14745))

  Fixed out-of-date information in the manual about `build-dir` errors and added links to relevant settings.

## Maintenance

- CI improvements: added `upload-release.yml` workflow, improved Docker push workflow configurability, updated magic-nix-cache with post-build-hook fix
- Documented maintainer git tag signing process
- Fixed lowdown override compatibility with newer nixpkgs
- Removed mdbook-linkcheck and added support for mdbook 0.5.x
- Remove static data from headers to fix compilation issues
- **Fix heap-use-after-free crash under high build load** ([NixOS#14772](NixOS/nix#14772))

---

Diff: NixOS/nix@2.32.4...2.32.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.32-maintenance Automatically creates a PR against the branch backport 2.33-maintenance Automatically creates a PR against the branch store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nix 2.32 queries cache.nixos.org even when local substituter has a path

4 participants