aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-19Remove references from fixed output derivation ab syntaxJohn Ericson
In other words, use a plain `ContentAddress` not `ContentAddressWithReferences` for `DerivationOutput::CAFixed`. Supporting fixed output derivations with (fixed) references would be a cool feature, but it is out of scope at this moment.
2023-04-19Add a few more content addressing methodsJohn Ericson
Good to round out the library interface.
2023-04-19Gate `dynamic-derivations` with drv `fromJSON` tooJohn Ericson
Don't want `nix derivation add` to be a way to sneak by experimental feature checks!
2023-04-19Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-19Merge pull request #8233 from wentasah/narinfo-corrupt-reasonThéophane Hufschmitt
Make "NAR info file is corrupt" messages more informative
2023-04-18Merge pull request #8220 from accelbread/whitelist-commit-lockfile-summaryRobert Hensing
Add commit-lockfile-summary to flake nixConfig whitelist
2023-04-18src/nix/flake.md: Itemize safe nixConfigsRobert Hensing
2023-04-18Merge pull request #8231 from obsidiansystems/add-derivation-xp-gatesRobert Hensing
Gate experimental features in `DerivationOutput::fromJSON`
2023-04-18Make "NAR info file is corrupt" messages more informativeMichal Sojka
Recently, I encountered the "NAR info file 'xxxx' is corrupt" error with my binary cache. The message is not helpful in determining, which kind of corruption happened. The file, fetched with curl, looked reasonably. This commit adds more information to the error message, which should allow debugging and hopefully fixing the problem.
2023-04-18Merge pull request #8236 from theutz/masterValentin Gagarin
Update installing-binary.md
2023-04-18Update installing-binary.mdMichael Utz
2023-04-18Merge pull request #8235 from peeley/fix-nix-database-glossary-typoValentin Gagarin
Documentation: fix typo for `Nix database` link in manual
2023-04-17Documentation: fix typo for `Nix database` link in manualNoah Snelson
Fixes broken link for `Nix database` anchor in the Glossary page of the Nix manual.
2023-04-17`TextHashMethod` -> `TextIngestionMethod`, gate with XP featureJohn Ericson
I suppose we can use `dynamic-derivations` for the few things we neeed.
2023-04-17Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-17Gate experimental features in `DerivationOutput::fromJSON`John Ericson
This is an entry point for outside data, so we need to check enabled experimental features here.
2023-04-17Merge pull request #8230 from obsidiansystems/daemon-trust-overrideRobert Hensing
Experimentally allow forcing `nix-daemon` trust; use this to test
2023-04-17Merge pull request #8194 from obsidiansystems/redisplay-feature-gated-settingsRobert Hensing
Fix some issues with experimental config settings
2023-04-17Experimentally allow forcing `nix-daemon` trust; use this to testJohn Ericson
We finally test the status quo of remote build trust in a number of ways. We create a new experimental feature on `nix-daemon` to do so. PR #3921, which improves the situation with trustless remote building, will build upon these changes. This code / tests was pull out of there to make this, so everything is easier to review, and in particular we test before and after so the new behavior in that PR is readily apparent from the testsuite diff alone.
2023-04-17Fix some issues with experimental config settingsJohn Ericson
Issues: 1. Features gated on disabled experimental settings should warn and be ignored, not silently succeed. 2. Experimental settings in the same config "batch" (file or env var) as the enabling of the experimental feature should work. 3. For (2), the order should not matter. These are analogous to the issues @roberth caught with my changes for arg handling, but they are instead for config handling. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-17Merge pull request #6312 from obsidiansystems/keyed-build-resultRobert Hensing
Shuffle `BuildResult` data definition, make state machine clearer, introduce `SingleDrvOutputs`
2023-04-17Fix `DerivationOutput::fromJSON`John Ericson
2023-04-17Merge pull request #7514 from fricklerhandwerk/opt-IValentin Gagarin
remove incorrect reference to `NIX_PATH` documentation
2023-04-17Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-17Merge pull request #3746 from obsidiansystems/path-infoRobert Hensing
Introduce `StoreReferences` and `ContentAddressWithReferences`
2023-04-17Explain various `.self = false,`John Ericson
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-17use @docroot@ linkValentin Gagarin
2023-04-17add link to `nix-conf` settingValentin Gagarin
Co-authored-by: John Ericson <git@JohnEricson.me>
2023-04-17Merge pull request #7732 from hercules-ci/make-initLibStore-viable-alternativeJohn Ericson
Make `initLibStore` a viable alternative
2023-04-17Merge pull request #8193 from hercules-ci/dry-stringsRobert Hensing
Deduplicate string literal rendering, fix 4909
2023-04-17Merge pull request #8196 from obsidiansystems/fix-8162Robert Hensing
Mark experimental configuration settings programmatically
2023-04-16Mark experimental configuration settings programmaticallyJohn Ericson
Fix #8162 The test is changed to compare `nlohmann::json` values, not strings of dumped JSON, which allows us to format things more nicely.
2023-04-16Add `optionalString` to manual Nix lang utilitiesJohn Ericson
Use it everywhere it could be also.
2023-04-16libexpr: Move identifier-like printing to print.ccRobert Hensing
2023-04-16libexpr/value/print.* -> libexpr/print.*Robert Hensing
Generalizes the file to sensibly allow printing any part of the language syntax.
2023-04-16printLiteral: Do not overloadRobert Hensing
2023-04-15FormatRobert Hensing
Co-authored-by: Eelco Dolstra <edolstra@gmail.com> Co-authored-by: John Ericson <git@JohnEricson.me>
2023-04-15Introduce `SingleDrvOutputs`John Ericson
In many cases we are dealing with a collection of realisations, they are all outputs of the same derivation. In that case, we don't need "derivation hashes modulos" to be part of our map key, because the output names alone will be unique. Those hashes are still part of the realisation proper, so we aren't loosing any information, we're just "normalizing our schema" by narrowing the "primary key". Besides making our data model a bit "tighter" this allows us to avoid a double `for` loop in `DerivationGoal::waiteeDone`. The inner `for` loop was previously just to select the output we cared about without knowing its hash. Now we can just select the output by name directly. Note that neither protocol is changed as part of this: we are still transferring `DrvOutputs` over the wire for `BuildResult`s. I would only consider revising this once #6223 is merged, and we can mention protocol versions inside factored-out serialization logic. Until then it is better not change anything because it would come a the cost of code reuse.
2023-04-15Make restarting state machines explicitJohn Ericson
If my memory is correct, @edolstra objected to modifying `wantedOutputs` upon falling back to doing a build (as we did before), because we should only modify it in response to new requests --- *actual* wants --- and not because we are "incidentally" building all the outptus beyond what may have been requested. That's a fair point, and the alternative is to replace the boolean soup with proper enums: Instead of modifying `wantedOuputs` som more, we'll modify `needsRestart` to indicate we are passed the need.
2023-04-15Make `KeyedBuildResult`, `BuildResult` like before, and fix bug another wayJohn Ericson
In https://github.com/NixOS/nix/pull/6311#discussion_r834863823, I realized since derivation goals' wanted outputs can "grow" due to overlapping dependencies (See `DerivationGoal::addWantedOutputs`, called by `Worker::makeDerivationGoalCommon`), the previous bug fix had an unfortunate side effect of causing more pointless rebuilds. In paticular, we have this situation: 1. Goal made from `DerivedPath::Built { foo, {a} }`. 2. Goal gives on on substituting, starts building. 3. Goal made from `DerivedPath::Built { foo, {b} }`, in fact is just modified original goal. 4. Though the goal had gotten as far as building, so all outputs were going to be produced, `addWantedOutputs` no longer knows that and so the goal is flagged to be restarted. This might sound far-fetched with input-addressed drvs, where we usually basically have all our goals "planned out" before we start doing anything, but with CA derivation goals and especially RFC 92, where *drv resolution* means goals are created after some building is completed, it is more likely to happen. So the first thing to do was restore the clearing of `wantedOutputs` we used to do, and then filter the outputs in `buildPathsWithResults` to only get the ones we care about. But fix also has its own side effect in that the `DerivedPath` in the `BuildResult` in `DerivationGoal` cannot be trusted; it is merely the *first* `DerivedPath` for which this goal was originally created. To remedy this, I made `BuildResult` be like it was before, and instead made `KeyedBuildResult` be a subclass wit the path. Only `buildPathsWithResults` returns `KeyedBuildResult`s, everything else just becomes like it was before, where the "key" is unambiguous from context. I think separating the "primary key" field(s) from the other fields is good practical in general anyways. (I would like to do the same thing for `ValidPathInfo`.) Among other things, it allows constructions like `std::map<Key, ThingWithKey>` where doesn't contain duplicate keys and just precludes the possibility of those duplicate keys being out of sync. We might leverage the above someday to overload `buildPathsWithResults` to take a *set* of return a *map* per the above. ----- Unfortunately, we need to avoid C++20 strictness on designated initializers. (BTW https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2287r1.html this offers some new syntax for this use-case. Hopefully this will be adopted and we can eventually use it.) No having that yet, maybe it would be better to not make `KeyedBuildResult` a subclass to just avoid this. Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-15Introduce `Worker::makeGoal`John Ericson
This takes a `DerivedPath` so the caller doesn't need to care about which sort of goal does what.
2023-04-15Merge pull request #8214 from raphaelr/installable-derived-path-warnRobert Hensing
Display valid installable in `InstallableDerivedPath::parse` warning
2023-04-14Legacy vs non-legacy `to_string`/`parse` for `DerivedPath`John Ericson
As requested by @roberth, it is good to call out the specific instances we care about, which is `!` for the RPC protocols, and `^` for humans. This doesn't take advantage of parametricity as much, but since the human and computer interfaces are good to decouple anyways (we don't care if they drift further apart over time in the slightest) some separation and slight duplication is fine. Also, unit test both round trips.
2023-04-14Whitelist commit-lockfile-summary in flake nixConfigArchit Gupta
2023-04-14Merge pull request #7864 from obsidiansystems/quickstart-long-optionsJohn Ericson
Use long options instead of short ones in the "quick start"
2023-04-14Merge pull request #8174 from NixOS/gloss-xp-features-note-installablesJohn Ericson
Start cross-referencing experimental features
2023-04-14Merge pull request #8217 from ↵Robert Hensing
obsidiansystems/push-get-fs-accessor-unsupported-down Push `getFSAccessor` `unsupported(...)` down `Store` class hierarchy
2023-04-14Start cross-referencing experimental featuresJohn Ericson
- Create a glossary entry for experimental features. - Have the man page experimental feature notice link `nix-commmand`. (Eventually this should be programmed, based on whether the command is experimental, and if so what experimental feature does it depend on.) - Document which installables depend on which experimental features. I tried to use the same style (bold warning and block quote) that the top of the man page uses. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-04-14Merge pull request #8199 from tweag/fix-sqlite-busy-reportingEelco Dolstra
Fix unnecessary reporting of SQLite busy errors
2023-04-14Merge pull request #8176 from tweag/rename-confusing-write-methodEelco Dolstra
Rename and protect `BufferedSink::write`