Skip to content

Document dynamic attributes - #196

Closed
shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:dynamic-attrs-docs
Closed

shlevy wants to merge 1 commit into
NixOS:masterfrom
shlevy:dynamic-attrs-docs

Conversation

@shlevy

@shlevy shlevy commented Jan 22, 2014

Copy link
Copy Markdown
Member

No description provided.

@shlevy

shlevy commented Feb 4, 2014

Copy link
Copy Markdown
Member Author

@edolstra ping?

@shlevy

shlevy commented Feb 21, 2014

Copy link
Copy Markdown
Member Author

Rebased and fixed a typo

@edolstra

Copy link
Copy Markdown
Member

Applied, thanks!

@edolstra edolstra closed this Feb 26, 2014
@shlevy
shlevy deleted the dynamic-attrs-docs branch March 10, 2014 10:53
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
…ook-theme-0.1.7

chore(deps): bump sphinx-book-theme from 0.1.6 to 0.1.7
usertam pushed a commit to usertam/nix that referenced this pull request Sep 25, 2025
…ry-ignoring-dir-param

Fix flake registry ignoring `dir` parameter
ConnorBaker added a commit to ConnorBaker/nix that referenced this pull request May 23, 2026
`EvalState::lookupPathResolved` was declared as
`boost::concurrent_flat_map<std::string, ..., StringViewHash, std::equal_to<>>`,
i.e. with the heterogeneous-lookup pair that lets a `string_view` key
match a `std::string` key. Neither call site benefits from it: both
`getConcurrent(*lookupPathResolved, value)` and the subsequent
`emplace(std::string(value), res)` pass `value` as a `const std::string &`
(it is the `s` field of `LookupPath::Path`), and `getConcurrent` is
declared `(const T & map, const typename T::key_type & key)`, so the
key is always coerced to `std::string`. The custom hash/equal pair was
inert.

Drop both template arguments to fall back on the default
`std::hash<std::string>` / `std::equal_to<std::string>`. The two other
`StringViewHash` users in eval.hh (the symbol-table cache around line 843
and `PrimOpCalls`) keep theirs because they actively look up by
`string_view`.

Refs candidate NixOS#196.

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 24, 2026
`EvalState::lookupPathResolved` was declared as
`boost::concurrent_flat_map<std::string, ..., StringViewHash, std::equal_to<>>`,
i.e. with the heterogeneous-lookup pair that lets a `string_view` key
match a `std::string` key. Neither call site benefits from it: both
`getConcurrent(*lookupPathResolved, value)` and the subsequent
`emplace(std::string(value), res)` pass `value` as a `const std::string &`
(it is the `s` field of `LookupPath::Path`), and `getConcurrent` is
declared `(const T & map, const typename T::key_type & key)`, so the
key is always coerced to `std::string`. The custom hash/equal pair was
inert.

Drop both template arguments to fall back on the default
`std::hash<std::string>` / `std::equal_to<std::string>`. The two other
`StringViewHash` users in eval.hh (the symbol-table cache around line 843
and `PrimOpCalls`) keep theirs because they actively look up by
`string_view`.

Refs candidate NixOS#196.

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
Two failing tests (GetAttrTracesAccess, GetListElemTracesAccess) predate
the recursive-Selector migration (NixOS#186) + DB-facade pool (NixOS#196–NixOS#197).
Under that model, TracingObject::maybeGetAttr / getListElem require the
writer's TracingDecisionGraph to intern the parent Selector through the
pool — no graph, no emission — so the test fixture's DG-less
TracingWriter silently swallowed the query. The other tests in the file
assert on the pre-clear evalExpr entry and pass by aligning with the
zero-emission path.

Give the fixture a real DG. The natural home is in-memory sqlite so the
tests don't need temp dirs or cleanup (the pattern used in trace-types.cc
and outer-object.cc). This required teaching SQLite to route the ":memory:"
sentinel around its URI-encoding path: currently the encoder produces
`file:%3Amemory%3A?immutable=0`, which sqlite reads as a literal on-disk
filename `:memory:` rather than the in-memory sentinel. The fix detects
`:memory:` upfront, skips both the ZFS -shm probe and the URI wrapping,
and passes the plain filename with SQLITE_OPEN_URI cleared — which is
how sqlite3 identifies the sentinel.

The SQLite class change is general (any future consumer can now request
in-memory), motivated by but not exclusive to this test.

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