Skip to content

Build fixes - #211

Closed
shlevy wants to merge 2 commits into
NixOS:masterfrom
shlevy:build-fixes
Closed

shlevy wants to merge 2 commits into
NixOS:masterfrom
shlevy:build-fixes

Conversation

@shlevy

@shlevy shlevy commented Feb 15, 2014

Copy link
Copy Markdown
Member

No description provided.

@edolstra

Copy link
Copy Markdown
Member

This rule is incorrect, since it suggests that parser-tab.hh is generated by flex...

@shlevy

shlevy commented Feb 15, 2014

Copy link
Copy Markdown
Member Author

Hm? It's on the right of the colon...

@shlevy

shlevy commented Feb 15, 2014

Copy link
Copy Markdown
Member Author

Anyway, without this compiling from a clean git checkout using dev-shell and non-parallel make fails.

@edolstra

Copy link
Copy Markdown
Member

This rule says that "lexer-tab.cc" depends on "parser-tab.hh", which is not the case. What you probably want is a rule that makes "lexer-tab.o" depend on "parser-tab.hh".

@shlevy

shlevy commented Feb 18, 2014

Copy link
Copy Markdown
Member Author

Ah of course you're right. Fixed.

@edolstra

Copy link
Copy Markdown
Member

Applied.

@edolstra edolstra closed this Feb 18, 2014
@shlevy
shlevy deleted the build-fixes branch February 18, 2014 17:41
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
P-E-Meunier pushed a commit to P-E-Meunier/nix that referenced this pull request Feb 26, 2025
CertainLach pushed a commit to deltarocks/nix that referenced this pull request Oct 14, 2025
…feat/expose-logfmt

C API: add log format and verbosity functions
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 22, 2026
Folds the findings from E1-E8, F1-F3, B1-B3, C1, and V1-V5 into the
candidate sections as in-place body edits. Each affected candidate now
carries a See also: line pointing at the verifying report(s); counts
are re-derived where the V-pass produced a verified number; mechanism
corrections from source-level investigations replace inherited framing.

Substantive corrections to existing candidates:

- NixOS#134 / NixOS#135 / NixOS#138 (15-globals-settings.md):
  - B1 found that the catalog's "NixOS#136 keystone for NixOS#134/NixOS#135/NixOS#137/
    NixOS#144/NixOS#149" chain is wrong about NixOS#135. The body's keystone block
    now lists only NixOS#134/NixOS#137/NixOS#144/NixOS#149 as NixOS#136-blocked; NixOS#135 is
    independent. The reasoning is preserved in NixOS#134's and NixOS#135's
    bodies (asymmetry between virtual-base diamond and inline-member
    flattening).
  - V1 found that 5 of 6 C-API libraries install_headers with their
    *_internal.h(h) files, exposing layout to C++ consumers. The NixOS#138
    body now spells out the C++ ABI caveat for deleting the dead
    nix::ref<bool> readOnlyMode field, with a release-note requirement.
  - F1+V3 confirmed (via end-to-end source trace) a latent UAF in the
    _new-without-_load path: the heap bool is destroyed by
    nix_eval_state_builder_free while the resulting EvalState still
    holds a bool * to it. NixOS#138's body now folds the UAF repair into
    the readOnlyMode -> Store migration, so deleting the dangling
    field sweeps the bug away in the same change.

- NixOS#65 / NixOS#211 (08-duplicated-parsers.md, 21-eval-core-evalstate-value.md):
  - B2 verified by source reading that NixOS#65 has 79 canonical-template
    sites plus ~135 bespoke. NixOS#211 has 7 structurally-shared bodies,
    not 10 and not 16: forceAttrs/forceList use withTrace (a different
    shape) and forceString(NixStringContext &, ...) / forceStringNoCtx
    delegate to the single-overload forceString. The catalog's proposed
    merge of NixOS#65+NixOS#211 was rejected on different-risk-profile and
    different-consumer-scope grounds. NixOS#211 first (~1 week, internal);
    NixOS#65 second (~4-6 weeks, user-visible trace migration).

