Skip to content

Upstream tracking - #165

Draft
grahamc wants to merge 4223 commits into
2.34-maintenancefrom
main
Draft

Upstream tracking#165
grahamc wants to merge 4223 commits into
2.34-maintenancefrom
main

Conversation

@grahamc

@grahamc grahamc commented Jul 31, 2025

Copy link
Copy Markdown
Member

Motivation

Not intended to be merged directly. This PR is a convenience to show the diff between upstream Nix and Determinate Nix (the main branch).

Continuation of #4.

@grahamc
grahamc requested a review from edolstra as a code owner July 31, 2025 17:14
@github-actions
github-actions Bot temporarily deployed to production July 31, 2025 17:14 Inactive
@DeterminateSystems DeterminateSystems locked as off-topic and limited conversation to collaborators Jul 31, 2025
@github-actions
github-actions Bot temporarily deployed to pull request July 31, 2025 18:20 Inactive
@github-actions
github-actions Bot temporarily deployed to production July 31, 2025 18:21 Inactive
@cole-h
cole-h marked this pull request as draft August 1, 2025 14:26
@github-actions
github-actions Bot temporarily deployed to pull request August 4, 2025 22:15 Inactive
@github-actions
github-actions Bot temporarily deployed to commit August 4, 2025 22:15 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 4, 2025 22:15 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 5, 2025 14:25 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 5, 2025 14:25 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 7, 2025 15:58 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 7, 2025 15:58 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 7, 2025 23:01 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 7, 2025 23:02 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 10, 2025 16:36 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 10, 2025 16:36 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 10, 2025 20:06 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 10, 2025 20:06 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 19, 2025 15:04 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 19, 2025 15:04 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 20, 2025 10:41 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 20, 2025 10:41 Inactive
@github-actions
github-actions Bot temporarily deployed to commit August 20, 2025 10:41 Inactive
@github-actions
github-actions Bot temporarily deployed to pull request August 25, 2025 16:07 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 25, 2025 16:07 Inactive
@github-actions
github-actions Bot temporarily deployed to production August 25, 2025 16:14 Inactive
edolstra and others added 30 commits August 27, 2026 17:11
nix copy: Don't register temp roots if the remote doesn't have AddTempRoots
The GC roots server's per-client thread only caught Error, but
Interrupted derives from BaseError, not Error. So when the daemon
was interrupted during garbage collection while a client thread was
blocked in readLine(), the Interrupted exception escaped the thread,
calling std::terminate() and crashing the daemon.

Fixes Sentry report DETERMINATE-NIX-31.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
cache.nixos.org compresses newer NARs with zstd instead of xz, but the
script unconditionally piped downloaded debuginfo NARs through `xz -d`.
This broke after the Nixpkgs update pulled in glibc 2.42, whose
debuginfo NAR is served as .nar.zst. Pick the decompressor based on the
archive extension, and add xz/zstd to the nix shell shebang so both are
guaranteed to be on PATH.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Move the mi_register_error() call before initLibUtil() so that
allocation failures during initialization also invoke outOfMemory()
instead of mimalloc's silent abort. Also handle EFAULT (heap
corruption detected in secure mode) by calling panic(), preserving
fatal behavior but with a proper error message.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Handle out-of-memory crashes better
getDefaultRef() guessed 'master' (with a warning) when a local repo had
a detached HEAD, e.g. a CI worktree fetched as git+file:///wt?rev=....
That branch may not even exist. libgit2 resolves 'HEAD' just fine, so
use it instead of guessing.

Co-authored-by: Gaetan Lepage <gaetan@glepage.com>
(cherry picked from commit c34d30c)
With submodules=false, getAccessorFromCommit() renders a gitlink as an
empty directory (like `git archive`), but getAccessorFromWorkdir()
omitted the path entirely. Fetching git+file:///repo and
git+file:///repo?rev=HEAD thus gave different narHashes for the same
rev, and since both share a fingerprint, one poisoned the fetchToStore
cache for the other.

This breaks nix-eval-jobs on repos with submodules: the flake is locked
from the workdir, workers re-fetch the __final input by rev and fail
with a narHash mismatch.

Enumerate submodules in the workdir from gitlinks in the index instead
of from .gitmodules (which only supplies URLs), and mount an empty
directory over each one that is not fetched, so the workdir accessor
matches the commit accessor in all cases, including gitlinks without a
.gitmodules entry.

Fixes NixOS#13698. Addresses NixOS#15423 for the workdir case. Supersedes NixOS#14779.

Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
Co-authored-by: Julian Kuners <julian.kuners@gmail.com>
Assisted-by: OpenCode (GPT-5.6 Sol)
(cherry picked from commit 52546ba)
…tenance

[Backport 2.35-maintenance] git fetcher: avoid resolving HEAD for pinned revisions
…tenance

[Backport 2.35-maintenance] libfetchers/git: render submodules as empty dirs in workdir accessor
…tenance

[Backport 2.35-maintenance] Convert stdenv.isLinux to stdenv.hostPlatform.isLinux
This was introduced by a bad merge.

Fixes #591.
Fix forwarding netrc-file to the daemon
sentry_init() spawns worker threads. When it ran before initNix() (and
thus before startSignalHandlerThread() blocks SIGINT etc. in the
calling thread), those threads inherited a signal mask with SIGINT
unblocked, so the kernel could deliver a Ctrl-C's SIGINT to one of
them. Its default disposition then killed the process immediately,
without printing "error: interrupted by the user" or restoring the
terminal cursor hidden by the progress bar.

Initializing Sentry after initNix() makes its threads inherit the
blocked mask, so SIGINT is only received by the signal handler thread
via sigwait(), as intended. The SIGQUIT reset that undoes Sentry's
crash handler for it moves along, since it must run after
sentry_init().

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Fix Ctrl-C handling when Sentry is enabled
The in-memory cached value was created with an empty context `{}` instead
of copying the actual context from the value. This caused string contexts
to be lost even though they were correctly written to the database.
When setAttrs "seals" an attrset (transitions from Placeholder to
FullAttrs), the previous INSERT OR REPLACE would delete and recreate
the row with a new rowid. This orphaned any children cached under the
old rowid, causing cache misses on subsequent builds.

This explains the "third time's a charm" behavior: on the 2nd build,
orphaned children are re-cached under the new parent rowid. With
deeper nesting, even more evaluations could be required as each level
of sealing orphans the next level's children.

Fix by using INSERT ... ON CONFLICT DO UPDATE (upsert) to preserve
the rowid, and INSERT OR IGNORE for children to preserve existing
cached values. Also delete redundant Missing entries since we now
know the complete set.

This requires SQLite >= 3.35 for the RETURNING clause, now declared
as an explicit dependency of libexpr.
Verify that evaluation caching works on the second build by checking
that builtins.trace output only appears on the first evaluation.
Eval cache: make the second evaluation hit the cache
Fixes #589.

Assisted-by: Claude Fable 5 <noreply@anthropic.com>
doc: mention that flake metadata's `Path` field is absent with lazy-trees
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.