John Ericson
0966532dc1
Merge remote-tracking branch 'upstream' into indexed-store-path-outputs
...
Co-Authored-By: Tom Bereknyei <tomberek@gmail.com>
2022-03-25 16:48:50 +00:00
Eelco Dolstra
1844172dd1
Merge pull request #6314 from edolstra/experimental-primop
...
Only provide builtins is the corresponding experimental feature is enabled
2022-03-25 16:16:31 +01:00
Eelco Dolstra
16cf1e6089
Merge pull request #6311 from edolstra/return-wanted-paths
...
Make buildPathsWithResults() only return info on wanted outputs
2022-03-25 15:44:39 +01:00
Eelco Dolstra
fc35b11a7c
Fix mismatched tag warning on clang
2022-03-25 15:22:22 +01:00
Eelco Dolstra
8c363eb3eb
Document getFlake
...
Fixes #5523 .
2022-03-25 14:19:55 +01:00
Eelco Dolstra
86b05ccd54
Only provide builtin.{getFlake,fetchClosure} is the corresponding experimental feature is enabled
...
This allows writing fallback code like
if builtins ? fetchClosure then
builtins.fetchClose { ... }
else
builtins.storePath ...
2022-03-25 14:04:18 +01:00
Eelco Dolstra
55bc524019
Merge pull request #6051 from Ma27/fix-empty-nix-log
...
`nix log` should also work if the log didn't provide any output
2022-03-25 10:35:10 +01:00
Eelco Dolstra
50c229ad9a
Use wantOutput
...
Co-authored-by: John Ericson <git@JohnEricson.me>
2022-03-25 08:02:49 +01:00
polykernel
cbcb69a39c
nix: allow whitespace characters before command in repl
...
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-24 21:33:29 -04:00
Eelco Dolstra
540d7e33d8
Retry substitution after an incomplete closure only once
...
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-24 23:25:12 +01:00
Eelco Dolstra
fe5509df9a
Only return wanted outputs
2022-03-24 23:24:48 +01:00
Eelco Dolstra
09796c0263
Random cleanup
2022-03-24 23:24:10 +01:00
Eelco Dolstra
175c78591b
Random cleanup
2022-03-24 23:09:43 +01:00
Maximilian Bosch
c85467a1b6
Revert "TarArchive: Small refactoring"
...
This reverts commit 50a35860ee
.
With this change Nix fails to open bzip2 logfiles that were created from
builds with no stdout/stderr.
2022-03-24 22:30:46 +01:00
Eelco Dolstra
f902f3c2cb
Add experimental feature 'fetch-closure'
2022-03-24 21:33:33 +01:00
Eelco Dolstra
e5f7029ba4
nix store make-content-addressed: Support --from / --to
2022-03-24 21:33:33 +01:00
Eelco Dolstra
98658ae9d2
Document fetchClosure
2022-03-24 21:33:33 +01:00
Eelco Dolstra
28186b7044
Add a test for fetchClosure and 'nix store make-content-addressed'
2022-03-24 21:33:33 +01:00
Eelco Dolstra
4120930ac1
fetchClosure: Only allow some "safe" store types
2022-03-24 21:33:33 +01:00
Eelco Dolstra
7ffda0af6e
fetchClosure: Skip makeContentAddressed() if toPath is already valid
2022-03-24 21:33:33 +01:00
Eelco Dolstra
5acaf13d35
Rename 'nix store make-content-addressable' to 'nix store make-content-addressed'
2022-03-24 21:33:33 +01:00
Eelco Dolstra
f18607549c
Fix makeContentAddressed() on self-references
...
LocalStore::addToStore() since
79ae9e4558
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-24 21:33:33 +01:00
Eelco Dolstra
545c2d0d8c
fetchClosure: Allow a path to be rewritten to CA on the fly
...
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-24 21:33:33 +01:00
Eelco Dolstra
7f6fe8ca1d
Rename
2022-03-24 21:33:33 +01:00
Eelco Dolstra
41659418cf
fetchClosure: Require a CA path in pure mode
2022-03-24 21:33:33 +01:00
Eelco Dolstra
f4bafc412f
Add builtins.fetchClosure
...
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-24 21:33:33 +01:00
Eelco Dolstra
d67fe90375
Merge pull request #6305 from flox/genericClosure_doc
...
docs: genericClosure
2022-03-24 14:02:58 +01:00
Tom Bereknyei
0736f3651d
docs: genericClosure
2022-03-24 08:03:59 -04:00
Rok Garbas
4546a007a4
Fix flake profile use of originalUrl vs. originalUri
...
Fixes #5872
2022-03-24 12:28:38 +01:00
Sergei Trofimovich
9174d884d7
lexer: add error location to lexer errors
...
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-24 08:16:14 +00:00
Hideaki Kawai
3b776cb0a7
nix edit: support kakoune
2022-03-22 23:18:02 +09:00
Eelco Dolstra
a0259a21a4
Don't hide repeated values while generating manifest.nix
...
Fixes #6243 .
2022-03-22 13:18:56 +01:00
Eelco Dolstra
732296ddc0
printValue(): <REPEAT> -> «repeated»
...
This ensures that it doesn't get parsed as a valid Nix expression.
2022-03-22 13:00:27 +01:00
Eelco Dolstra
0b42afe027
buildProfile(): Ignore manifest.{nix,json}
...
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-22 10:48:02 +01:00
Eelco Dolstra
e4ff430866
Merge pull request #6237 from obsidiansystems/store-path-string-context
...
Decode string context straight to using StorePaths
2022-03-22 10:29:46 +01:00
Gabriel Fontes
9720797f69
Don't partial match sourcehut refs
2022-03-19 11:04:04 -03:00
Gabriel Fontes
345a8ee0cb
Fix sourcehut tag ref resolving
2022-03-19 10:56:13 -03:00
Guillaume Maudoux
963b8aa39b
Explain current error trace impl
2022-03-18 23:17:50 +01:00
John Ericson
4d6a3806d2
Decode string context straight to using StorePath
s
...
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-18 15:36:11 +00:00
John Ericson
a544ed7684
Generalize DerivationType
in preparation for impure derivations
2022-03-18 14:59:56 +00:00
John Ericson
049fae155a
Avoid some pointless copying of drvs
2022-03-18 14:59:56 +00:00
John Ericson
8496be7def
Use Deferred when building an input-addressed drv
...
Easier than using dummy path with input addressed.
2022-03-18 14:59:56 +00:00
Guillaume Maudoux
c2b620f3ad
Try to fix issues with macos clang, v3
2022-03-18 15:35:24 +01:00
Guillaume Maudoux
726f5836d8
Try to fix issues with macos clang, v2
2022-03-18 15:22:25 +01:00
Guillaume Maudoux
37e84316c2
Try to fix issues with macos clang
2022-03-18 14:48:49 +01:00
Guillaume Maudoux
9c42c00570
Fix some error kind mismatches
2022-03-18 10:22:47 +01:00
Guillaume Maudoux
ad3fadb95a
fixup! Merge remote-tracking branch 'origin/master' into coerce-string
2022-03-18 10:11:36 +01:00
Guillaume Maudoux
ca5c3e86ab
Merge remote-tracking branch 'origin/master' into coerce-string
2022-03-18 01:25:55 +01:00
Guillaume Maudoux
1942fed6d9
Revert extra colon at end os strings
2022-03-18 01:10:04 +01:00
Guillaume Maudoux
e6d07e0d89
Refactor to use more traces and less string manipulations
2022-03-18 00:58:09 +01:00