- NixOS#213 (21-eval-core-evalstate-value.md):
  - E8+V4 recommend Direction A on four non-perf grounds. V4 downgraded
    the unsupported "negligible perf benefit" framing and surfaced a
    critical observation: ExprOpEq::eval evaluates into stack-local
    Value v1/v2 and ExprVar::eval ends with v = *v2; — the highest-
    frequency eqValues caller cannot benefit from canonical pointer-
    equality regardless of direction.

- NixOS#18 (03-repeated-boilerplate.md):
  - B3 verified the hand-written CloneableError derivation count is 17
    (catalog said 14). 18a (the MakeError macro itself) is not a real
    refactor target because MakeError already is CRTP sugar. 18b is
    per-class because most carry intrinsic payload. 18c is too small
    for top-level status. Body now documents the SQLiteBusy/SQLiteError
    cross-link and the BadNixStringContextElem/GitError err.msg-
    mutation fragility.

- NixOS#166 (17-cross-cutting.md):
  - E7 verified per-file unique-header counts: 8 Source, 5 Sink, 20
    Store, 12 EvalState, 7 Value, 6 StorePath, 10 StoreDirConfig.
    Recommendation: ship serialise-fwd.hh AND store-fwd.hh AND
    eval-fwd.hh together. Self-forward-decl caveat: don't replace the
    inline self-decls in store-api.hh and eval.hh. Zero C-API impact.

- NixOS#125 (14-vestigial-stdlib.md):
  - E4+V2+F2 verified the wire-crossing scope. Daemon does NOT link
    libexpr; libexpr's 107 throws are local-only. Wire-crossing
    surface is libstore (199 throws, 71 positional %N%, 51 reachable)
    plus libutil (281 all-format, 50 positional, 45 reachable). V2
    found 5 categories of sites E4's grep missed including the
    load-bearing store-api.hh::Store::requireStoreObjectAccessor.
    F2 found a second wire-crossing text-grep contract: "is not valid"
    in BasicClientConnection::queryPathInfo. Phasing constraint:
    text-grep contracts span both %s and %1% sites; Phase 2 cannot
    batch positional and non-positional separately for any
    contract-bearing site.

