aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-17Remove corepkgs/config.nixEelco Dolstra
This isn't used anywhere except in the configure script of the Perl bindings. I've changed the latter to use the C++ API's Settings object at runtime.
2020-09-17Remove corepkgs/unpack-channel.nixEelco Dolstra
2020-09-17Remove corepkgs/derivation.nixEelco Dolstra
2020-09-16Merge branch 'document-store-options' of https://github.com/tweag/nixEelco Dolstra
2020-09-16Fix doc generationEelco Dolstra
2020-09-16jq -> nixEelco Dolstra
2020-09-16builtins.toFile: Fix indentationEelco Dolstra
2020-09-16Remove useless exception copyThéophane Hufschmitt
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2020-09-16Add a test for `nix describe-stores`regnat
Doesn't test much, but at least ensures that the command runs properly
2020-09-16Fix the s3 storeregnat
Add some necessary casts in the initialisation of the store's config
2020-09-16Don't include nlohmann/json.hpp in config.hhregnat
Instead make a separate header with the template implementation of `BaseSetting<T>::toJSONObj` that can be included where needed
2020-09-16Include the full nlohmann/json header in config.hhregnat
It is apparently required for using `toJSONObject()`, which we do inside the header file (because it's in a template). This was accidentally working when building Nix itself (presumably because `config.hh` was always included after `nlohman/json.hpp`) but caused a (pretty dirty) build failure in the perl bindings package.
2020-09-16Add `(StoreConfig*)` casts to work around a GCC bugregnat
Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80431 that was already there in the code but was accidentally removed in the last commits
2020-09-16fixup! Add a default value for the settingsregnat
2020-09-16Fix build issues with gccregnat
2020-09-16Add a markdown output to `nix describe-stores`regnat
2020-09-16Add a name to the storesregnat
So that it can be printed by `nix describe-stores`
2020-09-16Document the new store hierarchyregnat
2020-09-16Make uri schemes grammar more RFC-compliantregnat
Allow `-` and `.` in the RFC schemes as stated by [RFC3986](https://tools.ietf.org/html/rfc3986#section-3.1). Practically, this is needed so that `ssh-ng` is a valid URI scheme
2020-09-16fixup! Make the store plugins more introspectableregnat
2020-09-16fixup! Correctly call all the parent contructors of the storesregnat
2020-09-16Properly filter the stores according to their declared uriSchemesregnat
When opening a store, only try the stores whose `uriSchemes()` include the current one
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-16fixup! Make the store plugins more introspectableregnat
2020-09-16Make `nix describe-stores` functionalregnat
Using the `*Config` class hierarchy
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-16Add a default value for the settingsregnat
The default value is initialized when creating the setting and unchanged after that
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-16Merge branch 'single-ca-drv-build' of https://github.com/obsidiansystems/nixEelco Dolstra
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-15.gitignore: inst -> outputsEelco Dolstra
2020-09-15Merge pull request #4014 from tweag/fix-queryDrvOutputMaps-for-old-daemonsEelco Dolstra
gracefully handle old daemon versions
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-14Merge pull request #4012 from tweag/3989-escape-dollar-in-manifestEelco Dolstra
Escape `${` in strings when printing Nix expressions
2020-09-14Escape `${` in strings when printing Nix expressionsregnat
Otherwise the result of the printing can't be parsed back correctly by Nix (because the unescaped `${` will be parsed as the begining of an anti-quotation). Fix #3989
2020-09-14nix-daemon: Lower verbosity of restricted setting warningEelco Dolstra
Fixes #3992.
2020-09-14Merge pull request #4005 from Infinisil/fix-autoArgsEelco Dolstra
Fix auto argument passing for more auto arguments than formals
2020-09-14Merge pull request #4010 from leungbk/cclsEelco Dolstra
Add ccls files to .gitignore
2020-09-14Merge pull request #4008 from aszlig/fix-ub-in-reading-ca-mapEelco Dolstra
Fix unspecified behaviour in readStorePathCAMap
2020-09-13Add ccls files to .gitignoreBrian Leung
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-12docs+test: fix remaining installer downloads without -L (#4006)Jade
Co-authored-by: lf- <lf-@users.noreply.github.com>
2020-09-11Fix auto argument passing for more auto arguments than formalsSilvan Mosberger
The change in 626200713bb3cc844a9feb6af583c9b6b42c6dbc didn't account for when the number of auto arguments is bigger than the number of formal arguments. This causes the following: $ nix-instantiate --eval -E '{ ... }@args: args.foo' --argstr foo foo nix-instantiate: src/libexpr/attr-set.hh:55: void nix::Bindings::push_back(const nix::Attr&): Assertion `size_ < capacity_' failed. Aborted (core dumped)