Upstream tracking - #165
Draft
grahamc wants to merge 4223 commits into
Draft
Conversation
nix copy: Don't register temp roots if the remote doesn't have AddTempRoots
Flake lock file updates:
• Updated input 'nixpkgs':
'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1009383%2Brev-4382ed2b7a6839d4280a9b386db49cbc5907414d/019f6c11-ad78-7500-a194-d18a5bad0fbe/source.tar.gz' (2026-07-16)
→ 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2605.1012930%2Brev-c5c4a43b0e8056328ec4529f735cabdb8f1942bb/01a053c0-7061-7382-b001-102e9148a5b5/source.tar.gz' (2026-08-29)
Flake lock file updates:
• Updated input 'nix/nixpkgs':
'https://api.flakehub.com/f/pinned/DeterminateSystems/secure-packages-26.05/0.1.1012125%2Brev-86c2aa5aa3e08175d183edb2581a7fd32c358115/01a01b96-88bb-7c70-84ca-1cbd5a037ecf/source.tar.gz' (2026-08-19)
→ 'https://api.flakehub.com/f/pinned/DeterminateSystems/secure-packages-26.05/0.1.1013487%2Brev-01649628bfcaf28024737daec63d559fe0463e6c/01a04eb4-9c90-76b3-a3fb-a92559e04618/source.tar.gz' (2026-08-29)
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>
Update Nixpkgs
Fix crash when GC is interrupted
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
(cherry picked from commit fa4f255)
…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>
Sync with upstream 2.35-maintenance
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Not intended to be merged directly. This PR is a convenience to show the diff between upstream Nix and Determinate Nix (the
mainbranch).Continuation of #4.