Skip to content

corepkgs/nar.nix: Prefer local builds - #156

Closed
shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:nar-local-builds
Closed

shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:nar-local-builds

Conversation

@shlevy

@shlevy shlevy commented Aug 14, 2013

Copy link
Copy Markdown
Member

nar.nix's builder depends on coreutils and nix itself being in $PATH.
Unfortunately, there's no good way to ensure that these packages exist
in the same place on the remote machine: The local machine may have nix
installed in /usr, and the remote machine in /usr/local, but the
generated nar.sh builder will refer to /usr and thus fail on the remote
machine. This ensures that nar.sh is run on the same machine that
instantiates it.

nar.nix's builder depends on coreutils and nix itself being in $PATH.
Unfortunately, there's no good way to ensure that these packages exist
in the same place on the remote machine: The local machine may have nix
installed in /usr, and the remote machine in /usr/local, but the
generated nar.sh builder will refer to /usr and thus fail on the remote
machine. This ensures that nar.sh is run on the same machine that
instantiates it.

Signed-off-by: Shea Levy <[email protected]>
@edolstra

Copy link
Copy Markdown
Member

Applied!

@edolstra edolstra closed this Aug 14, 2013
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
ConnorBaker pushed a commit to ConnorBaker/nix that referenced this pull request Jul 25, 2025
…d13d4f3-4d7b-40f3-bd21-4367a87321a5

Release v3.8.4
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 25, 2026
…S#111 NixOS#76 + NixOS#229 doc-fix + NixOS#156 declined)

Sprint 1 targeted single-shard candidates that don't create
cross-shard dependencies. Five candidates evaluated; three
shipped, one already-shipped doc-fix, one declined-with-reason.

Shipped (three):

NixOS#87 (libexpr) — eager/lazy C-binding accessor pair dedup. The
six public symbols (nix_get_list_byidx{,_lazy},
nix_get_attr_byname{,_lazy}, nix_get_attr_byidx{,_lazy}) become
one-line wrappers around three file-static private impl helpers
selecting force=true or force=false. ABI unchanged.
nix_get_attr_byidx_lazy's "(Nix C API contract violation)"
error-message suffix is threaded through the impl as a parameter
rather than collapsed, preserving both error strings exactly.
libexpr commit 374e9db.

NixOS#111 (libexpr) — withRegex<Body> template helper extracting the
prim_match/prim_split regex-fetch + try/catch scaffold. The two
post-match assemblies (regex_match vs cregex_iterator) stay
inline. Helper takes a RegexCache& by reference rather than
reaching through state.regexCache directly, because that member
is private and the existing prim_match/prim_split friend
declarations cover only those two functions; the friended
primops fetch *state.regexCache and pass it through. A future
public EvalState::compileRegex accessor (alongside NixOS#169's
EvalState friend-cluster reduction) would let the explicit
cache parameter collapse and the two friend declarations go
away. Error wording, positions, and the libstdc++-state-limit
error_space arm preserved exactly. libexpr commit 4182720.

NixOS#76 (nix-cli) — walkClosure template helper deduplicating the
dotgraph/graphml BFS scaffold. New file-local
nix-store/closure-walk.hh; both consumers call walkClosure with
their own per-path and per-edge callbacks. Helper kept in
nix-store/ rather than promoted to libstore's store-api.hh per
the candidate's original sketch — that promotion would be a
cross-shard libstore change. Header-only template means no
meson.build edit. Output is byte-for-byte identical pre/post
for both formats. nix-cli commit 705114e.

Already shipped, doc-fix only:

