aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-12-21Add 'nix path-info' manpageEelco Dolstra
2020-12-21Add 'nix store optimise' manpageEelco Dolstra
2020-12-21Add 'nix store verify' manpageEelco Dolstra
2020-12-21Add 'nix upgrade-nix' manpageEelco Dolstra
2020-12-21Add 'nix why-depends' manpageEelco Dolstra
2020-12-21Add 'nix store' NAR-related manpagesEelco Dolstra
2020-12-21Add 'nix nar' manpagesEelco Dolstra
2020-12-21Add 'nix eval' manpageEelco Dolstra
2020-12-21Add 'nix store ping' manpageEelco Dolstra
2020-12-21TweakEelco Dolstra
2020-12-21Add 'nix log' manpageEelco Dolstra
2020-12-21Add 'nix repl' manpageEelco Dolstra
2020-12-21Add 'nix edit' manpageEelco Dolstra
2020-12-21TypoEelco Dolstra
2020-12-21Add 'nix registry' manpagesEelco Dolstra
This also documents the registry format and matching/unification semantics (though not quite correctly).
2020-12-21Add 'nix develop' and `nix print-dev-env' manpagesEelco Dolstra
2020-12-21Add 'nix search' manpageEelco Dolstra
2020-12-21Add 'nix copy' manpageEelco Dolstra
2020-12-21Add 'nix run' and 'nix shell' manpagesEelco Dolstra
2020-12-21Add 'nix build' manpageEelco Dolstra
2020-12-21Move doc() to ArgsEelco Dolstra
2020-12-21Merge pull request #4385 from obsidiansystems/store-subclassEelco Dolstra
Overhaul store subclassing
2020-12-21Merge pull request #4355 from Infinisil/private-value-typeEelco Dolstra
Refactoring for private Value type
2020-12-20Overhaul store subclassingJohn Ericson
We embrace virtual the rest of the way, and get rid of the `assert(false)` 0-param constructors. We also list config base classes first, so the constructor order is always: 1. all the configs 2. all the stores Each in the same order
2020-12-18Replace Value type setters with mk* functionsSilvan Mosberger
Move clearValue inside Value mkInt instead of setInt mkBool instead of setBool mkString instead of setString mkPath instead of setPath mkNull instead of setNull mkAttrs instead of setAttrs mkList instead of setList* mkThunk instead of setThunk mkApp instead of setApp mkLambda instead of setLambda mkBlackhole instead of setBlackhole mkPrimOp instead of setPrimOp mkPrimOpApp instead of setPrimOpApp mkExternal instead of setExternal mkFloat instead of setFloat Add note that the static mk* function should be removed eventually
2020-12-17Rename Value::normalType() -> Value::type()Silvan Mosberger
2020-12-17Rename ValueType -> InternalType, NormalType -> ValueTypeSilvan Mosberger
And Value::type to Value::internalType, such that type() can be used in the next commit to get the new ValueType
2020-12-17Fix the detection of already built drv outputsregnat
PRs #4370 and #4348 had a bad interaction in that the second broke the fist one in a not trivial way. The issue was that since #4348 the logic for detecting whether a derivation output is already built requires some logic that was specific to the `LocalStore`. It happens though that most of this logic could be upstreamed to any `Store`, which is what this commit does.
2020-12-16Merge pull request #4370 from NixOS/ca/more-precise-build-noopEelco Dolstra
Better detect when `buildPaths` would be a no-op
2020-12-16Don't ignore an absent drv file in queryPartialDrvOutputMapregnat
This ignore was here because `queryPartialDrvOutputMap` was used both 1. as a cache to avoid having to re-read the derivation (when gc-ing for example), and 2. as the source of truth for ca realisations The use-case 2. required it to be able to work even when the derivation wasn't there anymore (see https://github.com/NixOS/nix/issues/4138). However, this use-case is now handled by `queryRealisation`, meaning that we can safely error out if the derivation isn't there anymore
2020-12-16Merge pull request #4348 from NixOS/ca/use-hashmoduloEelco Dolstra
Use the hash modulo in the derivation outputs
2020-12-16Fix BinaryCacheStore::registerDrvOutputregnat
Was crashing because coercing a json document into a string is only valid if the json is a string, otherwise we need to call `.dump()`
2020-12-16Better detect when `buildPaths` would be a no-opregnat
`buildPaths` can be called even for stores where it's not defined in case it's bound to be a no-op. The “no-op detection” mechanism was only detecting the case wher `buildPaths` was called on a set of (non-drv) paths that were already present on the store. This commit extends this mechanism to also detect the case where `buildPaths` is called on a set of derivation outputs which are already built on the store. This only works with the ca-derivations flag. It could be possible to extend this to also work without it, but it would add quite a bit of complexity, and it's not used without it anyways.
2020-12-15Use the fs accessor for readInvalidDerivationregnat
Extend `FSAccessor::readFile` to allow not checking that the path is a valid one, and rewrite `readInvalidDerivation` using this extended `readFile`. Several places in the code use `readInvalidDerivation`, either because they need to read a derivation that has been written in the store but not registered yet, or more generally to prevent a deadlock because `readDerivation` tries to lock the state, so can't be called from a place where the lock is already held. However, `readInvalidDerivation` implicitely assumes that the store is a `LocalFSStore`, which isn't always the case. The concrete motivation for this is that it's required for `nix copy --from someBinaryCache` to work, which is tremendously useful for the tests.
2020-12-15Fix `addTextToStore` for binary cachesregnat
Because of a too eager refactoring, `addTextToStore` used to throw an error because the input wasn't a valid nar. Partially revert that refactoring to wrap the text into a proper nar (using `dumpString`) to make this method work again
2020-12-14Merge pull request #4330 from NixOS/ca/properly-store-outputsEelco Dolstra
Properly store the outputs of CA derivations − take 2
2020-12-14Merge pull request #4351 from Ma27/json-errtraceEelco Dolstra
primops/fromJSON: add error position in case of parse error
2020-12-13primops/fromJSON: add error position in case of parse errorMaximilian Bosch
This makes it easier to track down where invalid JSON was passed to `builtins.fromJSON`.
2020-12-13Merge pull request #4352 from jonringer/allow-private-cachesEelco Dolstra
treat s3 permission errors as file-not-found
2020-12-12Make Value::type privateSilvan Mosberger
This is an implementation detail and shouldn't be used. Use normalType() and the various is<Type> functions instead
2020-12-12Add ValueType checking functions for types that have the same NormalTypeSilvan Mosberger
2020-12-12Use Value::normalType on all forced values instead of Value::typeSilvan Mosberger
2020-12-12Introduce Value type setters and make use of themSilvan Mosberger
2020-12-12Introduce NormalType for the normal type of a ValueSilvan Mosberger
This will be useful to abstract over the ValueType implementation details Make use of it already to replace the showType(ValueType) function
2020-12-11Restrict the operations on drv outputs in recursive Nixregnat
There's currently no way to properly filter them, so disallow them altogether instead.
2020-12-11Use the hash modulo in the derivation outputsregnat
Rather than storing the derivation outputs as `drvPath!outputName` internally, store them as `drvHashModulo!outputName` (or `outputHash!outputName` for fixed-output derivations). This makes the storage slightly more opaque, but enables an earlier cutoff in cases where a fixed-output dependency changes (but keeps the same output hash) − same as what we already do for input-addressed derivations.
2020-12-11Store the realisations as JSON in the binary cacheregnat
Fix #4332
2020-12-11Rework the db schema for derivation outputsregnat
Add a new table for tracking the derivation output mappings. We used to hijack the `DerivationOutputs` table for that, but (despite its name), it isn't a really good fit: - Its entries depend on the drv being a valid path, making it play badly with garbage collection and preventing us to copy a drv output without copying the whole drv closure too; - It dosen't guaranty that the output path exists; By using a different table, we can experiment with a different schema better suited for tracking the output mappings of CA derivations. (incidentally, this also fixes #4138)
2020-12-11Store metadata about drv outputs realisationsregnat
For each known realisation, store: - its output - its output path This comes with a set of needed changes: - New `realisations` module declaring the types needed for describing these mappings - New `Store::registerDrvOutput` method registering all the needed informations about a derivation output (also replaces `LocalStore::linkDeriverToPath`) - new `Store::queryRealisation` method to retrieve the informations for a derivations This introcudes some redundancy on the remote-store side between `wopQueryDerivationOutputMap` and `wopQueryRealisation`. However we might need to keep both (regardless of backwards compat) because we sometimes need to get some infos for all the outputs of a derivation (where `wopQueryDerivationOutputMap` is handy), but all the stores can't implement it − because listing all the outputs of a derivation isn't really possible for binary caches where the server doesn't allow to list a directory.
2020-12-11treat s3 permission errors as file-not-foundMichael Bishop
Signed-off-by: Jonathan Ringer <jonringer117@gmail.com>