- NixOS#128 (14-vestigial-stdlib.md):
  - Note added per CLAUDE.md: the landed cleanup/libmain-shared branch
    bundled this with the unrelated blockInt deletion (NixOS#49). Soft
    style issue; recorded for future cleanup-branch authors.

- NixOS#140 (15-globals-settings.md):
  - E1's verification cleared the deletion path. nm -m on the built
    dylib confirms internal linkage; lix already deleted it; commit
    50912d0 (2022-03-31) intended full removal but missed the
    namespace-scope definition.

- N41 (24-test-infrastructure-mirrors.md):
  - V5 verified each fixture body. 28 declaring fixture classes
    (E6's "22" was an undercount). 19 fit cleanly with subdir-only
    ctor; 27 of 28 fit with (subdir, suffix) ctor pair. One structural
    hazard: CaDerivationAdvancedAttrsTest reassigns unitTestData in
    SetUp() and is linked to DerivationAdvancedAttrsTest via
    TYPED_TEST_SUITE — needs common abstract base.

New candidate NixOS#218 (12-libutil-libstore-core-extras.md):
  - The Hash::dummy / StorePath::dummy sentinels are overloaded as
    both "uninitialised placeholder" and "wire-marker for missing".
    Independent grep identified 16 sites in three classes:
    placeholder-then-overwrite (6, including two FIXME-tagged sites
    in nar-info.cc), wire-marker (3 in worker-protocol.cc,
    serve-protocol.cc, legacy-ssh-store.cc), and test-fixture (3 +
    one legitimate constant). The right factoring is std::optional<Hash>
    / std::optional<StorePath> for the placeholder sites and a
    separately-named sentinel for the wire-marker sites.

Resumption documentation:

- INVENTORY.md was missing pointers to STATUS.md, AGENT-CHARTER.md,
  and review/00-INDEX.md. Added a paragraph after the "Consolidated
  duplication and refactoring candidates" section documenting all
  three plus the five-step read-first ordering for resumption.
- INVENTORY.md updated: 217 per-shard candidates -> 218 (with NixOS#218
  added during integration).

- STATUS.md cleaned up: dropped the 13 stale "Integration"
  sub-bullets (those tasks are now in candidate bodies), collapsed
  the duplicate "E1 implementation" entries, fixed the vague
  "completed in commit ahead of HEAD~0" line, added "E3
  implementation" and "E5 verifiable-counts manifest" to the queue.
  "Recently completed" annotated to note the post-integration count
  is 218 + 44.

- review/00-INDEX.md updated with an integration-status note above
  the "How a new agent should pick a report to read" section.

Self-check against AGENT-CHARTER.md eight rules:
1. Call graphs walked: V3's UAF chain through ~ProgressBar /
   ~InterruptCallbackImpl was already in V3's report; B1's
   addSetting(this) analysis already in B1's report.
2. Shipping artefacts traced: V1's install_headers finding cited in
   NixOS#134 and NixOS#138 bodies.
3. Counts cited their source: re-derived for the dummy pattern
   (16 sites) and CloneableError derivations (17); took V-counts
   where verified (V2's 71/281, V5's 28/19/27/1).
4. Predictions labelled: N41's V5-verified replaces E6's prediction.
5. Inherited claims re-derived: B3 said 22 hand-written
   CloneableError; my grep produced 17; used 17.
6. Same-shape walked individually: the dummy pattern split into 3
   classes (placeholder vs wire-marker vs test) rather than C1's
   single shape.
7. No invented numbers: V4's downgrade applied to NixOS#213.
8. Comments verified vs code: NixOS#213's "not a singleton" comment
   treated as hypothesis the consumers contradict.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
roberth added a commit to roberth/nix that referenced this pull request Aug 9, 2026
Introduce a HashFor<Phantom> template alias in trace-ids.hh, sugar
over the existing StrongId<Phantom, Hash>. Distinct Phantom types
produce distinct HashFor types that can't cross-assign — the pattern
the user proposed to keep type safety without hand-rolled single-field
wrapper structs per hash kind.

Migrate SelectorHandle: was `struct SelectorHandle { Hash selectorHash; };`,
now `struct SelectorPhantom {}; using SelectorHandle = HashFor<SelectorPhantom>;`.
Field access `.selectorHash` → `.raw` (StrongId's convention).

StrongId itself picked up a minor tightening in the process: dropped
the value-init `T raw{};` (which required T to have a zero-arg
default ctor — Hash doesn't) and the defaulted `StrongId() = default;`.
Callers were never default-constructing these wrappers, so requiring
an explicit value at construction just enforces what was already true.

The pattern is now available for QueryHash / RequestHash / ResultHash /
SetHash if we ever want distinct types for those; that's a larger
migration, tracked separately.

Suite unchanged (325/3/7).

Assisted-by: Claude Code (Claude Opus 4.6-4.7)
roberth added a commit to roberth/nix that referenced this pull request Aug 9, 2026
- dispatchOuterQuery(SelectorGetAttr): membership was projected true
  by OO::maybeGetAttr before dispatch; missing child at dispatch is
  a projection/retrieval contradiction, not a user-facing error.
- dispatchOuterQuery(SelectorExpr): SelectorExpr is a root Selector
  for evalExpr — never routed through outer probes.
- dispatchOuterQuery(SelectorImport): same for evalFile.

Left as-is:
- `outer apply requires outerState` — all production callers of
  makeOuterResolver pass a real state, but the parameter's
  nullability is part of the API surface. Deferred pending API
  tightening.
- `try/catch (...)` swallow around Hash::parseNonSRIUnprefixed of
  fnStateHashHex — falls back to fnProducer on parse failure.
  Deferred pending NixOS#211's phantom-typed Hash migration replacing
  the stringly-typed hex.
- BridgedThunkCache::getOrCreate `if (!v)` — legitimate lazy cache.
- ReplayCallbackArg dynamic_cast branch in ExprFromObject::eval —
  legitimate polymorphic dispatch.
- ExprFromObjectAttr::eval `!childObj` state.error<TypeError> —
  user-facing "attribute missing" error surface.

Suite 339/0/7.

Assisted-by: Claude Code (Claude Opus 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