NixOS#229 — parameterised SeenSet<T> on libexpr. Already shipped in
Batch E as commit 76b6808 ("libexpr/print: parameterise
SeenSet by element pointer type (NixOS#229)"). Branch line was
missing from the candidate body — same gap as Pass-1's six
missed Branch lines. Added.

Declined-with-reason:

NixOS#156 (libstore fan-out idiom dedup) — re-read in Sprint 1
showed the "shared" block is ~6 lines before two structurally
different doneFailure overload shapes diverge:
gaveUpOnSubstitution passes BuildError(Failure::DependencyFailed,
msg); resolveDerivation passes (ecFailed, BuildResult::Failure
struct). Extraction would be cosmetic — saves ~10 lines net but
doesn't unlock anything else. Skip-with-reason recorded; re-
evaluate when doneFailure's overloads unify or a third caller
adopts the same shape.

STATUS.md cleanup-branches table:
- libexpr tip moves to 4182720 (was 76b6808)
- nix-cli tip moves to 705114e (was 24ebbcc)
- Sprint-1 candidates appended to both row narratives
Current tip SHAs block also updated.

New "Sprint 1" recently-completed entry. Five other branches
unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
angerman added a commit to angerman/nix that referenced this pull request Aug 5, 2026
Kills hypothesis: "the 402MB Boehm is v3->TW bridge Values from FFI primop
wrappers, reducible by moving heavy crossings native."

Measure-first (firefox.drvPath):
- bridge=0 (NIX_VM_STATS): zero TW thunk-routing. Not bridge.
- GC_get_heap_size = constant ~402.9MB (appears even for 1+1, RSS 31MB) = Boehm's
  upfront mapped reservation, NOT a workload metric. Methodology trap; M1's vmmap
  402MB-resident on M5 is the real number.
- GC_get_total_bytes (cumulative): 1+1=0, firefox=452MB -> v3 churns ~431MB TW.
- Per-primop self-attribution (NIX_V3_BOEHM_ATTR, gated, now retired): store-
  boundary leaves allocate ~0 (readFile 0.0MB, pathExists 0.0MB); churn attributed
  to higher-order list primops (concatMap 228, all 96, ...) -- but those are
  v3-NATIVE (primConcatMap=allocList=arena), so that's an INCLUSIVE artifact (the
  main OP_CALL_PRIMOP path bypasses the child-accounting -> native higher-order
  primops absorb their callback subtree's Boehm).

Robust findings: NOT store/FFI boundaries (those are ~0), NOT bridge (=0); it's
~431MB transient TW churn under the package-set subtree, held resident by macOS
no-unmap (same wall as NixOS#134/NixOS#136). Change-5 premise ("move store primops native")
FALSIFIED -- store leaves don't allocate it. NixOS#156/NixOS#157 re-scoped; the precise leaf
needs a complete-attribution instrument (hook the main OP_CALL_PRIMOP path) =
follow-up. Pattern holds: Changes 1/3/5 all modest/blocked; real levers = Change 2
(HAMT) + Change 4 (JIT).

Instrument retired per Rule 0 (per-primop numbers carry the inclusive artifact).
hello.drvPath byte-id; vm.cc reverted to baseline.

lode/C5_BOEHM_RCA_2026-06-23.md.

Copyright (c) 2026 Moritz Angermann <[email protected]>, Input Output
Group. SPDX-License-Identifier: Apache-2.0
roberth added a commit to roberth/nix that referenced this pull request Aug 9, 2026
… API

Third and final commit in the Query→Selector cascade for source code
(docs come next). Renames the in-process tracking state and the
SQLite column that keys Ask/Terminal rows:

- `ActiveQuery → ActiveSelector` — writer's stack frame for a
  Selector being tracked in flight.
- `QueryHandle → SelectorHandle` — pointer / identity for a tracked
  Selector.
- `logQuery → logSelector`, `logRootQuery → logRootSelector` — writer
  entry points that push a Selector onto the tracking stack.
- `insertQuery / selectQuery → insertSelector / selectSelector` —
  SQLite prepared statements, plus their ATOM_INSERT_PLAIN /
  ATOM_GET_PLAIN macro invocations.
- `getQueryPayload → getSelectorPayload` — DG API for reading a
  Selector payload from the pool.
- Column `queryHash → selectorHash` in Ask and Terminal tables (and
  every variable/parameter named after it).

Kept: `Query<T>` / `Response<T>` / `Result<T>` message-pairing
templates; `currentQ` / "Q evolution" shorthand for the evolving
Selector hash inside a chain — bulk-renaming those to `currentS`
would just add characters without clarifying.

312/16/7 unchanged.

Docs (task NixOS#156) still use the old vocabulary; that sweep is next.

Assisted-by: Claude Code (Claude Opus 4.6-4.7)
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.

2 participants