aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-03-31Document isPure()Eelco Dolstra
2022-03-31Fix macOS buildEelco Dolstra
2022-03-31Support fixed-output derivations depending on impure derivationsEelco Dolstra
2022-03-31Add support for impure derivationsEelco Dolstra
Impure derivations are derivations that can produce a different result every time they're built. Example: stdenv.mkDerivation { name = "impure"; __impure = true; # marks this derivation as impure outputHashAlgo = "sha256"; outputHashMode = "recursive"; buildCommand = "date > $out"; }; Some important characteristics: * This requires the 'impure-derivations' experimental feature. * Impure derivations are not "cached". Thus, running "nix-build" on the example above multiple times will cause a rebuild every time. * They are implemented similar to CA derivations, i.e. the output is moved to a content-addressed path in the store. The difference is that we don't register a realisation in the Nix database. * Pure derivations are not allowed to depend on impure derivations. In the future fixed-output derivations will be allowed to depend on impure derivations, thus forming an "impurity barrier" in the dependency graph. * When sandboxing is enabled, impure derivations can access the network in the same way as fixed-output derivations. In relaxed sandboxing mode, they can access the local filesystem.
2022-03-31replaceEnv(): Pass newEnv by referenceEelco Dolstra
2022-03-30bundler: update default bundler to support new bundler APITom Bereknyei
2022-03-29Simplify the handling of the hash moduloThéophane Hufschmitt
Rather than having four different but very similar types of hashes, make only one, with a tag indicating whether it corresponds to a regular of deferred derivation. This implies a slight logical change: The original Nix+multiple-outputs model assumed only one hash-modulo per derivation. Adding multiple-outputs CA derivations changed this as these have one hash-modulo per output. This change is now treating each derivation as having one hash modulo per output. This obviously means that we internally loose the guaranty that all the outputs of input-addressed derivations have the same hash modulo. But it turns out that it doesn’t matter because there’s nothing in the code taking advantage of that fact (and it probably shouldn’t anyways). The upside is that it is now much easier to work with these hashes, and we can get rid of a lot of useless `std::visit{ overloaded`. Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems>
2022-03-28Merge pull request #6330 from edolstra/run-remote-storeThéophane Hufschmitt
nix {run,shell}: Print a better error message if the store is not local
2022-03-28nix {run,shell}: Print a better error message if the store is not localEelco Dolstra
Closes #6317
2022-03-28nix profile install: Don't use queryDerivationOutputMap()Eelco Dolstra
Instead get the outputs from Installable::build(). This will also allow 'nix profile install' to support impure derivations. Fixes #6286.
2022-03-25Merge pull request #6314 from edolstra/experimental-primopEelco Dolstra
Only provide builtins is the corresponding experimental feature is enabled
2022-03-25Merge pull request #6311 from edolstra/return-wanted-pathsEelco Dolstra
Make buildPathsWithResults() only return info on wanted outputs
2022-03-25Fix mismatched tag warning on clangEelco Dolstra
2022-03-25Document getFlakeEelco Dolstra
Fixes #5523.
2022-03-25Only provide builtin.{getFlake,fetchClosure} is the corresponding ↵Eelco Dolstra
experimental feature is enabled This allows writing fallback code like if builtins ? fetchClosure then builtins.fetchClose { ... } else builtins.storePath ...
2022-03-25Merge pull request #6051 from Ma27/fix-empty-nix-logEelco Dolstra
`nix log` should also work if the log didn't provide any output
2022-03-25Use wantOutputEelco Dolstra
Co-authored-by: John Ericson <git@JohnEricson.me>
2022-03-24nix: allow whitespace characters before command in replpolykernel
Before this change, processLine always uses the first character as the start of the line. This cause whitespaces to matter at the beginning of the line whereas it does not matter anywhere else. This commit trims leading white spaces of the string line so that subsequent operations can be performed on the string without explicitly tracking starting and ending indices of the string.
2022-03-24Retry substitution after an incomplete closure only onceEelco Dolstra
This avoids an infinite loop in the final test in tests/binary-cache.sh. I think this was only not triggered previously by accident (because we were clearing wantedOutputs in between).
2022-03-24Only return wanted outputsEelco Dolstra
2022-03-24Random cleanupEelco Dolstra
2022-03-24Random cleanupEelco Dolstra
2022-03-24Revert "TarArchive: Small refactoring"Maximilian Bosch
This reverts commit 50a35860ee9237d341948437c5f70a7f0987d393. With this change Nix fails to open bzip2 logfiles that were created from builds with no stdout/stderr.
2022-03-24Add experimental feature 'fetch-closure'Eelco Dolstra
2022-03-24nix store make-content-addressed: Support --from / --toEelco Dolstra
2022-03-24Document fetchClosureEelco Dolstra
2022-03-24Add a test for fetchClosure and 'nix store make-content-addressed'Eelco Dolstra
2022-03-24fetchClosure: Only allow some "safe" store typesEelco Dolstra
2022-03-24fetchClosure: Skip makeContentAddressed() if toPath is already validEelco Dolstra
2022-03-24Rename 'nix store make-content-addressable' to 'nix store ↵Eelco Dolstra
make-content-addressed'
2022-03-24Fix makeContentAddressed() on self-referencesEelco Dolstra
LocalStore::addToStore() since 79ae9e4558cbefd743f28a5e73110c2303b03a85 expects a regular NAR hash, rather than a NAR hash modulo self-references. Fixes #6300. Also, makeContentAddressed() now rewrites the entire closure (so 'nix store make-content-addressable' no longer needs '-r'). See #6301.
2022-03-24fetchClosure: Allow a path to be rewritten to CA on the flyEelco Dolstra
The advantage is that the resulting closure doesn't need to be signed, so you don't need to configure any binary cache keys on the client.
2022-03-24RenameEelco Dolstra
2022-03-24fetchClosure: Require a CA path in pure modeEelco Dolstra
2022-03-24Add builtins.fetchClosureEelco Dolstra
This allows closures to be imported at evaluation time, without requiring the user to configure substituters. E.g. builtins.fetchClosure { storePath = /nix/store/f89g6yi63m1ywfxj96whv5sxsm74w5ka-python3.9-sqlparse-0.4.2; from = "https://cache.ngi0.nixos.org"; }
2022-03-24Merge pull request #6305 from flox/genericClosure_docEelco Dolstra
docs: genericClosure
2022-03-24docs: genericClosureTom Bereknyei
2022-03-24Fix flake profile use of originalUrl vs. originalUriRok Garbas
Fixes #5872
2022-03-24lexer: add error location to lexer errorsSergei Trofimovich
Before the change lexter errors did not report the location: $ nix build -f. mc error: path has a trailing slash (use '--show-trace' to show detailed location information) Note that it's not clear what file generates the error. After the change location is reported: $ src/nix/nix --extra-experimental-features nix-command build -f ~/nm mc error: path has a trailing slash at .../pkgs/development/libraries/glib/default.nix:54:18: 53| }; 54| src = /tmp/foo/; | ^ 55| (use '--show-trace' to show detailed location information) Here we see both problematic file and the string itself.
2022-03-22nix edit: support kakouneHideaki Kawai
2022-03-22Don't hide repeated values while generating manifest.nixEelco Dolstra
Fixes #6243.
2022-03-22printValue(): <REPEAT> -> «repeated»Eelco Dolstra
This ensures that it doesn't get parsed as a valid Nix expression.
2022-03-22buildProfile(): Ignore manifest.{nix,json}Eelco Dolstra
If a package installs a file named manifest.json, it caused nix-env to consider the profile a new-style profile created by 'nix profile'. Fixes #6032.
2022-03-22Merge pull request #6237 from obsidiansystems/store-path-string-contextEelco Dolstra
Decode string context straight to using StorePaths
2022-03-19Don't partial match sourcehut refsGabriel Fontes
2022-03-19Fix sourcehut tag ref resolvingGabriel Fontes
2022-03-18Decode string context straight to using `StorePath`sJohn Ericson
I gather decoding happens on demand, so I hope don't think this should have any perf implications one way or the other.
2022-03-18Generalize `DerivationType` in preparation for impure derivationsJohn Ericson
2022-03-18Avoid some pointless copying of drvsJohn Ericson
2022-03-18Use Deferred when building an input-addressed drvJohn Ericson
Easier than using dummy path with input addressed.