Repository navigation
Conversation
Member
|
Having an environment variable for this, while everything else is a command line flag or an option, seems very hackish to me... Also, if a script explicitly is asking for read/write mode, it shouldn't be silently ignored if the Nix version is too old. |
This allows running nix-instantiate --eval-only without performing the evaluation in readonly mode, letting features like import from derivation and automatic substitution of builtins.storePath paths work. Signed-off-by: Shea Levy <[email protected]>
Member
Author
|
@edolstra OK, force-pushed it to use a flag instead. |
Member
|
Slight remark: this means that the order is important, right? I.e. "--no-readonly-mode --eval-only" won't work. Also, "--no-readonly-mode" seems a bit of a double negation: readonly-mode turns off write access, and no-readonly-mode turns it back on. Maybe --read-write-mode or something like would be better. |
Signed-off-by: Shea Levy <[email protected]>
Signed-off-by: Shea Levy <[email protected]>
Member
Author
|
@edolstra OK, renamed to |
Member
Author
|
@edolstra Any problems now? |
Member
|
Applied, thanks. |
zolodev
pushed a commit
to zolodev/nix
that referenced
this pull request
Jan 1, 2024
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
Filter platform-specific dependencies according to *local* info
usertam
pushed a commit
to usertam/nix
that referenced
this pull request
Sep 25, 2025
…721c61ad-d7dd-4e3b-b398-baf8388dccfb Release v3.11.2
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 24, 2026
Landed 18 commits across 6 shards covering 20 candidates: - libstore +8 (NixOS#1+NixOS#3, NixOS#7, NixOS#11, NixOS#55, NixOS#59, NixOS#101, NixOS#153, NixOS#185) - libexpr +3 covering 4 (NixOS#192, NixOS#202+NixOS#203 folded, NixOS#204) - libutil +4 (NixOS#97, NixOS#124, NixOS#167, NixOS#224) - libfetchers +1 (NixOS#53) - libflake +1 (NixOS#133, rename only — deviation documented) - libmain +1 (NixOS#223; NixOS#222 already on branch) Skipped: NixOS#76 (libc++ in dev shell lacks <generator>) and several RED-bucket items. 4-pass review chain: Pass A (parallel adversarial) caught 2 BLOCKERS — libstore NixOS#153 over-broad rename corrupted the external-builders JSON wire-key, and libutil NixOS#97 dropped the inline allowed-name list breaking eval-fail-hashString-2.err.exp. Both fixed via amend; parseEnumOrThrow extended to render 'a', 'b', or 'c' with Oxford comma + suggestions. Pass B (/code-review) found no blockers; substantive amends include libexpr's callFunction hot-path now reading a ctor-frozen profilerHooks snapshot, libstore's tryUpperFallLower returning std::pair<R, bool>, libutil completing three migration gaps. Pass C found one real clang-tidy error (parse-enum.hh missing configuration.hh include); other shards only show the 5 known pre-existing master errors. Pass D nix build -L . green on all six shards. New catalog candidates surfaced by review: NixOS#225 (libfetchers getUserRegistry/getSystemRegistry/getGlobalRegistry share NixOS#53's first-call-wins shape on the hot path), NixOS#226 (showCompressionAlgo vs printHashAlgo enum-rendering inconsistency). Catalog total: 226 + 44. 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
…xOS#203) Drops the entire cached-eval-failure path — `AttrDb::setFailed`, `AttrType::Failed`, the `failed_t` variant alternative, the `CachedEvalError` exception class, and the `try { run } catch (CachedEvalError & e) { e.force() }` outer block in `nix::main`. The cached `Failed` rows weren't load-bearing. On a cache hit, `CachedEvalError::force()` re-ran `forceValue()` on the parent cursor, producing the same diagnostic the original eval would have produced. The on-disk row was just a marker that let the second-read path skip the success-path serialize-to-cache code. Without it, every read re-evaluates failed attributes — same diagnostic, same path. ~80 lines of `failed_t`/`CachedEvalError` machinery gone; ~5 lines of type-dispatch saved on the second-read path were the only thing the marker bought. While here, fix NixOS#203's read/write asymmetry by wrapping `AttrDb::getAttr` in `doSQLite` so the read path matches every writer. Generalises `doSQLite` to deduce its return type from the lambda (`AttrId` for setters, `std::optional<...>` for the reader); on `SQLiteError` it returns the value-initialised default (`0` / `std::nullopt`) and sets the `failed` flag. A read-side `SQLiteError` no longer escapes to the caller. Bump the on-disk cache version `eval-cache-v6` -> `eval-cache-v7` so existing caches with `Failed` rows are not consulted by the new code: `getAttr`'s switch arm for `AttrType::Failed` is gone, and the `default:` arm throws `Error("unexpected type in evaluation cache")` which `doSQLite` does not catch (it only catches `SQLiteError`). The version bump is the cheapest invalidation mechanism and matches the v5->v6 precedent in rl-2.31.md. Public-API note: `eval-cache.hh` ships via `install_headers`; removing `CachedEvalError`, `failed_t`, and the `Failed` enumerator is a public-API break for external consumers (Hydra, Lix, plugins). In-tree the only external touch was `src/nix/main.cc`'s catch arm, removed here. The numeric value `5` for the former `Failed` enumerator is documented as reserved in `eval-cache.hh` so future enumerators do not silently re-use it. Refs candidates NixOS#202, NixOS#203. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ConnorBaker
added a commit
to ConnorBaker/nix
that referenced
this pull request
May 29, 2026
setPlaceholder, setMissing and setMisc were byte-identical except for the AttrType enum: each ran the same doSQLite + lock + insertAttribute with the value column stored as (0, false). Extract a private setTagged(key, type) and make the three one-line wrappers. (setFailed, the fourth tag-only setter, was already removed by NixOS#202/NixOS#203 on this branch, so the post-merge scope is exactly these three.) Refs candidate NixOS#252. Co-Authored-By: Claude Opus 4.8 (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.
This allows running nix-instantiate --eval-only without performing the
evaluation in readonly mode, letting features like import from
derivation and automatic substitution of
builtins.storePathpaths work.This is an env var for two reasons:
will be simpler to just set the env var once
without breaking backwards compatability.