aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
AgeCommit message (Collapse)Author
2020-09-16Correctly call all the parent contructors of the storesregnat
Using virtual inheritance means that only the default constructors of the parent classes will be called, which isn't what we want
2020-09-16Separate store configs from the implemsregnat
Rework the `Store` hierarchy so that there's now one hierarchy for the store configs and one for the implementations (where each implementation extends the corresponding config). So a class hierarchy like ``` StoreConfig-------->Store | | v v SubStoreConfig----->SubStore | | v v SubSubStoreConfig-->SubSubStore ``` (with virtual inheritance to prevent DDD). The advantage of this architecture is that we can now introspect the configuration of a store without having to instantiate the store itself
2020-09-16fixup! Separate the instantiation and initialisation of the storesregnat
2020-09-16Complete the `toJSON` instance for `Setting<T>`regnat
Don't let it just contain the value, but also the other fields of the setting (description, aliases, etc..)
2020-09-16Separate the instantiation and initialisation of the storesregnat
Add a new `init()` method to the `Store` class that is supposed to handle all the effectful initialisation needed to set-up the store. The constructor should remain side-effect free and just initialize the c++ data structure. The goal behind that is that we can create “dummy” instances of each store to query static properties about it (the parameters it accepts for example)
2020-09-16Fix the registration of storesregnat
2020-09-16Make the store plugins more introspectableregnat
Directly register the store classes rather than a function to build an instance of them. This gives the possibility to introspect static members of the class or choose different ways of instantiating them.
2020-09-15Rename `Derivation::pathOpt` to `Derivation::path`John Ericson
We no longer need the `*Opt` to disambiguate.
2020-09-15Get rid of confusing `std::optional<bool>` for validityJohn Ericson
2020-09-15Don't link deriver until after any delayed exception is thrownJohn Ericson
Otherwise, we will associate fixed-output derivations with outputs that they did indeed produce, but which had the wrong hash. That's no good.
2020-09-15Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-09-15Merge remote-tracking branch 'upstream/master' into ↵John Ericson
remove-storetype-delegate-regStore
2020-09-15gracefully handle old daemon versionsregnat
Add a fallback path in `queryPartialDerivationOutputMap` for daemons that don't support it. Also upstreams a couple methods from `SSHStore` to `RemoteStore` as this is needed to handle the fallback path.
2020-09-14nix-daemon: Lower verbosity of restricted setting warningEelco Dolstra
Fixes #3992.
2020-09-13Fix unspecified behaviour in readStorePathCAMapaszlig
When deploying a Hydra instance with current Nix master, most builds would not run because of errors like this: queue monitor: error: --- Error --- hydra-queue-runner error: --- UsageError --- nix-daemon not a content address because it is not in the form '<prefix>:<rest>': /nix/store/...-somedrv The last error message is from parseContentAddress, which expects a colon-separated string, however what we got here is a store path. Looking at the worker protocol, the following message sent to the Nix daemon caused the error above: 0x1E -> wopQuerySubstitutablePathInfos 0x01 -> Number of paths 0x16 -> Length of string "/nix/store/...-somedrv" 0x00 -> Length of string "" Looking at writeStorePathCAMap, the store path is indeed the first field that's transmitted. However, readStorePathCAMap expects it to be the *second* field *on my machine*, since expression evaluation order is a classic form of unspecified behaviour[1] in C++. This has been introduced in https://github.com/NixOS/nix/pull/3689, specifically in commit 66a62b3189c8c9b0965850e6b3c9b0fda0b50fd8. [1]: https://en.wikipedia.org/wiki/Unspecified_behavior#Order_of_evaluation_of_subexpressions Signed-off-by: aszlig <aszlig@nix.build>
2020-09-04Fix querying outputs for CA derivations some moreJohn Ericson
If we resolve using the known path of a derivation whose output we didn't have, we previously blew up. Now we just fail gracefully, returning the map of all outputs unknown.
2020-09-04Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ↵John Ericson
ca-floating-upstream
2020-09-04Fix some of the issues raised by @edolstraJohn Ericson
- More and better comments - The easier renames
2020-09-04Apply suggestions from code review John Ericson
Thanks! Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2020-09-04Don't chmod symlink before moving outputs aroundJohn Ericson
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
2020-09-04Fix floating CA testsJohn Ericson
We will sometimes try to query the outputs of derivations we can't resolve. That's fine; it just means we don't know what those outputs are yet.
2020-09-03Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ↵John Ericson
ca-floating-upstream
2020-09-03Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-09-03Remove gc-check-reachabilityEelco Dolstra
2020-09-03addPermRoot(): Remove indirect flagEelco Dolstra
2020-09-03createGeneration(): Always create an indirect rootEelco Dolstra
This means profiles outside of /nix/var/nix/profiles don't get garbage-collected. It also means we don't need to scan /nix/var/nix/profiles for GC roots anymore, except for compatibility with previously existing generations.
2020-09-03createGeneration(): Take a StorePathEelco Dolstra
2020-09-01Allow HTTP binary cache to request absolute urisDomen Kožar
2020-09-01Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-31Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-08-28Merge branch 'ca-floating-upstream' of github.com:obsidiansystems/nix into ↵John Ericson
ca-floating-upstream
2020-08-28Update src/libstore/build.cc John Ericson
Thanks for catching, @regnat.
2020-08-28Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ↵John Ericson
ca-floating-upstream
2020-08-28Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-27Merge pull request #3434 from Ericson2314/derivation-header-include-orderEelco Dolstra
Revise division of labor in deserialization of derivations
2020-08-27RemoteStore::addToStore(): Fix race between stderrThread and NAR writerEelco Dolstra
As pointed out by @B4dM4n, the call to to.flush() on stderrThread is unsafe because the NAR writer thread is also writing to 'to'. Fixes #3943.
2020-08-25Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-08-24CA derivations that depend on other CA derivationsJohn Ericson
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
2020-08-24Add constructor for BasicDerivation -> DerivationJohn Ericson
2020-08-24Fix bad debug format stringJohn Ericson
2020-08-24Add DummyStore (dummy://)Eelco Dolstra
DummyStore does not allow building or adding paths. This is useful for evaluation tests when you don't want to initialize a "proper" store.
2020-08-24Merge pull request #3950 from obsidiansystems/tabs-spacesEelco Dolstra
tabs -> spaces
2020-08-23Merge remote-tracking branch 'obsidian/write-derivation-borrow' into HEADJohn Ericson
2020-08-23`writeDerivation` just needs a plain store referenceJohn Ericson
2020-08-21"Downstream placeholders" should not be store pathsJohn Ericson
Insead they should be opaque `/<hash>` like the placeholders we already have.
2020-08-21tabs -> spacesJohn Ericson
Sorry I let the tab sneak in there in the first place.
2020-08-20Merge remote-tracking branch 'upstream/master' into templated-daemon-protocolJohn Ericson
2020-08-20Merge remote-tracking branch 'upstream/master' into single-ca-drv-buildJohn Ericson
2020-08-20Rename drv output querying functions, like masterJohn Ericson
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap` - `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap
2020-08-20Merge pull request #3859 from obsidiansystems/drv-outputs-map-allow-missingEelco Dolstra
`queryDerivationOutputMap` no longer assumes all outputs have a mapping