aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2021-04-05Use `BuildableReq` for `buildPaths` and `ensurePath`John Ericson
This avoids an ambiguity where the `StorePathWithOutputs { drvPath, {} }` could mean "build `brvPath`" or "substitute `drvPath`" depending on context. It also brings the internals closer in line to the new CLI, by generalizing the `Buildable` type is used there and makes that distinction already. In doing so, relegate `StorePathWithOutputs` to being a type just for backwards compatibility (CLI and RPC).
2021-04-05Move `StorePathWithOutput` utilities out of store classJohn Ericson
These are by no means part of the notion of a store, but rather are things that happen to use stores. (Or put another way, there's no way we'd make them virtual methods any time soon.) It's better to move them out of that too-big class then. Also, this helps us remove StorePathWithOutputs from the Store interface altogether next commit.
2021-04-05Move `StorePathWithOutputs` into its own header/fileJohn Ericson
In the following commits it will become less prevalent.
2021-04-05Pull out Buildable into its own file/header in libnixstoreJohn Ericson
2021-03-30fetchGit: don't prefix "refs/heads/" on ref = "HEAD"Bjørn Forsman
This fixes builtins.fetchGit { url = ...; ref = "HEAD"; }, that works in stable nix (v2.3.10), but is broken in nix master: $ ./result/bin/nix repl Welcome to Nix version 2.4pre19700101_dd77f71. Type :? for help. nix-repl> builtins.fetchGit { url = "https://github.com/NixOS/nix"; ref = "HEAD"; } fetching Git repository 'https://github.com/NixOS/nix'fatal: couldn't find remote ref refs/heads/HEAD error: program 'git' failed with exit code 128 The documentation for builtins.fetchGit says ref = "HEAD" is the default, so it should also be supported to explicitly pass it. I came across this issue because poetry2nix can use ref = "HEAD" in some situations. Fixes #4674.
2021-03-26LocalBinaryCacheStore::upsertFile(): Fix raceEelco Dolstra
When multiple threads try to upsert the same file, this could fail. Fixes #4667.
2021-03-26Fix some typosEelco Dolstra
Fixes #4671.
2021-03-24Merge pull request #4650 from samueldr/fix/registry-config-dirEelco Dolstra
Use the appropriate config dir for the registry
2021-03-23Merge pull request #4603 from DavHau/davhau-improve-nix-conf-help-buildersEelco Dolstra
improve man page for nix.conf (builders)
2021-03-23Merge pull request #4646 from Ma27/support-scoped-v6Eelco Dolstra
Fix Nix to properly work with stores using a scoped IPv6 address
2021-03-23nix.conf builders: refer to manual pageDavHau
2021-03-22Fix typos in the last PR #4656John Ericson
2021-03-22Clean up serialization for `BuildResult`John Ericson
A few versioning mistakes were corrected: - In 27b5747ca7b5599768083dde5fa4d36bfbb0f66f, Daemon protocol had some version `>= 0xc` that should have been `>= 0x1c`, or `28` since the other conditions used decimal. - In a2b69660a9b326b95d48bd222993c5225bbd5b5f, legacy SSH gated new CAS info on version 6, but version 5 in the server. It is now 6 everywhere. Additionally, legacy ssh was sending over more metadata than the daemon one was. The daemon now sends that data too. CC @regnat Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2021-03-19Use the appropriate config dir for the registrySamuel Dionne-Riel
2021-03-19ProgressBar: Respect verbosity levelEelco Dolstra
This makes its behaviour consistent with SimpleLogger.
2021-03-19Restore 'nix flake info' as a deprecated aliasEelco Dolstra
2021-03-17Merge pull request #4648 from hercules-ci/remove-unimplemented-hashAlgoOptEelco Dolstra
Remove unimplemented hashAlgoOpt
2021-03-17Remove unimplemented hashAlgoOptRobert Hensing
It was in the header but never implemented.
2021-03-16Fix Nix to properly work with stores using a scoped IPv6 addressMaximilian Bosch
According to RFC4007[1], IPv6 addresses can have a so-called zone_id separated from the actual address with `%` as delimiter. In contrast to Nix 2.3, the version on `master` doesn't recognize it as such: $ nix ping-store --store ssh://root@fe80::1%18 --experimental-features nix-command warning: 'ping-store' is a deprecated alias for 'store ping' error: --- Error ----------------------------------------------------------------- nix don't know how to open Nix store 'ssh://root@fe80::1%18' I modified the IPv6 match-regex accordingly to optionally detect this part of the address. As we don't seem to do anything special with it, I decided to leave it as part of the URL for now. Fixes #4490 [1] https://tools.ietf.org/html/rfc4007
2021-03-16Merge 'nix flake {info,list-inputs}' into 'nix flake metadata'Eelco Dolstra
Fixes #4613.
2021-03-16--override-input: Imply --no-write-lock-fileEelco Dolstra
Fixes #3779.
2021-03-15Merge pull request #4587 from ↵Eelco Dolstra
obsidiansystems/derivation-goal-detect-invalid-output Throw error for derivation goal with bogus wanted output
2021-03-15Merge pull request #4580 from obsidiansystems/restore-test-build-remote-ca-fixedEelco Dolstra
Restore now-working build-remote-content-addressed-fixed test
2021-03-15Merge pull request #4624 from NixOS/ca/realisation-nix-commandEelco Dolstra
Add a `nix realisation` command for working on realisations
2021-03-15Properly sign the unresolved drvsregnat
Don't let them inherit the signature from the parent one (because it makes no sense to do so), but re-sign them after they have been built
2021-03-15Check the signatures when copying store paths aroundregnat
Broken atm
2021-03-15pathInfoIsTrusted -> pathInfoIsUntrustedregnat
I guess the rationale behind the old name wath that `pathInfoIsTrusted(info)` returns `true` iff we would need to `blindly` trust the path (because it has no valid signature and `requireSigs` is set), but I find it to be a really confusing footgun because it's quite natural to give it the opposite meaning.
2021-03-15Add some logic for signing realisationsregnat
Not exposed anywhere, but built realisations are now signed (and this should be forwarded when copy-ing them around)
2021-03-15Merge pull request #4592 from NixOS/ca/remote-cacheEelco Dolstra
Substitute content-addressed derivations
2021-03-11Merge pull request #4566 from orbekk/masterEelco Dolstra
Add support for bare git repositories when using git+file
2021-03-09Add a `nix realisation` command for working on realisationsregnat
Currently only has `nix realisation info`, more to come probably
2021-03-08Merge pull request #4601 from lovesegfault/fix-4598Eelco Dolstra
nix-build: check that envCommand exists
2021-03-08Merge pull request #4615 from NixOS/nix-show-stats-with-nix-cmdEelco Dolstra
Make NIX_SHOW_STATS work with new-style commands
2021-03-04nix-build: set execfailBernardo Meurer
When starting a nix-shell with `-i` it was previously possible for it to silently fail in the scenario where the specified interpreter didn't exist. This happened due to the `exec` call masking the issue. With this change we enable `execfail`, which causes the script using `nix-shell` as interpreter to correctly exit with code 127. Fixes: #4598
2021-03-05Avoid some StorePath -> Path -> StorePath roundtripsJohn Ericson
There were done when StorePath was defined in Rust and there were some FFI issues. This is no longer an issue.
2021-03-04improve man page for nix.conf (builders)DavHau
2021-03-03nix repl :doc: Don't return docs for partially applied primopsEelco Dolstra
This gives misleading results for Nixpkgs functions like lib.toUpper. Fixes #4596.
2021-03-02Make NIX_SHOW_STATS work with new-style commandsregnat
2021-03-02libfetchers/tarball: Lock on effectiveUrldramforever
Basically, if a tarball URL is used as a flake input, and the URL leads to a redirect, the final redirect destination would be recorded as the locked URL. This allows tarballs under https://nixos.org/channels to be used as flake inputs. If we, as before, lock on to the original URL it would break every time the channel updates.
2021-03-01Fix bad wanted output error as requestedJohn Ericson
- UsageError -> Error - include drv path too
2021-03-01Add support for bare git repositories with git+fileKjetil Orbekk
Local git repositories are normally used directly instead of cloning. This commit checks if a repo is bare and forces a clone. Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
2021-03-01Allow substituting drv outputs when buildingregnat
2021-03-01SubstitutionGoal -> PathSubstitutionGoalregnat
To prepare for the upcoming DrvOutputSubstitutionGoal
2021-03-01Merge pull request #4574 from grahamc/libstore-ssh-host-keyEelco Dolstra
libstore: support passing a builder's public SSH host key
2021-02-28Throw error for derivation goal with bogus wanted outputJohn Ericson
2021-02-27Fix testing fixed-output derivations in double sandboxesJohn Ericson
What happened was that Nix was trying to unconditionally mount these paths in fixed-output derivations, but since the outer derivation was pure, those paths did not exist. The solution is to only mount those paths when they exist.
2021-02-26Properly propagate libseccomp linker flagsPuck Meerburg
2021-02-26Remove unused `redirectedBadOutputs`John Ericson
2021-02-26Remove temporary `#if 0...#endif` from previous commitJohn Ericson
2021-02-26Split {,local-}derivation-goal.{cc,hh}John Ericson
This separates the scheduling logic (including simple hook pathway) from the local-store needing code. This should be the final split for now. I'm reasonably happy with how it's turning out, even before I'm done moving code into `local-derivation-goal`. Benefits: 1. This will help "witness" that the hook case is indeed a lot simpler, and also compensate for the increased complexity that comes from content-addressed derivation outputs. 2. It also moves us ever so slightly towards a world where we could use off-the-shelf storage or sandboxing, since `local-derivation-goal` would be gutted in those cases, but `derivation-goal` should remain nearly the same. The new `#if 0` in the new files will be deleted in the following commit. I keep it here so if it turns out more stuff can be moved over, it's easy to do so in a way that preserves ordering --- and thus prevents conflicts. N.B. ```sh git diff HEAD^^ --color-moved --find-copies-harder --patience --stat ``` makes nicer output.