Repository navigation
Conversation
Member
|
Some comments:
|
Author
|
I implemented your comments. As far as the whole-worker or just-build problem goes, my original intention was to prevent users with low priority from using system resources though Nix, but I guess I didn't really take locks into account. So now Nix uses cgroups only for building. The only downside is that now it needs to have write access also to it's original cgroups, as it needs to return to them in case other action is required. |
Member
|
It won't need to restore the cgroup if you only change the cgroup in the builder's child process, i.e., in initChild() in build.cc. |
|
I marked this as stale due to inactivity. → More info |
Member
|
I think it would be better to return to this after #3600 is merged. |
Member
|
We can close this now that #3600 has been merged. |
zolodev
pushed a commit
to zolodev/nix
that referenced
this pull request
Jan 1, 2024
…opybutton-0.3.3 chore(deps): bump sphinx-copybutton from 0.3.1 to 0.3.3
ConnorBaker
pushed a commit
to ConnorBaker/nix
that referenced
this pull request
Jul 25, 2025
Apply upstream formatting changes
2 tasks done
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 23, 2026
Goal::ChildEvents previously carried three type-segregated slots:
std::queue<ChildOutput> childOutputs, std::optional<ChildEOF> childEOF,
and std::unique_ptr<TimedOut> childTimeout. The shape was structurally
over-modelled — the segregation only existed to encode pop ordering
("outputs before EOF before timeout") and a defensive "EOF can only
fire once" assertion that was wrong: a multi-fd goal (notably
buildWithHook, which watches both hook->fromHook and hook->builderOut)
can have more than one fd reach EOF for the same goal.
Replace with a single std::deque<ChildEvent> plus a bool timedOut
flag. pushChildEvent(TimedOut) clears the deque and sets the flag;
subsequent ChildOutput/ChildEOF pushes early-return so the timeout
always wins. popChildEvent preserves the pre-tip ordering invariant
("ChildOutput first, then any marker") explicitly: it scans the deque
and returns any pending output before falling back to the front-of-
deque marker. This matters because the muxable-pipe poll loop walks
each goal's fds in one iterate() call: if hook->fromHook reaches EOF
in the same poll cycle as buffered output on hook->builderOut, the
buildWithHook consumer must still observe the output before breaking
on EOF, otherwise the final batch of builder-log lines is lost.
Catalog candidate NixOS#159.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 23, 2026
…ards Adds **Branch:** lines to the 30 catalog entries that landed as commits on the four cleanup shard branches (libexpr, libstore, libutil, nix-cli) over the previous batch. Per-shard tally (commits on each branch beyond the previously-pushed tip): - libexpr (HEAD 437eea9 -> +10): NixOS#64, NixOS#66, NixOS#68, NixOS#106, NixOS#107, NixOS#109, NixOS#110, NixOS#112, NixOS#196, NixOS#199. Two of the original twelve were skipped on rule grounds: NixOS#194 (LookupPath::Elem flatten) — the candidate framing claimed the types were internal, but search-path.hh ships via install_headers, so collapsing is a public-ABI break, not a trivial flatten; NixOS#197 (one-arg findFile drop) — EvalState::lookupPath is a private member, so the candidate's "have callers pass it explicitly" prescription cannot apply. - libstore (HEAD 5f5b815 -> +12): NixOS#4, NixOS#5, NixOS#6, NixOS#14, NixOS#47, NixOS#82, NixOS#114, NixOS#115, NixOS#119, NixOS#157, NixOS#159, NixOS#165. Several departures from the literal prescription, recorded in each commit body and in the per-candidate Branch line: NixOS#14 lifted only getRemoteFSAccessor with a getLocalNarCacheDir hook (left the trivial getFSAccessor overrides per-class); NixOS#115 extracted only the prelude (lockProfile + findGenerations) since two callers use stateful reverse iteration; NixOS#119 confirmed init's setDefault is a different shape and stayed out; NixOS#159 dropped the assert(!childEOF) defensive check after walking Goal::handleEOF producers; NixOS#165 used option (b) of the prescription (a new derivation-output-fwd.hh) because option (a) would have introduced an include cycle. - libutil (HEAD 784a4f4 -> +3): NixOS#29, NixOS#99, NixOS#117. NixOS#29's commit body caveat (XDG_*_HOME / XDG_CONFIG_DIRS reads moved from per-call to cached) is recorded on the candidate Branch line. - nix-cli (HEAD 48524e0 -> +5): NixOS#24, NixOS#77, NixOS#89, NixOS#91, NixOS#187. NixOS#91 shipped the GcRootNamer + nameForCurrent consolidation but deferred the candidate's addPermRootWithCounter free helper because three behavioural differences across call sites (rootNr increment position, absPath timing, printGCWarning conditions on store2 null) would have either changed user-visible path naming or grown the API. STATUS.md's cleanup-branches table is updated with each shard's expanded Addresses list, and the Status column now distinguishes the already-pushed tips (libfetchers/libflake/libmain remain Pushed since they got no new commits) from the four shards whose new commits are local-only. Push policy is explicit-only — none of the four shard branches has been pushed past its prior tip. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 23, 2026
Three deep-dive adversarial reviews of the post-cleanup state surfaced work that wasn't reflected in the catalog: - **Wire-format review** found a public-API break in NixOS#6 (the GET_PROTOCOL_MAJOR/MINOR macros lived in install_headers-shipped headers; their deletion is observed by external consumers like Hydra/Lix/plugins). The candidate's Branch line now documents this as a deliberate API break and gives a migration recipe via WorkerProto::Version::Number::fromWire, including the subtle semantic shift (the old macro returned the high byte unshifted). The deletion-commit body in cleanup/libstore is amended to match. - **Traceability audit** found that the macro→template follow-up commit on cleanup/libstore had no candidate reference in its body and neither NixOS#4 nor NixOS#5 mentioned the follow-up in their Branch line. Both now describe the two-stage evolution (initial macro consolidation, then full replacement with the LengthPrefixedProtoHelper template constrained on LengthPrefixContainer). Pattern matches the NixOS#6 hoist-then-delete and NixOS#110 extended-to-forceValueDeep annotations. - **Bare libstore Branch lines** in NixOS#47 (DerivationGoal/ DerivationBuildingGoal done* dedupe), NixOS#82 (tryAcquireSlotLock with the FdLock-bypass rationale), NixOS#114 (file-static getAttr<T> template) gain descriptive parentheticals matching the libexpr/libutil/nix-cli style. STATUS.md `vibe-coding/cleanup/libstore` row's Addresses column gains two annotations (`NixOS#4 (extended to template form)`, `NixOS#5 (extended to template form)`) plus the existing `NixOS#6 (hoist-then-delete)` framing, so future readers can map row entries to commit ranges without having to walk git history. The libstore commit body for `1812c99a3` (macro→template) is amended in a parallel rebase on cleanup/libstore to add `Refs candidates NixOS#4 and NixOS#5`. The deletion commit `9f2478416` is amended to include the public-API break documentation. The NixOS#159 ChildEvents collapse commit (`ead54c3c7`) is amended to add a `childEventsHighWatermark = 16` runtime assert in pushChildEvent, converting the structural fd-count bound documented in popChildEvent's comment into a check that catches future Goal subclasses with many fds. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 24, 2026
Six edits to candidate bodies / Branch lines: - NixOS#159: deque/find_if + high-watermark assertion (not queue/FIFO) - NixOS#226: scope expanded from 3 renderers to 5 (file-content-address pair) - NixOS#148: name commit efd3e26 directly instead of "primary commit message" - NixOS#128: "soft style issue" → accepted-bundling history note - NixOS#225: helper for the latent-bug fix belongs in libutil - NixOS#89: prefetch.cc was actually converted; NixOS#95 scope shrinks No code change; doc-branch only. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 24, 2026
Goal::ChildEvents previously carried three type-segregated slots:
std::queue<ChildOutput> childOutputs, std::optional<ChildEOF> childEOF,
and std::unique_ptr<TimedOut> childTimeout. The shape was structurally
over-modelled — the segregation only existed to encode pop ordering
("outputs before EOF before timeout") and a defensive "EOF can only
fire once" assertion that was wrong: a multi-fd goal (notably
buildWithHook, which watches both hook->fromHook and hook->builderOut)
can have more than one fd reach EOF for the same goal.
Replace with a single std::deque<ChildEvent> plus a bool timedOut
flag. pushChildEvent(TimedOut) clears the deque and sets the flag;
subsequent ChildOutput/ChildEOF pushes early-return so the timeout
always wins. popChildEvent preserves the pre-tip ordering invariant
("ChildOutput first, then any marker") explicitly: it scans the deque
and returns any pending output before falling back to the front-of-
deque marker. This matters because the muxable-pipe poll loop walks
each goal's fds in one iterate() call: if hook->fromHook reaches EOF
in the same poll cycle as buffered output on hook->builderOut, the
buildWithHook consumer must still observe the output before breaking
on EOF, otherwise the final batch of builder-log lines is lost.
Catalog candidate NixOS#159.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 25, 2026
Goal::ChildEvents previously carried three type-segregated slots:
std::queue<ChildOutput> childOutputs, std::optional<ChildEOF> childEOF,
and std::unique_ptr<TimedOut> childTimeout. The shape was structurally
over-modelled — the segregation only existed to encode pop ordering
("outputs before EOF before timeout") and a defensive "EOF can only
fire once" assertion that was wrong: a multi-fd goal (notably
buildWithHook, which watches both hook->fromHook and hook->builderOut)
can have more than one fd reach EOF for the same goal.
Replace with a single std::deque<ChildEvent> plus a bool timedOut
flag. pushChildEvent(TimedOut) clears the deque and sets the flag;
subsequent ChildOutput/ChildEOF pushes early-return so the timeout
always wins. popChildEvent preserves the pre-tip ordering invariant
("ChildOutput first, then any marker") explicitly: it scans the deque
and returns any pending output before falling back to the front-of-
deque marker. This matters because the muxable-pipe poll loop walks
each goal's fds in one iterate() call: if hook->fromHook reaches EOF
in the same poll cycle as buffered output on hook->builderOut, the
buildWithHook consumer must still observe the output before breaking
on EOF, otherwise the final batch of builder-log lines is lost.
Catalog candidate NixOS#159.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add support for (optionally) running nix-daemon actions in cgroups of calling process. Supported only if daemon can access given cgroups.