regnat
4f84b2c4d6
Remove the visit machinery in RealisedPath
...
In addition to being some ugly template trickery, it was also totally
useless as it was used in only one place where I could replace it by
just a few extra characters
2021-02-04 15:15:22 +01:00
regnat
343687405d
Move the GENERATE_CMP macro to its own file
...
Despite being an ugly hack, it can probably be useful in a couple extra
places
2021-02-04 15:11:05 +01:00
Shea Levy
8864c606ad
Move command plugin interface to libnixcmd
2021-02-04 15:01:28 +01:00
regnat
9fe4bf8e59
Add a new Cmd type working on RealisedPaths
...
Where a `RealisedPath` is a store path with its history, meaning either
an opaque path for stuff that has been directly added to the store, or a
`Realisation` for stuff that has been built by a derivation
This is a low-level refactoring that doesn't bring anything by itself
(except a few dozen extra lines of code :/ ), but raising the
abstraction level a bit is important on a number of levels:
- Commands like `nix build` have to query for the realisations after the
build is finished which is fragile (see
27905f12e4a7207450abe37c9ed78e31603b67e1 for example). Having them
oprate directly at the realisation level would avoid that
- Others like `nix copy` currently operate directly on (built) store
paths, but need a bit more information as they will need to register
the realisations on the remote side
2021-01-27 15:35:10 +01:00
Eelco Dolstra
12de0466fe
Add trace to build errors during import-from-derivation
...
Example:
error: builder for '/nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv' failed with exit code 1;
last 1 log lines:
> FAIL
For full logs, run 'nix log /nix/store/9ysqfidhipyzfiy54mh77iqn29j6cpsb-failing.drv'.
… while importing '/nix/store/pfp4a4bjh642ylxyipncqs03z6kkgfvy-failing'
at /nix/store/25wgzr2qrqqiqfbdb1chpiry221cjglc-source/flake.nix:58:15:
57|
58| ifd = import self.hydraJobs.broken;
| ^
59|
2021-01-27 14:46:10 +01:00
Eelco Dolstra
965dc6070a
Drop trailing whitespace
2021-01-27 14:04:49 +01:00
Eelco Dolstra
c03f41055d
Add traces to errors while updating flake lock file
...
Example:
$ nix build --show-trace
error: unable to download 'https://api.github.com/repos/NixOS/nixpkgs/commits/no-such-branch ': HTTP error 422 ('')
response body:
{
"message": "No commit found for SHA: no-such-branch",
"documentation_url": "https://docs.github.com/rest/reference/repos#get-a-commit "
}
… while fetching the input 'github:NixOS/nixpkgs/no-such-branch'
… while updating the flake input 'nixpkgs'
… while updating the lock file of flake 'git+file:///home/eelco/Dev/nix'
2021-01-27 14:02:54 +01:00
Eelco Dolstra
8e758d402b
Remove mkFlag()
2021-01-27 12:06:03 +01:00
Eelco Dolstra
f15f0b8e83
Update to lowdown 0.7.9
2021-01-26 10:47:40 +01:00
Eelco Dolstra
36c4d6f592
Group common options
2021-01-25 19:03:13 +01:00
Eelco Dolstra
807d963ee8
Group subcommands by category
2021-01-25 18:19:32 +01:00
Eelco Dolstra
3ba98ba8f0
Tell user to run 'nix log' to get full build logs
2021-01-25 17:15:38 +01:00
Eelco Dolstra
a32073e7e8
Add FIXME
2021-01-25 14:43:16 +01:00
Eelco Dolstra
b159d23800
Make '--help' do the same as 'help' (i.e. show a manpage)
2021-01-25 14:38:15 +01:00
Eelco Dolstra
488a826842
Merge pull request #4467 from edolstra/error-formatting
...
Improve error formatting
2021-01-25 12:50:57 +01:00
Eelco Dolstra
c5b42c5a42
Merge pull request #4470 from matthewbauer/fix-4469
...
Handle missing etag in 304 Not Modified response
2021-01-25 12:50:13 +01:00
Eelco Dolstra
680d8a5b86
Merge pull request #4387 from obsidiansystems/non-local-store-build
...
Make `nix-build --store whatever` work
2021-01-25 12:24:23 +01:00
Eelco Dolstra
29edbfe2d2
Merge pull request #4468 from Ma27/installer-no-progress-opt
...
scripts/install-nix-from-closure: only show progress if a terminal is used
2021-01-25 12:22:33 +01:00
Matthew Bauer
1ea5f0b66c
Remove expectedETag assert in tarball.cc
2021-01-22 23:19:52 -06:00
Matthew Bauer
a766824660
Handle missing etag in 304 Not Modified response
...
GitHub now omits the etag, but 304 implies it matches the one we
provided. Just use that one to avoid having an etag-less resource.
Fixes #4469
2021-01-22 14:47:45 -06:00
John Ericson and Eelco Dolstra
53a709535b
Apply suggestions from code review
...
Thanks!
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2021-01-22 15:58:58 +00:00
John Ericson
8c07ed1dda
Improve documentation and test and requested
2021-01-22 15:58:58 +00:00
Eelco Dolstra
b7bfc7ee52
Add FIXME
2021-01-22 12:36:50 +01:00
Maximilian Bosch
d9367a2dd1
scripts/install-nix-from-closure: only show progress if a terminal is used
...
While the progress dots during the copying of the store work fine on a
normal terminal, those look pretty off if the script is run inside a
provisioning script of e.g. `vagrant` or `packer` where `stderr` and
`stdout` are captured:
default: .
default: ..
default: .
default: .
default: .
To work around this, the script checks with `-t 0` if it's
running on an actual terminal and doesn't show the progress if that's not
the case.
2021-01-22 10:35:02 +01:00
Eelco Dolstra
0eb22db311
Fix macOS build
2021-01-21 12:46:22 +01:00
Eelco Dolstra
55849e153e
Change error position formatting
...
It's now
at /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix:7:7:
instead of
at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix
The new format is more standard and clickable.
2021-01-21 11:02:09 +01:00
Eelco Dolstra
40608342cb
Remove trailing whitespace
2021-01-21 11:02:09 +01:00
Eelco Dolstra
8d4268d190
Improve error formatting
...
Changes:
* The divider lines are gone. These were in practice a bit confusing,
in particular with --show-trace or --keep-going, since then there
were multiple lines, suggesting a start/end which wasn't the case.
* Instead, multi-line error messages are now indented to align with
the prefix (e.g. "error: ").
* The 'description' field is gone since we weren't really using it.
* 'hint' is renamed to 'msg' since it really wasn't a hint.
* The error is now printed *before* the location info.
* The 'name' field is no longer printed since most of the time it
wasn't very useful since it was just the name of the exception (like
EvalError). Ideally in the future this would be a unique, easily
googleable error ID (like rustc).
* "trace:" is now just "…". This assumes error contexts start with
something like "while doing X".
Example before:
error: --- AssertionError ---------------------------------------------------------------------------------------- nix
at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix
6|
7| x = assert false; 1;
| ^
8|
assertion 'false' failed
----------------------------------------------------- show-trace -----------------------------------------------------
trace: while evaluating the attribute 'x' of the derivation 'hello-2.10'
at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix
191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
192| name = "${attrs.pname}-${attrs.version}";
| ^
193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
Example after:
error: assertion 'false' failed
at: (7:7) in file: /home/eelco/Dev/nixpkgs/pkgs/applications/misc/hello/default.nix
6|
7| x = assert false; 1;
| ^
8|
… while evaluating the attribute 'x' of the derivation 'hello-2.10'
at: (192:11) in file: /home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/make-derivation.nix
191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
192| name = "${attrs.pname}-${attrs.version}";
| ^
193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
2021-01-21 11:02:09 +01:00
Eelco Dolstra
259100332f
Fix clang build
2021-01-21 10:29:51 +01:00
Eelco Dolstra
d04d8463fa
Merge pull request #4281 from lilyball/shebang
...
Escape filename given to nix-shell in shebang mode
2021-01-20 10:00:10 +01:00
Eelco Dolstra
bc90252cec
nix profile install: Support installing non-flakes
...
Fixes #4458 .
2021-01-18 23:08:58 +01:00
Eelco Dolstra
555940f065
Use enumerate()
2021-01-18 22:50:39 +01:00
Eelco Dolstra
ea756b3654
--refresh: Imply setting .narinfo disk cache TTL to 0
2021-01-18 14:38:31 +01:00
Eelco Dolstra
1bbc66f865
Merge branch 'slashes-in-github-branches' of https://github.com/Ma27/nix
2021-01-18 12:55:06 +01:00
Eelco Dolstra
f0b9a3c974
Merge pull request #4460 from NixOS/ca/fix-ca-flake-outputs
...
Fix content-addressed flake outputs
2021-01-18 12:43:38 +01:00
regnat
11b63740e3
Fix content-addressed flake outputs
...
Prevent some `nix flake` commands to crash by trying to parse a
placeholder output as a store path
2021-01-18 11:31:59 +01:00
Eelco Dolstra
00eef55993
Merge pull request #4459 from NixOS/ca/fix-outputmap-for-no-ca
...
Fix the drv output map for non ca derivations
2021-01-18 11:23:23 +01:00
regnat
9432c170e7
Fix the drv output map for non ca derivations
...
With the `ca-derivation` experimental features, non-ca derivations used
to have their output paths returned as unknown as long as they weren't
built (because of a mistake in the code that systematically erased the
previous value)
2021-01-18 11:01:39 +01:00
Eelco Dolstra
1acbb61696
Tweak
2021-01-17 19:49:28 +01:00
Domen Kožar
056498371c
Merge pull request #4454 from ryneeverett/ping-store-output-docs
...
Document expected output of 'nix store ping'.
2021-01-17 17:39:58 +00:00
ryneeverett
1e13c79a91
Document expected output of 'nix store ping'.
...
While interpreting the output is fairly intuitive it would be better to
explicitly specify what a good invocation looks like.
That this isn't completely obvious (or at least causes folks to
second-guess themselves) can be seen in a couple user threads:
- https://discourse.nixos.org/t/nixos-cache-fetching-issue/3575/11
- https://discourse.nixos.org/t/newbie-question-cant-get-trivial-example-of-nixops-to-work-on-my-mac/1125/8
2021-01-16 19:11:10 +00:00
Domen Kožar
00f99fdfe6
Merge pull request #4240 from bburdette/2259-error-message
...
2259 error message - "auto-call" error
2021-01-15 18:26:21 +00:00
John Ericson
7af743470c
Make public keys and requireSigs local-store specific again
...
Thanks @regnat and @edolstra for catching this and comming up with the
solution.
They way I had generalized those is wrong, because local settings for
non-local stores is confusing default. And due to the nature of C++
inheritance, fixing the defaults is more annoying than it should be.
Additionally, I thought we might just drop the check in the substitution
logic since `Store::addToStore` is now streaming, but @regnat rightfully
pointed out that as it downloads dependencies first, that would still be
too late, and also waste effort on possibly unneeded/unwanted
dependencies.
The simple and correct thing to do is just make a store method for the
boolean logic, keeping all the setting and key stuff the way it was
before. That new method is both used by `LocalStore::addToStore` and the
substitution goal check. Perhaps we might eventually make it fancier,
e.g. sending the ValidPathInfo to remote stores for them to validate,
but this is good enough for now.
2021-01-15 16:37:41 +00:00
Jonathan Ringer
86a2ceeb98
Fix gcc10 build
2021-01-15 10:41:35 +01:00
John Ericson
0027b05a15
Merge remote-tracking branch 'upstream/master' into non-local-store-build
2021-01-15 02:01:24 +00:00
Eelco Dolstra
7a472a76d4
Add 'nix daemon' command
2021-01-14 00:05:04 +01:00
Eelco Dolstra
28ef6ebf91
Typo
2021-01-13 23:51:27 +01:00
Eelco Dolstra
d33eca8539
Rename 'nix store sign-paths' to 'nix store sign'
2021-01-13 23:32:37 +01:00
Eelco Dolstra
61216d32e1
Add 'nix store repair' command
2021-01-13 23:27:39 +01:00
Eelco Dolstra
3da9a9241c
Convert option descriptions to Markdown
2021-01-13 14:18:04 +01:00
Eelco Dolstra
4e9cec79bf
Merge pull request #4444 from matthewbauer/unset-curproc-arch-affinity
...
Set kern.curproc_arch_affinity=0 to escape Rosetta
2021-01-13 12:16:53 +01:00
Eelco Dolstra
fbfa70dc02
Merge pull request #4443 from rickynils/prefer-local-build-respect-zero-max-jobs
...
Don't let 'preferLocalBuild' override 'max-jobs=0'
2021-01-13 12:15:54 +01:00
Rickard Nilsson
0ca1a50132
Remove a redundant condition in DerivationGoal::tryLocalBuild()
2021-01-13 10:13:51 +01:00
Eelco Dolstra
2f463e90ed
Add 'nix profile history' command
...
Replaces 'nix-env --list-generations'. Similar to 'nix profile
diff-closures' but shows only the changes in top-level packages.
2021-01-12 23:53:53 +01:00
Eelco Dolstra
29007f8bc6
nix profile info -> nix profile list
2021-01-12 19:57:05 +01:00
Matthew Bauer
f69820417f
Set kern.curproc_arch_affinity=0 to escape Rosetta
...
By default, once you enter x86_64 Rosetta 2, macOS will try to run
everything in x86_64. So an x86_64 Nix will still try to use x86_64
even when system = aarch64-darwin. To avoid this we can set
kern.curproc_arch_affinity sysctl. With kern.curproc_arch_affinity=0,
we ignore this preference.
This is based on how
https://opensource.apple.com/source/system_cmds/system_cmds-880.40.5/arch.tproj/arch.c.auto.html
works. Completely undocumented, but seems to work!
Note, you can verify this works with this impure Nix expression:
```
{
a = derivation {
name = "a";
system = "aarch64-darwin";
builder = "/bin/sh";
args = [ "-e" (builtins.toFile "builder" ''
[ "$(/usr/bin/arch)" = arm64 ]
[ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ]
[ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ]
/usr/bin/touch $out
'') ];
};
b = derivation {
name = "b";
system = "x86_64-darwin";
builder = "/bin/sh";
args = [ "-e" (builtins.toFile "builder" ''
[ "$(/usr/bin/arch)" = i386 ]
[ "$(/usr/bin/arch -arch x86_64 /bin/sh -c /usr/bin/arch)" = i386 ]
[ "$(/usr/bin/arch -arch arm64 /bin/sh -c /usr/bin/arch)" = arm64 ]
/usr/bin/touch $out
'') ];
};
}
```
2021-01-11 22:40:21 -06:00
Rickard Nilsson
44fd7a05b6
Don't let 'preferLocalBuild' override 'max-jobs=0'
...
This resolves #3810 by changing the behavior of `max-jobs = 0`, so
that specifying the option also avoids local building of derivations
with the attribute `preferLocalBuild = true`.
2021-01-12 01:28:00 +01:00
Eelco Dolstra
6254b1f5d2
Add 'nix store delete' command
2021-01-11 19:46:59 +01:00
Eelco Dolstra
77c9ceda4b
Tweak
2021-01-11 19:42:24 +01:00
Eelco Dolstra
93ad6430ed
nix store prefetch-tarball -> nix flake prefetch
2021-01-11 12:36:39 +01:00
Eelco Dolstra
7480f2bf20
Merge pull request #4435 from DanilaFe/flake-input-types
...
Allow Flake inputs to accept boolean and integer attributes
2021-01-11 11:38:53 +01:00
Eelco Dolstra
fdcd62eec5
Add 'nix store gc' command
2021-01-10 23:29:14 +01:00
Danila and Eelco Dolstra
1db3f84bac
Upcase "Boolean" in Flake attribute type error
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2021-01-08 16:12:21 -08:00
Eelco Dolstra
e21aee58f6
Fix tests
2021-01-08 14:17:06 +01:00
Eelco Dolstra
17beae299d
Support binary unit prefixes in command line arguments
2021-01-08 12:51:19 +01:00
Eelco Dolstra
6548b89cc4
string2Int(): Return std::optional
2021-01-08 12:22:21 +01:00
Eelco Dolstra
29a445840a
Remove unused mkFlag1
2021-01-08 11:42:44 +01:00
Eelco Dolstra
1d4954e73e
Remove mkFlag integer specialisation
2021-01-08 11:40:36 +01:00
Eelco Dolstra
48a9be2aab
Remove mkIntFlag
2021-01-08 10:44:55 +01:00
Danila Fedorin
ba0f841a07
Use switch statement instead of sequence of ifs
2021-01-08 03:13:42 +00:00
Danila Fedorin
93f1678ec6
Allow Flake inputs to accept boolean and integer attributes
...
I believe that this makes it possible to do things like
Git inputs with submodules, but it also likely applies
to other input types from libfetchers.
2021-01-08 01:53:57 +00:00
Eelco Dolstra
920e6a6920
Merge pull request #4434 from NixOS/nix-prefetch
...
Add 'nix store prefetch-{file,tarball}'
2021-01-07 22:22:30 +01:00
Eelco Dolstra
0813350349
Add 'nix store prefetch-{file,tarball}'
...
These replace nix-prefetch-url and nix-prefetch-url --unpack,
respectively.
2021-01-07 21:51:46 +01:00
Eelco Dolstra
0df69d96e0
Make sodium a required dependency
2021-01-06 17:56:53 +01:00
Eelco Dolstra
9374c2baea
Add commands for generating secret/public keys
2021-01-06 17:49:31 +01:00
Eelco Dolstra
555152ffe8
crypto.cc: API cleanup and add generate() / to_string() methods
2021-01-06 17:04:46 +01:00
Eelco Dolstra
146af4ee9b
Move sodium_init() call
2021-01-06 16:43:09 +01:00
Eelco Dolstra
3edcb198e5
Merge pull request #4310 from matthewbauer/rosetta2-extra-platforms
...
Add x86_64-darwin and aarch64 to "extra-platforms" automatically when Rosetta2 is detected
2021-01-06 11:31:13 +01:00
Eelco Dolstra
8af4f886e2
Fix deadlock in LocalStore::addSignatures()
...
Fixes #4367 .
2021-01-05 11:47:29 +01:00
Eelco Dolstra
c51ee5c033
Merge pull request #4424 from DanilaFe/fix-attr-from-json
...
Fix conversion from JSON to fetch attributes
2021-01-05 11:14:22 +01:00
Danila Fedorin
988dd0a65f
Fix conversion from JSON to fetch attributes
...
It appears as through the fetch attribute, which
is simply a variant with 3 elements, implicitly
converts boolean arguments to integers. One must
use Explicit<bool> to correctly populate it with
a boolean. This was missing from the implementation,
and resulted in clearly boolean JSON fields being
treated as numbers.
2021-01-05 02:06:25 +00:00
Eelco Dolstra
8a2ce0f455
Merge pull request #4412 from acx0/fix-intro-doc
...
Fix `configure` error in introduction doc
2021-01-01 18:06:56 +01:00
Sam Lidder
e069ddf325
Fix configure error in introduction doc
2020-12-31 20:17:37 -05:00
Eelco Dolstra
368a972a38
Merge pull request #4411 from corngood/env-assert-fix
...
Fix insufficent attribute capacity in user profile
2020-12-30 21:47:21 +01:00
David McFarland
d27eb0ef57
Fix insufficent attribute capacity in user profile
2020-12-30 16:20:03 -04:00
Eelco Dolstra
bff706e27c
Merge pull request #4397 from matthewbauer/support-libcxx10
...
Cast variants fully for libc++10
2020-12-30 21:07:09 +01:00
Matthew Bauer
64904b9d5d
Fixup
2020-12-28 19:40:04 -06:00
Eelco Dolstra
abbf9df7b1
Merge pull request #4407 from cole-h/fix-hacking-link
...
README: fix link to hacking guide
2020-12-28 20:43:49 +01:00
Cole Helbling
093de16223
README: fix link to hacking guide
2020-12-28 09:30:14 -08:00
Eelco Dolstra
6262a70363
scanForReferences: Remove misleading comment
...
References have always been determined only by the hash part, not the
name or the store prefix.
Fixes #4396 .
2020-12-28 17:21:19 +01:00
Eelco Dolstra
5ef7e63ac6
Merge pull request #4399 from sevan/patch-1
...
Update URL where bzip2 can be obtained in docs
2020-12-28 13:15:23 +01:00
Eelco Dolstra
4465e0fbe7
Merge pull request #4400 from sevan/patch-2
...
Update URL where bzip2 can be obtained in configure script
2020-12-28 13:15:08 +01:00
Sevan Janiyan
f1e9bda9d1
Update URL where bzip2 can be obtained
2020-12-25 01:48:21 +00:00
Sevan Janiyan
9d3aad7b92
Update URL where bzip2 can be obtained
2020-12-25 01:43:22 +00:00
Matthew Bauer
ede534a3a1
Merge branch 'master' into support-libcxx10
2020-12-24 14:16:09 -06:00
Matthew Bauer
d4870462f8
Cast variants fully for libc++10
...
libc++10 seems to be stricter on what it allows in variant conversion.
I'm not sure what the rules are here, but this is the minimal change
needed to get through the compilation errors.
2020-12-23 23:41:58 -06:00
John Ericson
fed1237246
Test nix-build with non-local-store --store
...
Just a few small things needed fixing!
2020-12-23 22:42:06 +00:00
John Ericson
85f2e9e8fa
Expose schedule entrypoints to all stores
...
Remote stores still override so the other end schedules.
2020-12-23 22:42:06 +00:00
John Ericson
450c3500f1
Crudely make worker only provide a Store, not LocalStore
...
We downcast in a few places, this will be refactored to be better later.
2020-12-23 22:42:06 +00:00
John Ericson
12f7a1f65b
build-remote no longer requires local store be local
2020-12-23 22:42:06 +00:00
John Ericson
57062179ce
Move some PKI stuff from LocalStore to Store
2020-12-23 22:42:06 +00:00
John Ericson
29bd63e990
Test nix-instantiate with binary cache store
...
Trying to make sure it work with obscurers stores.
2020-12-23 22:42:06 +00:00
Eelco Dolstra
a93916b190
Merge pull request #4336 from NixOS/manpages
...
Documentation for nix subcommands
2020-12-23 21:10:32 +01:00
Eelco Dolstra
5178211e96
Add 'nix' manpage
2020-12-23 18:33:42 +01:00
Eelco Dolstra
26e502ceb5
Add TODO
2020-12-23 18:26:40 +01:00
Eelco Dolstra
1047cb1e53
Command: Remove examples()
2020-12-23 18:26:40 +01:00
Eelco Dolstra
c9279b831e
Add 'nix flake' manpages
2020-12-23 18:26:40 +01:00
Eelco Dolstra
8927cba62f
Merge pull request #4366 from NixOS/readInvalidDerivation-on-remote-caches
...
Use the fs accessor for readInvalidDerivation
2020-12-23 11:55:52 +01:00
Eelco Dolstra
f4a9fb67da
Merge branch 'git-rev-error' of https://github.com/Ma27/nix into master
2020-12-22 16:39:32 +01:00
Eelco Dolstra
e27044216b
Fix tests
2020-12-22 16:23:57 +01:00
Eelco Dolstra
75efa42134
Move <nix/fetchurl.nix> into the nix binary
...
This makes the statically linked nix binary just work, without needing
any additional files.
2020-12-22 14:43:20 +01:00
Eelco Dolstra
5373f4be3b
chrootHelper: Handle symlinks in the root directory
...
This is necessary on Ubuntu where /bin and /lib* are symlinks.
2020-12-22 12:28:50 +01:00
Maximilian Bosch
897ae235fc
tests/fetchGit: test behavior of allRefs = true;
2020-12-22 12:18:10 +01:00
Maximilian Bosch
e54971d019
Document allRefs argument of builtins.fetchTree
2020-12-22 12:02:08 +01:00
Eelco Dolstra
724b7f4fb6
Don't log from inside the logger
...
This deadlocks ProgressBar, e.g.
# nix run --impure --no-substitute --store '/tmp/nix2?store=/foo' --expr 'derivation { builder = /nix/store/zi90rxslsm4mlr46l2xws1rm94g7pk8p-busybox-1.31.1-x86_64-unknown-linux-musl/bin/busybox; }'
leads to
Thread 1 (Thread 0x7ffff6126e80 (LWP 12250)):
#0 0x00007ffff7215d62 in __lll_lock_wait () from /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/libpthread.so.0
#1 0x00007ffff720e721 in pthread_mutex_lock () from /nix/store/9df65igwjmf2wbw0gbrrgair6piqjgmi-glibc-2.31/lib/libpthread.so.0
#2 0x00007ffff7ad17fa in __gthread_mutex_lock (__mutex=0x6c5448) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/x86_64-unknown-linux-gnu/bits/gthr-default.h:749
#3 std::mutex::lock (this=0x6c5448) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/std_mutex.h:100
#4 std::unique_lock<std::mutex>::lock (this=0x7fffffff09a8, this=0x7fffffff09a8) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/unique_lock.h:141
#5 std::unique_lock<std::mutex>::unique_lock (__m=..., this=0x7fffffff09a8) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/bits/unique_lock.h:71
#6 nix::Sync<nix::ProgressBar::State, std::mutex>::Lock::Lock (s=0x6c5448, this=0x7fffffff09a0) at src/libutil/sync.hh:45
#7 nix::Sync<nix::ProgressBar::State, std::mutex>::lock (this=0x6c5448) at src/libutil/sync.hh:85
#8 nix::ProgressBar::logEI (this=0x6c5440, ei=...) at src/libmain/progress-bar.cc:131
#9 0x00007ffff7608cfd in nix::Logger::logEI (ei=..., lvl=nix::lvlError, this=0x6c5440) at src/libutil/logging.hh:88
#10 nix::getCodeLines (errPos=...) at src/libutil/error.cc:66
#11 0x00007ffff76073f2 in nix::showErrorInfo (out=..., einfo=..., showTrace=<optimized out>) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/optional:897
#12 0x00007ffff7ad19e7 in nix::ProgressBar::logEI (this=0x6c5440, ei=...) at src/libmain/progress-bar.cc:134
#13 0x00007ffff7ab9d10 in nix::Logger::logEI (ei=..., lvl=nix::lvlError, this=0x6c5440) at src/libutil/logging.hh:88
#14 nix::handleExceptions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()>) (programName="/home/eelco/Dev/nix/outputs/out/bin/nix", fun=...) at src/libmain/shared.cc:328
#15 0x000000000046226b in main (argc=<optimized out>, argv=<optimized out>) at /nix/store/h31cy7jm6g7cfqbhc5pm4rf9c53i3qfb-gcc-9.3.0/include/c++/9.3.0/ext/new_allocator.h:80
2020-12-22 11:15:29 +01:00
Maximilian Bosch
2857b1baaf
Add explicit allRefs = true; argument to fetchGit
...
Sometimes it's necessary to fetch a git repository at a revision and
it's unknown which ref contains the revision in question. An example
would be a Cargo.lock which only provides the URL and the revision when
using a git repository as build input.
However it's considered a bad practice to perform a full checkout of a
repository since this may take a lot of time and can eat up a lot of
disk space. This patch makes a full checkout explicit by adding an
`allRefs` argument to `builtins.fetchGit` which fetches all refs if
explicitly set to true.
Closes #2409
2020-12-22 10:46:00 +01:00
Maximilian Bosch
629af83b2d
Provide a more meaningful error-message for builtins.fetchGit if a revision can't be checked out
...
A common pitfall when using e.g. `builtins.fetchGit` is the `fatal: not
a tree object`-error when trying to fetch a revision of a git-repository
that isn't on the `master` branch and no `ref` is specified.
In order to make clear what's the problem, I added a simple check
whether the revision in question exists and if it doesn't a more
meaningful error-message is displayed:
```
nix-repl> builtins.fetchGit { url = "https://github.com/owner/myrepo "; rev = "<commit not on master>"; }
moderror: --- Error -------------------------------------------------------------------- nix
Cannot find Git revision 'bf1cc5c648e6aed7360448a3745bb2fe4fbbf0e9' in ref 'master' of repository 'https://gitlab.com/Ma27/nvim.nix '! Please make sure that the rev exists on the ref you've specified or add allRefs = true; to fetchGit.
```
Closes #2431
2020-12-22 10:46:00 +01:00
Eelco Dolstra
16e34085e8
Add 'nix profile' manpage
2020-12-21 13:32:29 +01:00
Eelco Dolstra
0c09f63de8
Add 'nix bundle' manpage
...
Fixes #4375 .
2020-12-21 13:32:29 +01:00
Eelco Dolstra
f4e9d4fcb3
Add 'nix store diff-closures' manpage
2020-12-21 13:32:29 +01:00
Eelco Dolstra
4f3e7f4eec
Add 'nix show-derivation' manpage
2020-12-21 13:32:29 +01:00
Eelco Dolstra
3b123a6ee6
nix show-derivation: Say "system" instead of "platform"
...
There is really no good reason to use "platform" except that that's
what we use internally (also for no good reason).
2020-12-21 13:32:29 +01:00
Eelco Dolstra
daf365b0b7
Add 'nix help' manpage
2020-12-21 13:32:29 +01:00
Eelco Dolstra
e6bea9c9b1
Add 'nix store make-content-addressable' manpage
2020-12-21 13:32:29 +01:00
Eelco Dolstra
cdf20e04b7
Doh
2020-12-21 13:32:29 +01:00
Eelco Dolstra
2e599dbb88
Add 'nix path-info' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
cb25a89f1c
Add 'nix store optimise' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
8dd7d7e9db
Add 'nix store verify' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
6b32551aba
Add 'nix upgrade-nix' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
19540744ad
Add 'nix why-depends' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
c14ed3f8b2
Add 'nix store' NAR-related manpages
2020-12-21 13:32:28 +01:00
Eelco Dolstra
2cc02bbe76
Add 'nix nar' manpages
2020-12-21 13:32:28 +01:00
Eelco Dolstra
a407d14339
Add 'nix eval' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
53ce20eab7
Add 'nix store ping' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
f34b1801a4
Tweak
2020-12-21 13:32:28 +01:00
Eelco Dolstra
58bacc85e7
Add 'nix log' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
6ce393392b
Add 'nix repl' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
b2262be19b
Add 'nix edit' manpage
2020-12-21 13:32:28 +01:00
Eelco Dolstra
4e065229c7
Typo
2020-12-21 13:32:27 +01:00
Eelco Dolstra
e90e745232
Add 'nix registry' manpages
...
This also documents the registry format and matching/unification
semantics (though not quite correctly).
2020-12-21 13:32:27 +01:00
Eelco Dolstra
42cc98f8d6
Add 'nix develop' and `nix print-dev-env' manpages
2020-12-21 13:32:27 +01:00
Eelco Dolstra
e9de689a6e
Add 'nix search' manpage
2020-12-21 13:32:27 +01:00
Eelco Dolstra
28ee307fd8
Add 'nix copy' manpage
2020-12-21 13:32:27 +01:00
Eelco Dolstra
9dcd0aebc5
generate-manpage.nix: Fix short names
2020-12-21 13:32:27 +01:00
Eelco Dolstra
09660b8557
Add 'nix run' and 'nix shell' manpages
2020-12-21 13:32:27 +01:00
Eelco Dolstra
ae7351dbee
Add 'nix build' manpage
2020-12-21 13:32:27 +01:00
Eelco Dolstra
346baec783
Move doc() to Args
2020-12-21 13:32:23 +01:00
Eelco Dolstra
9fab14adbc
Merge pull request #4385 from obsidiansystems/store-subclass
...
Overhaul store subclassing
2020-12-21 12:51:36 +01:00
Eelco Dolstra
ec4a5c5b0b
Merge pull request #4355 from Infinisil/private-value-type
...
Refactoring for private Value type
2020-12-21 12:38:47 +01:00
John Ericson
1a1af75338
Overhaul store subclassing
...
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-20 15:47:14 +00:00
Silvan Mosberger
b70d22baca
Replace Value type setters with mk* functions
...
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-18 21:48:22 +01:00
Eelco Dolstra
ec3e202832
Merge pull request #4302 from garbas/cli-guideline
...
Adds Nix CLI Guideline to docs
2020-12-18 12:59:37 +01:00
Rok Garbas
7de4b1e9aa
smaller fixes
2020-12-17 23:42:49 +01:00
Rok Garbas
bdd05a1730
Merge remote-tracking branch 'origin/master' into cli-guideline
2020-12-17 23:38:36 +01:00
Silvan Mosberger
12e65078ef
Rename Value::normalType() -> Value::type()
2020-12-17 14:45:45 +01:00
Silvan Mosberger
d67e02919c
Rename ValueType -> InternalType, NormalType -> ValueType
...
And Value::type to Value::internalType, such that type() can be used in
the next commit to get the new ValueType
2020-12-17 14:45:22 +01:00
Eelco Dolstra
26e189c3f8
Merge pull request #4378 from NixOS/fix-master-build
...
Fix the detection of already built drv outputs
2020-12-17 14:12:28 +01:00
regnat
4d45839499
Fix the detection of already built drv outputs
...
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-17 11:35:24 +01:00
Eelco Dolstra
ae3c3e3bb2
Merge pull request #4370 from NixOS/ca/more-precise-build-noop
...
Better detect when `buildPaths` would be a no-op
2020-12-16 14:54:04 +01:00
Eelco Dolstra
fdc8e7cbe7
Merge pull request #4373 from NixOS/ca/fix-queryPartialDrvOutputMap-when-no-derivation
...
Don't ignore an absent drv file in queryPartialDrvOutputMap
2020-12-16 14:52:39 +01:00
regnat
cac8d5b742
Don't ignore an absent drv file in queryPartialDrvOutputMap
...
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-16 13:36:17 +01:00
Eelco Dolstra
3765174691
Merge pull request #4348 from NixOS/ca/use-hashmodulo
...
Use the hash modulo in the derivation outputs
2020-12-16 12:48:44 +01:00
Eelco Dolstra
c64208d6f8
Merge pull request #4371 from NixOS/ca/fix-remote-store-registerDrvOutput
...
Fix BinaryCacheStore::registerDrvOutput
2020-12-16 12:47:32 +01:00
regnat
962b82ef25
Fix BinaryCacheStore::registerDrvOutput
...
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-16 10:54:36 +01:00
regnat
6e899278d3
Better detect when buildPaths would be a no-op
...
`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-16 10:36:16 +01:00
regnat
7080321618
Use the fs accessor for readInvalidDerivation
...
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-15 20:10:46 +01:00
Eelco Dolstra
e3ddffb27e
Merge pull request #4361 from tweag/fix-binary-caches-addTextToStore
...
Fix `addTextToStore` for binary caches
2020-12-15 12:23:10 +01:00
regnat
44c3fbc6e0
Fix addTextToStore for binary caches
...
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-15 09:38:19 +01:00
Eelco Dolstra
f2f60bf5d6
Merge pull request #4330 from NixOS/ca/properly-store-outputs
...
Properly store the outputs of CA derivations − take 2
2020-12-14 15:01:23 +01:00
Eelco Dolstra
27b5ff354e
Merge pull request #4351 from Ma27/json-errtrace
...
primops/fromJSON: add error position in case of parse error
2020-12-14 11:27:44 +01:00
Maximilian Bosch
f890830b33
primops/fromJSON: add error position in case of parse error
...
This makes it easier to track down where invalid JSON was passed to
`builtins.fromJSON`.
2020-12-13 13:55:32 +01:00
Eelco Dolstra
92438c70d2
Merge pull request #4352 from jonringer/allow-private-caches
...
treat s3 permission errors as file-not-found
2020-12-13 13:39:20 +01:00
Silvan Mosberger
730b152b19
Make Value::type private
...
This is an implementation detail and shouldn't be used. Use normalType()
and the various is<Type> functions instead
2020-12-12 03:31:52 +01:00
Silvan Mosberger
bf98903967
Add ValueType checking functions for types that have the same NormalType
2020-12-12 03:31:50 +01:00
Silvan Mosberger
22ead43a0b
Use Value::normalType on all forced values instead of Value::type
2020-12-12 03:31:48 +01:00
Silvan Mosberger
9f056f7afd
Introduce Value type setters and make use of them
2020-12-12 03:31:48 +01:00
Silvan Mosberger
fa307875e9
Introduce NormalType for the normal type of a Value
...
This will be useful to abstract over the ValueType implementation
details
Make use of it already to replace the showType(ValueType) function
2020-12-12 03:31:46 +01:00
regnat
e9b39f6004
Restrict the operations on drv outputs in recursive Nix
...
There's currently no way to properly filter them, so disallow them
altogether instead.
2020-12-11 21:17:25 +01:00
regnat
bab1cda0e6
Use the hash modulo in the derivation outputs
...
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-11 21:17:23 +01:00
regnat
8914e01e37
Store the realisations as JSON in the binary cache
...
Fix #4332
2020-12-11 21:05:09 +01:00
regnat
3ac9d74eb1
Rework the db schema for derivation outputs
...
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-11 20:41:32 +01:00
regnat
58cdab64ac
Store metadata about drv outputs realisations
...
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-11 20:41:32 +01:00
Michael Bishop
63b3536f50
treat s3 permission errors as file-not-found
...
Signed-off-by: Jonathan Ringer <jonringer117@gmail.com >
2020-12-11 09:49:24 -08:00
Eelco Dolstra
9c143c411b
Merge pull request #4350 from NixOS/ca/fix-build-with-nix-command
...
Fix the `nix` command with CA derivations
2020-12-11 15:01:49 +01:00
regnat
eb45308109
Fix the nix command with CA derivations
...
Prevents a crash because most `nix` subcommands assumed that derivations
know their output path, which isn't the case for CA derivations
2020-12-11 10:28:09 +01:00
Eelco Dolstra
c6a1bcd0ec
nix store make-content-addressable: Show rewritten path
2020-12-10 17:11:56 +01:00
Eelco Dolstra
a8f533b664
Add lvlNotice log level
...
This is like syslog's LOG_NOTICE: "normal, but significant,
condition".
2020-12-10 16:41:24 +01:00
Eelco Dolstra
29fbc3cf31
Merge pull request #4343 from tweag/fix-osx-ci
...
Use no substituers by default in the tests
2020-12-09 20:38:06 +01:00
regnat
5286310e59
Use no substituers by default in the tests
...
Otherwise https://cache.nixos.org is chosen by default, causing the OSX
testsuite to hang inside the sandbox.
(In a way, this is probably rugging an actual bug under the carpet as
Nix should be able to gracefully timeout in such a case, but that's
beyond mac OSX-fu)
2020-12-09 14:53:45 +01:00
Eelco Dolstra
253571e4ec
Merge pull request #4342 from tweag/fix-remote-build-hook
...
fix remote build hook
2020-12-09 12:40:00 +01:00
Eelco Dolstra
eb458ad1b2
Merge pull request #4319 from Ma27/store-v6-addr
...
libstore/openStore: fix stores with IPv6 addresses
2020-12-09 12:38:04 +01:00
Maximilian Bosch
93a8a005de
libstore/openStore: fix stores with IPv6 addresses
...
In `nixStable` (2.3.7 to be precise) it's possible to connect to stores
using an IPv6 address:
nix ping-store --store ssh://root@2001:db8::1
This is also useful for `nixops(1)` where you could specify an IPv6
address in `deployment.targetHost`.
However, this behavior is broken on `nixUnstable` and fails with the
following error:
$ nix store ping --store ssh://root@2001:db8::1
don't know how to open Nix store 'ssh://root@2001:db8::1'
This happened because `openStore` from `libstore` uses the `parseURL`
function from `libfetchers` which expects a valid URL as defined in
RFC2732. However, this is unsupported by `ssh(1)`:
$ nix store ping --store 'ssh://root@[2001:db8::1]'
cannot connect to 'root@[2001:db8::1]'
This patch now allows both ways of specifying a store (`root@2001:db8::1`) and
also `root@[2001:db8::1]` since the latter one is useful to pass query
parameters to the remote store.
In order to achieve this, the following changes were made:
* The URL regex from `url-parts.hh` now allows an IPv6 address in the
form `2001:db8::1` and also `[2001:db8::1]`.
* In `libstore`, a new function named `extractConnStr` ensures that a
proper URL is passed to e.g. `ssh(1)`:
* If a URL looks like either `[2001:db8::1]` or `root@[2001:db8::1]`,
the brackets will be removed using a regex. No additional validation
is done here as only strings parsed by `parseURL` are expected.
* In any other case, the string will be left untouched.
* The rules above only apply for `LegacySSHStore` and `SSHStore` (a.k.a
`ssh://` and `ssh-ng://`).
Unresolved questions:
* I'm not really sure whether we want to allow both variants of IPv6
addresses in the URL parser. However it should be noted that both seem
to be possible according to RFC2732:
> This document incudes an update to the generic syntax for Uniform
> Resource Identifiers defined in RFC 2396 [URL]. It defines a syntax
> for IPv6 addresses and allows the use of "[" and "]" within a URI
> explicitly for this reserved purpose.
* Currently, it's not supported to specify a port number behind the
hostname, however it seems as this is not really supported by the URL
parser. Hence, this is probably out of scope here.
2020-12-09 12:23:29 +01:00
regnat
c87267c2a4
Store the final drv outputs in memory when building remotely
...
The `DerivationGoal` has a variable storing the “final” derivation
output paths that is used (amongst other things) to fill the environment
for the post build hook. However this variable wasn't set when the
build-hook is used, causing a crash when both hooks are used together.
Fix this by setting this variable (from the informations in the db) after a run
of the post build hook.
2020-12-09 10:45:12 +01:00
regnat
ee7c94fa1b
Test the post-build-hook with remote builders
...
Regression test for #4245
2020-12-09 10:45:12 +01:00
regnat
6758e65612
Revert "Re-query for the derivation outputs in the post-build-hook"
...
This reverts commit 1b1e076033 .
Using `queryPartialDerivationOutputMap` assumes that the derivation
exists locally which isn't the case for remote builders.
2020-12-09 09:44:07 +01:00
Eelco Dolstra
82e5511594
Merge pull request #4325 from tweag/hide-local-store-sql-statements
...
Hide the sqlite statements declarations for the local store
2020-12-08 14:04:16 +01:00
regnat
c0f21f08f8
Hide the sqlite statements declarations for the local store
...
These have no need to be in the public interface and it causes spurious
rebuilds each time one wants to add or remove a new statement.
2020-12-08 13:29:13 +01:00
Rok Garbas
ae77f21474
Switch away from classification as Tier1-3
...
to classification to a more descriptive classification.
2020-12-08 11:59:23 +01:00
Eelco Dolstra
500161b970
Merge pull request #4326 from tweag/fix-post-build-hook-and-remote-builders
...
Re-query for the derivation outputs in the post-build-hook
2020-12-08 11:47:47 +01:00
regnat
1b1e076033
Re-query for the derivation outputs in the post-build-hook
...
We can't assume that the runtime state knows about them as they might have
been built remotely, in which case we must query the db again to get
them.
2020-12-08 11:11:02 +01:00
Rok Garbas
d948b10c3a
Merge remote-tracking branch 'origin/master' into cli-guideline
2020-12-08 10:25:25 +01:00
Rok Garbas
0d7714b0d7
forgot to add the files
2020-12-08 10:25:03 +01:00
Eelco Dolstra
97dc44f3d6
Merge pull request #4305 from matthewbauer/rosetta2-check
...
Check for rosetta 2 support before installing x86_64-darwin Nix
2020-12-07 15:59:56 +01:00
Rok Garbas
24db5b125f
Merge remote-tracking branch 'origin/master' into cli-guideline
2020-12-07 15:13:36 +01:00
Eelco Dolstra
8a06edbf7e
Merge pull request #4321 from matthewbauer/always-default-cache-nixos-org
...
Always default to cache.nixos.org even when different nix store dir
2020-12-07 11:05:07 +01:00
Matthew Bauer
aa07502009
Always default to cache.nixos.org even when different nix store dir
...
Since 0744f7f , it is now useful to have cache.nixos.org in substituers
even if /nix/store is not the Nix Store Dir. This can always be
overridden via configuration, though.
2020-12-06 23:04:42 -06:00
Eelco Dolstra
1d1a85eb0a
Merge pull request #4318 from matthewbauer/add-slash-to-trusted-binary-cache
...
Canonicalize binary caches with ‘/’ when one is missing
2020-12-05 10:17:17 +01:00
Eelco Dolstra
a5d85d07fa
Merge pull request #4316 from stephank/aws-sdk-compat
...
Fix compatibility with newer AWS SDKs
2020-12-05 10:16:19 +01:00
Matthew Bauer
b9a00fd15b
Canonicalize binary caches with ‘/’ when one is missing
...
This checks if there is a trusted substituter with a slash, so
trusting https://cache.nixos.org also implies https://cache.nixos.org/
is trusted.
2020-12-04 22:17:19 -06:00
Matthew Bauer
692549c542
Use com.apple.oahd.plist for rosetta 2 detection
2020-12-04 13:28:09 -06:00
Matthew Bauer
3c9b7029ba
Use com.apple.oahd.plist for rosetta 2 detection
2020-12-04 13:26:53 -06:00
Stéphan Kochen
e20a3ec756
Fix compatibility with newer AWS SDKs
...
Tested against AWS SDK 1.8.99. Fixes #3201 .
2020-12-04 19:36:09 +01:00
Eelco Dolstra
45645b6f3b
Merge pull request #4314 from tweag/less-noisy-make-doc
...
Make `make install` less noisy
2020-12-04 15:02:37 +01:00
regnat
5f66edf245
Make make install less noisy
...
Remove the printing and useless output of a couple of commands when running `make install`
2020-12-04 14:50:47 +01:00
Eelco Dolstra
d94239c979
Merge pull request #4311 from matthewbauer/static-nix-support
...
Include static "nix" binary in Hydra build products
2020-12-04 12:33:21 +01:00
Matthew Bauer
be09af8002
Include static "nix" binary in Hydra build products
...
This allows users to get Nix from Hydra via a stable url like
https://hydra.nixos.org/build/132078238/download/1/nix
2020-12-03 18:05:18 -06:00
Eelco Dolstra
f337aa7099
Split 'nix store add-to-store' into 'add-path' and 'add-file'
...
This makes it consistent with 'nix hash <path|file>'.
2020-12-04 00:59:24 +01:00
Eelco Dolstra
8df58eae4c
Merge pull request #3858 from edolstra/group-commands
...
Group 'nix' subcommands
2020-12-03 23:55:28 +01:00
Eelco Dolstra
fa8dad10ed
Typo
2020-12-03 23:26:23 +01:00
Eelco Dolstra
ea2062a2d9
Move most store-related commands to 'nix store'
2020-12-03 23:22:22 +01:00
Eelco Dolstra
a1cd805cba
Add 'nix nar dump-path'
...
This only differs from 'nix store dump-path' in that the path doesn't
need to be a store path.
2020-12-03 22:52:01 +01:00
Eelco Dolstra
af373c2ece
Add deprecated aliases for renamed commands
2020-12-03 22:45:44 +01:00
Matthew Bauer
4b9acf4e21
Use posix_spawn_setbinpref_np to advise which architecture to run
...
When running universal binaries like /bin/bash, Darwin XNU will choose
which architecture of the binary to use based on "binary preferences".
This change sets that to the current platform for aarch64 and x86_64
builds. In addition it now uses posix_spawn instead of the usual
execve. Note, that this does not prevent the other architecture from
being run, just advises which to use.
Unfortunately, posix_spawnattr_setbinpref_np does not appear to be
inherited by child processes in x86_64 Rosetta 2 translations, meaning
that this will not always work as expected.
For example:
{
arm = derivation {
name = "test";
system = "aarch64-darwin";
builder = "/bin/bash";
args = [ "-e" (builtins.toFile "test" ''
set -x
/usr/sbin/sysctl sysctl.proc_translated
/usr/sbin/sysctl sysctl.proc_native
[ "$(/usr/bin/arch)" = arm64 ]
/usr/bin/touch $out
'') ];
};
rosetta = derivation {
name = "test";
system = "x86_64-darwin";
builder = "/bin/bash";
args = [ "-e" (builtins.toFile "test" ''
set -x
/usr/sbin/sysctl sysctl.proc_translated
/usr/sbin/sysctl sysctl.proc_native
[ "$(/usr/bin/arch)" = i386 ]
echo It works!
/usr/bin/touch $out
'') ];
};
}
`arm' fails on x86_64-compiled Nix, but `arm' and `rosetta' succeed on
aarch64-compiled Nix. I suspect there is a way to fix this since:
$ /usr/bin/arch -arch x86_64 /bin/bash \
-c '/usr/bin/arch -arch arm64e /bin/bash -c /usr/bin/arch'
arm64
seems to work correctly. We may need to wait for Apple to update
system_cmds in opensource.apple.com to find out how though.
2020-12-03 15:41:59 -06:00
Matthew Bauer
9b1824ecbd
Add extraPlatforms for Rosetta 2 macOS
...
macOS systems with ARM64 can utilize a translation layer at
/Library/Apple/usr/libexec/oah to run x86_64 binaries. This change
makes Nix recognize that and it to "extra-platforms". Note that there
are two cases here since Nix could be built for either x86_64 or
aarch64. In either case, we can switch to the other architecture.
Unfortunately there is not a good way to prevent aarch64 binaries from
being run in x86_64 contexts or vice versa - programs can always
execute programs for the other architecture.
2020-12-03 15:41:43 -06:00
Eelco Dolstra
0c15ae5d4b
Add FIXME
2020-12-03 20:31:45 +01:00
Eelco Dolstra
ef583303f0
Move NAR-related commands to 'nix nar'
2020-12-03 18:09:02 +01:00
Eelco Dolstra
79c1967ded
Introduce 'nix store' command
2020-12-03 18:07:13 +01:00
Eelco Dolstra
5781f45c46
Allow registering subcommands of subcommands
2020-12-03 17:55:55 +01:00
Eelco Dolstra
b2d6c6161e
Move 'nix hash-*' and 'nix to-*' to 'nix hash'
...
From the 'nix' UX review.
2020-12-03 17:55:55 +01:00
Eelco Dolstra
8ad2c9c4b9
Remove 'dist' target
...
We're not producing source tarballs anymore so this has been
bitrotting.
2020-12-03 16:17:58 +01:00
Eelco Dolstra
1b0ca3866b
nix add-to-store: Move markdown docs into a separate file
2020-12-03 16:17:58 +01:00
Eelco Dolstra
c3c858ac6d
Make doc() return arbitrary Markdown rather than the contents of the "Description" section
...
Thus we can return the examples section (and any other sections) from
doc() and don't need examples() anymore.
2020-12-03 16:17:58 +01:00
Eelco Dolstra
0bd060f23a
Merge pull request #4308 from tweag/properly-test-early-cutoff
...
Properly test the early cutoff for CA derivations
2020-12-03 14:45:29 +01:00
Eelco Dolstra
4f25644a13
Merge pull request #4304 from NixOS/separate-manpages
...
Separate manpages for 'nix' subcommands
2020-12-03 13:38:29 +01:00
regnat
8ad72b1f1c
Properly test early cutoff with CA derivations
...
Build things with a different seed each time to make sure that it works
despite the different drvs
2020-12-03 13:31:07 +01:00
regnat
0afab668fa
Don't fail early when -j0 is passed
...
If the build closure contains some CA derivations, then we can't know
ahead-of-time that we won't build anything as early-cutoff might come-in
at a laster stage
2020-12-03 13:24:36 +01:00
Eelco Dolstra
7cb341ceb5
Merge pull request #4307 from matthewbauer/update-config-guess
...
Update config.guess & config.sub for proper arm64 macOS detection
2020-12-03 10:46:06 +01:00
Matthew Bauer
94f359525e
Update config.guess for proper arm64 macOS detection
...
This fixes results for arm64 macOS so config.guess now reports:
aarch64-apple-darwin20.1.0
instead of
arm-apple-darwin20.1.0
2020-12-02 19:14:34 -06:00
Matthew Bauer
addf9f4ede
Call it aarch64-darwin instead of arm64-darwin
...
gnu-config standardized on aarch64 for machine name so host_cpu part
of $system will always be aarch64. That means system will be
aarch64-darwin too.
uname however could report either “aarch64” (if gnu coreutils) or
“arm64” (if apple’s uname). We should support both for compatiblity
here.
2020-12-02 19:05:02 -06:00
Matthew Bauer
b0de7b2016
Check for rosetta 2 support before installing
2020-12-02 18:35:48 -06:00
Eelco Dolstra
6ed09cb8c2
Merge pull request #4301 from imalsogreg/tokens-doc-fix
...
fix tokens documentation
2020-12-02 23:42:36 +01:00
Eelco Dolstra
e2efc63979
Put examples first in the manpages
2020-12-02 23:23:23 +01:00
Eelco Dolstra
72428e38d9
Generate separate manpages for each nix subcommand
2020-12-02 23:23:23 +01:00
Eelco Dolstra
df552a2645
nix eval: Add option to write a directory
...
This is useful for generating the nix manpages, but it may have other
applications (like generating configuration files without a Nix store).
2020-12-02 23:23:23 +01:00
Eelco Dolstra
148608ba6d
Add 'nix help'
2020-12-02 23:23:23 +01:00
Rok Garbas
44da19f73c
Adds Nix CLI Guideline to docs
...
As we are working towards Nix 3.0 we want to make sure that we make a
huge step forward in Nix's user experience. And once 3.0 is out of the
door we need to make sure that all future commands and features keep up
the standard of user experience.
This PR adds a CLI guideline document to the Nix documentation. Consider
this document a good starting point and a checklist when somebody will
be (re)implementing commands.
Clearly this guideline does nothing to improve user experience on its
own and can only be useful as long as it is going to be read and
cared for. But it is a first step into that direction.
2020-12-02 17:00:32 +01:00
Greg Hale
d8fc1bb7b0
fix tokens documentation
2020-12-02 10:15:18 -05:00
Eelco Dolstra
9daf713bcb
Merge pull request #4300 from tweag/remove-unknown-pragma-warning
...
Remove `unknown pragma` gcc warning
2020-12-02 15:22:00 +01:00
regnat
0d9e1af695
Remove an unknown pragma gcc warning
2020-12-02 14:33:20 +01:00
regnat
a8a96dbaf8
Add forgotten override annotation
2020-12-02 14:23:38 +01:00
Eelco Dolstra
1b79b5b983
read(): Use char * instead of unsigned char *
...
This gets rid of some pointless casts.
2020-12-02 14:17:27 +01:00
Eelco Dolstra
faa31f4084
Sink: Use std::string_view
2020-12-02 14:17:27 +01:00
Eelco Dolstra
aa68486112
writeFull/writeFile: Use std::string_view
2020-12-02 14:17:27 +01:00
Eelco Dolstra
e5cf501c77
Merge pull request #4284 from tweag/fixed-output-depending-on-ca
...
Allow fixed-output derivations to depend on (floating) content-addressed ones
2020-12-01 20:25:41 +01:00
Eelco Dolstra
5a6ddb3de1
Merge pull request #4297 from tweag/fix-clang-warnings
...
shut up clang warnings
2020-12-01 15:48:52 +01:00
regnat
438977731c
shut up clang warnings
...
- Fix some class/struct discrepancies
- Explicit the overloading of `run` in the `Cmd*` classes
- Ignore a warning in the generated lexer
2020-12-01 15:04:03 +01:00
Eelco Dolstra
88798613ee
replaceStrings(): Use std::string_view
2020-12-01 13:45:43 +01:00
Eelco Dolstra
c0d1354b7d
Macro hygiene
2020-12-01 13:45:06 +01:00
Eelco Dolstra
3b7e00ce22
Move primeCache() to Worker::run()
...
We need the missing path info to communicate the worker's remaining
goals to the progress bar.
2020-12-01 13:44:48 +01:00
Eelco Dolstra
5927624473
Lower verbosity for 'Failed to find a machine' message
2020-12-01 13:43:36 +01:00
Eelco Dolstra
e224c16d28
Macro hygiene
2020-12-01 13:43:33 +01:00
regnat
9bd8184f1f
Allow fixed-output derivations to depend on (floating) content-addressed ones
...
Fix an overlook of https://github.com/NixOS/nix/pull/4056
2020-11-27 15:39:24 +01:00
Eelco Dolstra
05d9442f68
builtins.fetchGit: Fix shortRev attribute for dirty trees
2020-11-26 21:45:28 +01:00
Eelco Dolstra
2458270b69
Merge pull request #4094 from martinetd/btrfs
...
preallocateContents option: disable by default
2020-11-26 15:01:43 +01:00
Dominique Martinet
1fd13d67e8
archive: disable preallocate-contents by default
...
using fallocate() to preallocate files space does more harm than good:
- breaks compression on btrfs
- has been called "not the right thing to do" by xfs developers
(because delayed allocation that most filesystems implement leads to smarter
allocation than what the filesystem needs to do if we upfront fallocate files)
2020-11-26 14:26:57 +01:00
Eelco Dolstra
8252a44e96
Move to separate file
2020-11-26 13:16:36 +01:00
Eelco Dolstra
9a586e34ac
Record trusted/untrusted settings in ~/.local/share/nix
2020-11-26 13:11:07 +01:00
Eelco Dolstra
0287f83057
Ask for confirmation before allowing flake Nix configuration settings
2020-11-26 12:37:23 +01:00
regnat
13c557fe82
fix the hash rewriting for ca-derivations
2020-11-25 11:33:00 +01:00
Lily Ballard
437189e446
Escape filename given to nix-shell in shebang mode
...
This prevents spaces or other metacharacters from causing nix-shell to
execute the wrong path.
Fixes #4229 .
2020-11-24 15:08:37 -08:00
Eelco Dolstra
605bacdc92
Merge pull request #4276 from B4dM4n/macos-sandbox-build
...
Fix macOS sandbox build
2020-11-23 18:00:35 +01:00
Eelco Dolstra
eb6b9bd672
Merge pull request #4275 from lukegb/mercurialHGPLAIN
...
fetchMercurial: set HGPLAIN when invoking hg
2020-11-23 17:59:26 +01:00
Fabian Möller
5b0790355f
Fix macOS sandbox build
...
Since c4c3c15c19 (#4251 ) building Nix for
macOS with sandboxing fails:
```
getting status of /nix/var/nix/profiles/per-user/root/channels/nixpkgs: Operation not permitted
```
This happens, because `EvalSettings::getDefaultNixPath` tries to access
paths outside the sandbox. Since the state-dir is not required for
doc generation, it is set to the dummy folder. This needs to be done
for all nix invocations during doc generation, as
`EvalSettings::getDefaultNixPath` is called unconditionally.
2020-11-23 17:40:17 +01:00
Luke Granger-Brown
226116f482
fetchMercurial: set HGPLAIN when invoking hg
...
Without setting HGPLAIN, the user's environment leaks into
hg invocations, which means that the output may not be in the
expected format.
HGPLAIN is the Mercurial-recommended solution for this in that
it's intended for uses by scripts and programs which are looking
to parse Mercurial's output in a consistent manner.
2020-11-23 16:12:33 +00:00
Eelco Dolstra
1973669e86
Merge pull request #4271 from wiltaylor/IgnoreReferenceSwitch
...
Skip Reference Check on bundler
2020-11-23 12:48:07 +01:00
Wil Taylor
07603890d2
Removed reference check from bundler command
2020-11-23 21:19:40 +10:00
Eelco Dolstra
7827d95f6c
Merge pull request #4272 from kwohlfahrt/perl-sigs
...
Return derivation signatures in Perl bindings
2020-11-23 10:14:41 +01:00
Eelco Dolstra
56599bd282
Merge pull request #4224 from zimbatm/per-build-installer
...
installer: simplify the per-build installation
2020-11-22 00:06:23 +01:00
Kai Wohlfahrt
df83b6df68
Return signatures in Perl path info
2020-11-21 22:06:15 +00:00
zimbatm
233b61d3d6
installer: simplify the per-build installation
...
The goal is to allow the installation and testing of arbitrary Nix
versions. Extend the base installer to accept a `--tarball-url-prefix
<url>` to change where the Nix tarball is getting downloaded from.
Once this is merged it should allow to:
1. Pick an evaluation at https://hydra.nixos.org/jobset/nix/master that
looks healthy
2. Select the installedScript build and find the store path.
Now equipped with all of this, use an instance of nar-serve to fetch the
install script and release tarballs:
curl -sfL https://nar-serve.numtide.com/nix/store/rkv4yh7pym941bhj0849zqdkg2546bdv-installer-script/install \
| sh --tarball-url-prefix https://nar-serve.numtide.com/nix/store
Or with cachix, strip the /nix/store and derivation name and then:
curl -sfL https://mycache.cachix.org/serve/rkv4yh7pym941bhj0849zqdkg2546bdv/install \
| sh --tarball-url-prefix https://mycache.cachix.org/serve
Fixes #4047
2020-11-21 19:56:46 +01:00
Wil Taylor
c3bad73e27
Added switch
2020-11-21 14:28:49 +10:00
Eelco Dolstra
4dcb183af3
AttrCursor::getStringWithContext(): Force re-evaluation if the cached context is not valid
...
Fixes #4236 .
2020-11-19 20:59:36 +01:00
Eelco Dolstra
0327580e54
Fix assertion failure in LockFile::LockFile()
...
Fixes #4241 .
2020-11-19 20:31:30 +01:00
Eelco Dolstra
bc4df3394d
Merge pull request #4269 from obsidiansystems/sync-hash-derivation-modulo-cache
...
Make drv hash modulo memo table thread-safe
2020-11-19 20:03:06 +01:00
John Ericson
2113ae2d85
Make drv hash modulo memo table thread-safe
...
Let's get one step closer to the daemon not needing to fork.
2020-11-19 16:50:06 +00:00
Eelco Dolstra
79aa7d9518
Merge pull request #4268 from DavHau/patch-1
...
fix typo in comment in fetchurl.nix
2020-11-18 17:03:45 +01:00
DavHau
0fa6d380b2
fix typo in comment in fetchurl.nix
2020-11-18 11:20:50 +07:00
Eelco Dolstra
ae3191666f
Merge pull request #4171 from YorikSar/zsh-nix-profiles
...
Fix iterating over $NIX_PROFILES in Zsh
2020-11-17 15:53:44 +01:00
Eelco Dolstra
4dbd05e933
Merge pull request #4189 from edolstra/flake-config
...
Allow nix.conf options to be set in flake.nix
2020-11-17 15:39:14 +01:00
Eelco Dolstra
f89fd0bde7
Remove stray debug statement
...
This was causing a failure on macOS.
https://hydra.nixos.org/build/130354318
2020-11-17 15:36:20 +01:00
Eelco Dolstra
3daa256728
Remove tests.binaryTarball
...
This test no longer works on Hydra because import-from-derivation is
no longer allowed.
2020-11-17 15:26:39 +01:00
Eelco Dolstra
f4e790cc85
Merge pull request #4182 from mkenigs/fix-1930
...
Print built derivations as json for build
2020-11-17 14:59:49 +01:00
Eelco Dolstra
df5c69a94e
Merge pull request #4180 from Ma27/ssh-ng-substitute
...
Allow substituting paths when building remotely using `ssh-ng://`
2020-11-17 14:01:04 +01:00
Eelco Dolstra
e6b7c7b79c
Cleanup
2020-11-17 13:58:55 +01:00
Eelco Dolstra
bccff827dc
Fix deadlock in IFD through the daemon
...
Fixes #4235 .
2020-11-17 13:50:36 +01:00
Eelco Dolstra
5160ceef30
Merge pull request #4266 from tweag/better-sql-error-messages
...
Make the sql debug statements more useful
2020-11-17 11:35:39 +01:00
regnat
7de21f6664
Make the sql debug statements more useful
...
Print the expanded sql query (with the variables bound to their value) rather
than the original one in case of error
2020-11-17 10:05:45 +01:00
Eelco Dolstra
ef84c780bb
filterANSIEscapes(): Handle UTF-8 characters
2020-11-16 16:41:53 +01:00
Eelco Dolstra
0d6419ad87
Merge pull request #4262 from jbaum98/master
...
Fix deadlock in nix-store when max-connections=1
2020-11-16 10:20:36 +01:00
Eelco Dolstra
399c7f3f8b
Merge pull request #4257 from hercules-ci/issue-4197-nix-build-output-order
...
Issue 4197 nix build output order
2020-11-16 10:15:28 +01:00
Jake Waksbaum
01db455733
Fix deadlock in nix-store when max-connections=1
...
This fixes a bug I encountered where `nix-store -qR` will deadlock when
the `--include-outputs` flag is passed and `max-connections=1`.
The deadlock occurs because `RemoteStore::queryDerivationOutputs` takes
the only connection from the connection pool and uses it to check the
daemon version. If the version is new enough, it calls
`Store::queryDerivationOutputs`, which eventually calls
`RemoteStore::queryPartialDerivationOutputMap`, where we take another
connection from the connection pool to check the version again. Because
we still haven't released the connection from the caller, this waits for
a connection to be available, causing a deadlock.
This diff solves the issue by using `getProtocol` to check the protocol
version in the caller `RemoteStore::queryDerivationOutputs`, which
immediately frees the connection back to the pool before returning the
protocol version. That way we've already freed the connection by the
time we call `RemoteStore::queryPartialDerivationOutputMap`.
2020-11-16 02:35:50 -05:00
Robert Hensing
d264da8d96
tests: Test #4197 nix-build output order regression
2020-11-13 17:50:04 +01:00
Robert Hensing
ac5081d280
nix-build: Fix #4197 output order regression
2020-11-13 17:49:27 +01:00
Eelco Dolstra
258e5338d6
Merge pull request #4251 from serokell/mkaito/ops1098-nix-default-nix-path
...
Fix default nix-path
2020-11-12 17:45:19 +01:00
Christian Höppner
c4c3c15c19
Fix default nix-path
...
The default nix-path values for nixpkgs and root channels were
incorrect.
2020-11-12 15:46:08 +00:00
Ben Burdette
b327de9c2d
change message
2020-11-11 11:09:59 -07:00
Ben Burdette
8895fa70a4
pare down the error message
2020-11-11 11:05:21 -07:00
Ben Burdette
3edfe6090e
missing argument error
2020-11-11 09:29:32 -07:00
Matthew Kenigsberg
d52b12c0a5
Test nix build --json
2020-11-11 10:27:02 -06:00
Matthew Kenigsberg
8abb80a478
Print built derivations as json for build
...
Add --json option to nix build to allow machine readable output on
stdout with all built derivations
Fixes #1930
2020-11-11 10:27:02 -06:00
Ben Burdette
7d9037035e
usage example location
2020-11-11 09:21:26 -07:00
Eelco Dolstra
905f6678e8
Merge pull request #4243 from abathur/fix_4058
...
enable Darwin.arm64 to install x86_64 binary
2020-11-10 23:33:17 +01:00
Eelco Dolstra
4badb6943f
Fix use of dirty Git/Mercurial inputs with chroot stores
...
Fixes:
$ nix build --store /tmp/nix /home/eelco/Dev/patchelf#hydraJobs.build.x86_64-linux
warning: Git tree '/home/eelco/Dev/patchelf' is dirty
error: --- RestrictedPathError ------------------------------------------------------------------------------------------- nix
access to path '/tmp/nix/nix/store/xmkvfmffk7xfnazykb5kx999aika8an4-source/flake.nix' is forbidden in restricted mode
(use '--show-trace' to show detailed location information)
2020-11-10 23:22:45 +01:00
Travis A. Everett
4864df6d6b
enable Darwin.arm64 to install x86_64 binary
...
Throwing @thefloweringash under the bus if this doesn't work, but it
sounds like Apple Silicon devices can use the x86_64 binary for now.
Fixes #4058
2020-11-10 08:48:49 -06:00
Eelco Dolstra
cdc840d60b
Merge pull request #4242 from wizeman/fix-stack-overflow
...
Fix stack overflow introduced in #4206
2020-11-10 11:51:00 +01:00
Eelco Dolstra
3f680c1dcc
Merge pull request #4233 from Kha/master
...
nix develop: Preserve stdin with `-c`
2020-11-10 10:51:48 +01:00
Ricardo M. Correia
108a2dab7e
Fix stack overflow introduced in #4206
2020-11-10 04:25:24 +01:00
Ben Burdette
d8ef423a18
error message formatting
2020-11-09 19:16:50 -07:00
Ben Burdette
9f2b25ce55
remove unused ftn; reformat line breaks
2020-11-09 17:17:47 -07:00
Ben Burdette
6c2933a8d7
add position
2020-11-09 17:04:52 -07:00
Ben Burdette
107c91f5fe
auto-call error
2020-11-09 16:48:35 -07:00
dependabot[bot]
0ed7c957be
Bump cachix/install-nix-action from v11 to v12 ( #4237 )
...
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action ) from v11 to v12.
- [Release notes](https://github.com/cachix/install-nix-action/releases )
- [Commits](https://github.com/cachix/install-nix-action/compare/v11...07da2520eebede906fbeefa9dd0a2b635323909d )
Signed-off-by: dependabot[bot] <support@github.com >
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-11-09 23:21:55 +00:00
Sebastian Ullrich
3f24a417da
Add test case for incidentally fixed #4228
2020-11-09 22:43:14 +01:00
Sebastian Ullrich and Théophane Hufschmitt
579b953231
Make test case more precise
...
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com >
2020-11-09 22:43:14 +01:00
Sebastian Ullrich
fb7735e4cf
nix develop: Preserve stdin with -c
2020-11-09 22:43:14 +01:00
Eelco Dolstra
b87f84cf55
Fix appending to Setting<StringSet>
...
Fixes: warning: unknown setting 'extra-sandbox-paths'
2020-11-09 15:04:34 +01:00
Maximilian Bosch
3a63fc6cd5
Allow substituting paths when building remotely using ssh-ng://
...
Until now, it was not possible to substitute missing paths from e.g.
`https://cache.nixos.org ` on a remote server when building on it using
the new `ssh-ng` protocol.
This is because every store implementation except legacy `ssh://`
ignores the substitution flag passed to `Store::queryValidPaths` while
the `legacy-ssh-store` substitutes the remote store using
`cmdQueryValidPaths` when the remote store is opened with `nix-store
--serve`.
This patch slightly modifies the daemon protocol to allow passing an
integer value suggesting whether to substitute missing paths during
`wopQueryValidPaths`. To implement this on the daemon-side, the
substitution logic from `nix-store --serve` has been moved into a
protected method named `Store::substitutePaths` which gets currently
called from `LocalStore::queryValidPaths` and `Store::queryValidPaths`
if `maybeSubstitute` is `true`.
Fixes #2770
2020-11-05 20:12:37 +01:00
Eelco Dolstra
387f824cab
Merge pull request #4206 from hercules-ci/fix-coroutine-gc
...
Fix memory corruption caused by GC-invisible coroutine stacks
2020-11-05 10:18:31 +01:00
Eelco Dolstra
5e6eabe155
Fix error message 'assertion failed at'
2020-11-03 14:45:24 +01:00
Eelco Dolstra
e8c379555f
LocalStore: Get rid of recursive_mutex
2020-11-03 14:45:24 +01:00
Eelco Dolstra
797a52e31d
Add FIXME
2020-11-03 14:45:24 +01:00
Domen Kožar
cf82e14712
Merge pull request #4214 from grahamc/test-nix-copy-closure
...
nix-copy-closure: verify it works with drvs
2020-11-03 11:45:56 +01:00
Graham Christensen
8cd2ff69c3
nix-copy-closure: verify it works with drvs
...
Creates test coverage for #4210 and 7cf874c17d
2020-11-02 15:50:14 -05:00
Eelco Dolstra
550e11f077
nix repl: Fix handling of multi-line expressions
2020-11-02 19:07:37 +01:00
Eelco Dolstra
7cf874c17d
Don't use readDerivation() in addValidPath()
...
readDerivation() requires a valid path.
Fixes #4210 .
2020-11-02 18:46:44 +01:00
mkenigs
8b15650e74
docs: consistent console prompt ( #4213 )
...
Everywhere else a $ is used
2020-11-02 16:32:05 +01:00
Eelco Dolstra
ab2ef851b6
Merge pull request #4207 from hercules-ci/fix-RemoteStore-filterSource-deadlock
...
Fix RemoteStore pool deadlock in filterSource etc
2020-11-02 14:46:10 +01:00
Eelco Dolstra
db5424bf09
Don't send eval-related settings to the daemon
2020-11-02 13:57:58 +01:00
Graham Christensen
035d0adfd8
Merge pull request #4209 from hercules-ci/fix-restricted-store-addToStoreFromDump
...
Restore RestrictedStore.addToStoreFromDump implementation
2020-10-31 19:26:26 -04:00
Robert Hensing
e8a45d07bc
Restore RestrictedStore.addToStoreFromDump implementation
...
It was accidentally removed in commit ca30abb3fb
2020-10-31 23:56:03 +01:00
Robert Hensing
b43c13a916
BoehmGCStackAllocator: increase stack size to 8MB
...
The default stack size was not based on the normal stack size and
was too small.
2020-10-30 23:18:26 +01:00
Robert Hensing
2192cac634
Fix RemoteStore pool deadlock in filterSource etc
2020-10-30 21:47:34 +01:00
Robert Hensing
c4d903ddb0
Fix memory corruption caused by GC-invisible coroutine stacks
...
Crucially this introduces BoehmGCStackAllocator, but it also
adds a bunch of wiring to avoid making libutil depend on bdw-gc.
Part of the solutions for #4178 , #4200
2020-10-30 21:21:59 +01:00
Eelco Dolstra
dc5696b84f
Fix test
2020-10-30 12:00:53 +01:00
Eelco Dolstra
a3a22bd804
Merge pull request #4202 from hercules-ci/nix-shell-doc
...
Nix shell doc
2020-10-30 11:36:24 +01:00
Robert Hensing
d4c5d8d32a
nix-shell.md: Extend shellHook example
2020-10-30 11:12:28 +01:00
Robert Hensing
b809c48ebb
nix-shell.md: evaluated -> run
...
Use "run" to avoid confusion with Nix evaluation.
"evaluated" was intended to reference bash eval but it's ambiguous.
2020-10-30 11:01:33 +01:00
Eelco Dolstra
7f56cf67ba
Fix assertion failure in tab completion for --option
2020-10-29 18:26:35 +01:00
Eelco Dolstra
ff4dea63c9
Generalize extra-* settings
...
This removes the extra-substituters and extra-sandbox-paths settings
and instead makes every array setting extensible by setting
"extra-<name> = <value>" in the configuration file or passing
"--<name> <value>" on the command line.
2020-10-29 18:17:39 +01:00
Eelco Dolstra
bb8e837e4c
Merge pull request #4199 from stefanjaax/replaceWantedBySpecified
...
Alter "wanted:" to "specified:" in hash mismatch output
2020-10-29 07:38:38 +01:00
Eelco Dolstra
662e67f8de
Merge pull request #4198 from mkenigs/capitalize-JSON
...
Capitalize JSON for consistency
2020-10-29 07:34:34 +01:00
stev
869c0321ff
Alter "wanted:" to "specified:" in hash mismatch output
...
This makes it even clearer which of the two hashes was specified in the
nix files. Some may think that "wanted" and "got" is obvious, but:
"got" could mean "got in nix file" and "wanted" could mean "want to see in nix file".
2020-10-29 00:33:14 +01:00
Matthew Kenigsberg
6a4bf535d8
Capitalize JSON for consistency
2020-10-28 17:54:28 -05:00
Eelco Dolstra
a5019f0508
Consistency
2020-10-28 20:45:57 +01:00
Eelco Dolstra
5ac911bad6
Merge pull request #4194 from Ericson2314/skip-bad-static
...
No x86_32 static nix jobs for now
2020-10-28 11:16:00 +01:00
John Ericson
82e4d2a82e
No x86_32 static nix jobs for now
...
Fixes #4175
2020-10-28 05:13:18 +00:00
Eelco Dolstra
02a1facbdc
Merge pull request #4056 from tweag/non-ca-depending-on-ca
...
Allow non-CA derivations to depend on CA ones
2020-10-27 17:38:29 +01:00
regnat
ab21ab6501
Test the remote caching of non-ca-depending-on-ca derivations
...
Although the non-resolved derivation will never get a cache-hit (it
doesn't have an output path to query the cache for anyways), we might
get one on the resolved derivation.
2020-10-27 07:29:25 +01:00
regnat
bc081bcd81
Inline unkownHashes
...
See https://github.com/NixOS/nix/pull/4056#discussion_r493661632
2020-10-27 07:29:25 +01:00
regnat
c092fa4702
Allow non-CA derivations to depend on CA derivations
2020-10-27 07:29:23 +01:00
Eelco Dolstra
343239fc8a
Allow nix.conf options to be set in flake.nix
...
This makes it possible to have per-project configuration in flake.nix,
e.g. binary caches and other stuff:
nixConfig.bash-prompt-suffix = "[1;35mngi# [0m";
nixConfig.substituters = [ "https://cache.ngi0.nixos.org/ " ];
2020-10-26 20:45:39 +01:00
Eelco Dolstra
731edf0d9b
isTrivial(): Support trivial lists
2020-10-26 20:37:11 +01:00
Eelco Dolstra
14aecbb288
BaseSetting<StringMap>::set(): Don't append to previous value
2020-10-26 20:36:46 +01:00
Eelco Dolstra
b875b8f45c
Remove edition field
2020-10-26 17:59:36 +01:00
Eelco Dolstra
1e66d146a3
Fix test
2020-10-26 17:59:32 +01:00
Eelco Dolstra
9d5e9ef0da
Move Explicit
2020-10-26 17:01:20 +01:00
Eelco Dolstra
dc7d1322ef
Make the prompt used in development shells configurable
2020-10-26 14:24:25 +01:00
Eelco Dolstra
ac0e24f21b
Revert "Bump version to 3.0"
...
This reverts commit 189e6f5e1d .
After some discussion, it seems better not to bump the major version
number since most of the new features since 2.3 are marked
experimental.
2020-10-26 11:30:18 +01:00
tnias
c189cf7e33
Add sha512 to hashAlgo listings in manpages ( #4186 )
2020-10-25 22:16:53 +00:00
Eelco Dolstra
a78582c70f
Merge pull request #4161 from edolstra/nix-develop-redirects
...
nix develop: Add --redirect flag to redirect dependencies
2020-10-22 13:45:59 +02:00
Eelco Dolstra
750ce500c2
Fix clang build
2020-10-22 13:40:30 +02:00
Eelco Dolstra
f9438fb64a
nix develop: Add --redirect flag to redirect dependencies
...
This is primarily useful if you're hacking simultaneously on a package
and one of its dependencies. E.g. if you're hacking on Hydra and Nix,
you would start a dev shell for Nix, and then a dev shell for Hydra as
follows:
$ nix develop \
--redirect .#hydraJobs.build.x86_64-linux.nix ~/Dev/nix/outputs/out \
--redirect .#hydraJobs.build.x86_64-linux.nix.dev ~/Dev/nix/outputs/dev
(This assumes hydraJobs.build.x86_64-linux has a passthru.nix
attribute. You can also use a store path.)
This causes all references in the environment to those store paths to
be rewritten to ~/Dev/nix/outputs/{out,dev}. Note: unfortunately, you
may need to set LD_LIBRARY_PATH=~/Dev/nix/outputs/out/lib because
Nixpkgs' ld-wrapper only adds -rpath entries for -L flags that point
to the Nix store.
2020-10-22 13:40:30 +02:00
Eelco Dolstra
21830cb044
Merge pull request #4177 from knedlsepp/fix-NIX_CONFIG-doc
...
Fix the docs about the new NIX_CONFIG env var
2020-10-21 18:05:28 +02:00
Eelco Dolstra
e556a1beb7
nix develop: Handle 'declare -ax' in bash output
...
Fixes 'nix develop nixpkgs#qpdfview'.
2020-10-21 17:54:21 +02:00
Josef Kemetmüller
7f60f48e1a
Fix the docs about the new NIX_CONFIG env var
...
This was accidentally documented as NIX_OPTIONS.
2020-10-21 17:04:36 +02:00
Eelco Dolstra
ecfebde6ff
Merge pull request #4166 from kampka/nix-conf-env
...
Add NIX_CONFIG env var for applying nix.conf overrides
2020-10-21 14:26:45 +02:00
Eelco Dolstra
bdf2bcc989
Remove conf-file.xml
...
This was probably revived in a bad merge.
2020-10-21 14:24:26 +02:00
Christian Kampka
461cf2b856
Add NIX_CONFIG env var for applying nix.conf overrides
2020-10-21 13:41:26 +02:00
Yuriy Taraday
39fbd3d828
Fix iterating over $NIX_PROFILES in Zsh
...
NIX_PROFILES is space separated list of directories, and passing it into
for as is is considered to be 1-element list with the whole string. With
shwordsplit option Zsh emulates other shells in this regard ans
implicitely splits unquoted strings into words.
Fixes #4167 .
2020-10-21 00:03:38 +04:00
Eelco Dolstra
21244e1062
Merge pull request #4168 from mkenigs/fix-3975
...
Make bash non-interactive for nix develop --phase
2020-10-20 19:15:32 +02:00
Matthew Kenigsberg
f6aaac2b59
Make bash non-interactive for nix develop --phase
...
Fix #3975 : Currently if Ctrl-C is pressed during a phase, the interactive subshell
is not exited. Removing --rcfile when --phase is present makes bash
non-interactive
2020-10-20 12:00:30 -05:00
Domen Kožar
e0ca98c207
Merge pull request #3996 from abathur/macos_big_sur_fixes
...
Macos big sur installer fixes
2020-10-20 12:18:23 +02:00
Travis A. Everett
f289bdb9d4
discourage casual Big Sur installs
2020-10-19 12:28:08 -05:00
Travis A. Everett
c40bad4151
create missing profile files to fix zsh envvars
...
Env vars for ZSH were moved from /etc/zshrc to /etc/zshenv in #3608
to address an issue with zshrc getting clobbered by OS updates, but
/etc/zshenv doesn't exist by default--so *nothing* would get set up
for zsh users unless they already happened to have /etc/zshenv.
Creating these files if they don't exist. Also cut separate creation
of profile.d/nix.sh, which isn't needed now.
2020-10-19 12:25:52 -05:00
Travis A. Everett
b719f686a8
fix skipped multi-user install steps on macOS
...
Some of the changes in #3788 to support non-systemd Nix installs
don't appear to be aware that the darwin installer exists, which
resulted in some skipped steps and inappropriate instructions.
2020-10-19 12:25:52 -05:00
Travis A. Everett
3a8699ac4f
restore create-darwin-volume to release tarball
...
The move from release.nix to flake.nix appears to have lost some
changes from #3628 / 1c56f18a81 , leaving
create-darwin-volume.sh out of the release tarball.
Under the assumption that this was just an accident/byproduct of when
flake.nix split off and not intentional, I am restoring those edits.
2020-10-19 12:25:52 -05:00
Travis A. Everett
fe807904e5
adapt to apfs.util flag diff in catalina/big sur
...
Fixes #3957 . Just runs both forms to minimize moving parts.
2020-10-19 12:24:31 -05:00
Travis A. Everett
e736f8f6e4
replace xpath with xmllint --xpath; simplify
...
As mentioned in previous commit, Big Sur changes the syntax for the
xpath command slightly.
In the process of testing out replacements for these, I noticed a few
small simplification wins.
2020-10-19 12:24:04 -05:00
Travis A. Everett
1f02b65c59
fix xpath and conditional bugs; xpath -> xmllint
...
- xpath -> xmllint: xpath's cli interface changed in Big Sur
rather than add conditional logic for picking the correct
syntax for xpath, I'm changing to xmllint --xpath, which
appears to be consistent across versions I've tested...
- /plist/dict/key[text()='Writable']/following-sibling::true[1]
doesn't do quite what's expected. It was written to try to
select a <true /> node paired with the Writable key, but it
will also select the *next* <true /> node that appears even
if it was paired with another key.
- I think there's also a logic bug in the conditionals here.
I'm not sure anyone ever actuall saw it, thanks to the xpath
bug, though. With the xpath fix, this conditional passes if /nix
does not exist, / IS writable, and the version is Catalina+.
I think it meant to test for /nix does not exist, / is NOT
writable, and the version is Catalina+. I reworked this lightly
to make it a little clearer at the code level.
2020-10-19 12:23:29 -05:00
Travis A. Everett
9c3dc9d7ca
update macOS version handling for Big Sur
...
Keeping this commit narrow for reviewability, but some of these
conditionals will change in subsequent commits in this PR.
Fixes #3852 .
2020-10-19 12:22:30 -05:00
Eelco Dolstra
9635fb77bd
Merge pull request #4080 from kquick/kwq/flake-int-doc
...
Add some internal documentation for flake support objects.
2020-10-19 11:29:12 +02:00
Eelco Dolstra
05347387e7
Merge pull request #4162 from edolstra/nixpkgs-20.09
...
Switch to Nixpkgs 20.09
2020-10-19 11:26:00 +02:00
Eelco Dolstra
c27fcd94ce
Remove buildStatic from checks
...
checks should be relatively fast, but buildStatic depends on a lot of
stuff that isn't in the binary cache (e.g. musl builds of Git and
Mercurial that we probably don't need since we don't link against
them...).
2020-10-18 21:44:07 +02:00
Eelco Dolstra
62cf1d815a
Switch to Nixpkgs 20.09
2020-10-18 21:31:27 +02:00
Eelco Dolstra
532d2bc189
flake.lock: Update
...
Flake input changes:
* Updated 'nixpkgs': 'github:NixOS/nixpkgs/3a10a004bb5802d5f23c58886722e4239705e733' -> 'github:NixOS/nixpkgs/ad0d20345219790533ebe06571f82ed6b034db31'
2020-10-18 21:20:35 +02:00
Eelco Dolstra
20a7d8d23a
Add some missing clean-files
2020-10-18 20:32:59 +02:00
Eelco Dolstra
93bd014c8c
Update .gitignore
2020-10-18 20:32:46 +02:00
Eelco Dolstra
fda835b231
Merge pull request #4143 from obsidiansystems/typed-goal-maps
...
Properly type the derivation and substitution goal maps
2020-10-18 18:12:21 +02:00
Eelco Dolstra
6bca8f82c7
Merge pull request #4157 from SFrijters/doc-nix-shell-pure-bashrc
...
doc: nix-shell in pure mode does *not* source user bashrc
2020-10-18 18:10:18 +02:00
Eelco Dolstra
67cc94b80b
Merge pull request #4158 from hercules-ci/issue-3964-substitution-loop
...
Fix substitution loop #3964 , #3534
2020-10-18 18:09:11 +02:00
Robert Hensing
bd9eb5c743
DerivationGoal: only retry if output closure incomplete is only problem
2020-10-18 14:26:37 +02:00
Robert Hensing
ea8d32020e
Tests for #3964
2020-10-18 14:26:37 +02:00
Robert Hensing
94f1e4a441
Typo
2020-10-18 14:26:37 +02:00
Stefan Frijters
a53438d18f
doc: nix-shell in pure mode does *not* source user bashrc
2020-10-18 14:26:05 +02:00
John Ericson
7ed46c1574
Explain that upcast_goal is still a static cast
2020-10-17 21:50:12 +00:00
John Ericson
57d0432b39
Just use auto in two places.
2020-10-17 21:47:52 +00:00
John Ericson
e6f8ae56d8
tab -> space
2020-10-17 21:45:31 +00:00
John Ericson
619d262c97
Merge remote-tracking branch 'upstream/master' into typed-goal-maps
2020-10-17 21:44:27 +00:00
Eelco Dolstra
05e6fe69f9
Merge pull request #4156 from aszlig/vm-test-python
...
Convert VM tests to Python
2020-10-17 23:40:44 +02:00
aszlig
cfa26cf181
tests: Add names to VM tests
...
Having vm-test-run-unnamed for all the test derivation doesn't look very
nice, so in order to better distinguish them from their store path,
let's actually give them proper names.
Signed-off-by: aszlig <aszlig@nix.build >
2020-10-17 23:34:38 +02:00
aszlig
5cfdf16dd6
Convert VM tests to Python
...
Perl-based tests are deprecated since NixOS 20.03 and subsequently got
removed in NixOS 20.09, which effectively means that tests are going to
fail as soon as we build it with NixOS 20.09 or anything newer.
I've put "# fmt: off" at the start of every testScript, because
formatting with Black really messes up indentation and I don't think it
really adds anything in value or readability for inlined Python scripts.
Signed-off-by: aszlig <aszlig@nix.build >
2020-10-17 23:32:03 +02:00
Eelco Dolstra
e6247a584d
Merge branch 'fix-and-ci-static-builds' of https://github.com/obsidiansystems/nix into master
2020-10-17 22:59:27 +02:00
Eelco Dolstra
2a37c35650
Merge pull request #4151 from obsidiansystems/bump-nixpkgs
...
Bump Nixpkgs to hopefully fix linkrot
2020-10-16 15:05:20 +02:00
John Ericson
1d09923d5b
Merge remote-tracking branch 'obsidian/bump-nixpkgs' into fix-and-ci-static-builds
2020-10-16 04:25:24 +00:00
John Ericson
257090d030
Bump Nixpkgs to hopefully fix linkrot
2020-10-15 21:54:22 +00:00
John Ericson
48ce627377
Make a better -lz hack
...
Per the comments, the underlying issue is
https://github.com/libarchive/libarchive/issues/1446 , knowing this
allows the hack to be much more targetted.
2020-10-15 20:13:01 +00:00
John Ericson
64be1c15c2
Add missing include for MAX_PATH
...
And remove one that we didn't actually need to add
2020-10-15 19:05:17 +00:00
John Ericson
fccef6a7fa
Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-builds
2020-10-15 18:55:03 +00:00
John Ericson
f6ed1a96b3
build-static -> buildStatic in Nix's flake
2020-10-15 18:54:36 +00:00
John Ericson
0fefc2a439
Merge remote-tracking branch 'upstream/master' into typed-goal-maps
2020-10-14 20:49:01 +00:00
Eelco Dolstra
11882d7c7c
Create /etc/passwd *after* figuring out the sandbox uid/gid
...
Fixes build failures like
# nix log /nix/store/gjaa0psfcmqvw7ivggsncx9w364p3s8s-sshd.conf-validated.drv
No user exists for uid 30012
2020-10-14 12:20:58 +02:00
John Ericson
55592b253f
Add some more docs
2020-10-13 18:04:24 +00:00
John Ericson
13804f126e
Merge remote-tracking branch 'upstream/master' into typed-goal-maps
2020-10-13 18:02:32 +00:00
Eelco Dolstra
2653801939
Merge branch 'split_build_cc' of https://github.com/obsidiansystems/nix
2020-10-13 15:36:55 +02:00
Eelco Dolstra
7e44adda46
Merge pull request #4141 from volth/patch-11
...
Handle amount of disk space saved by hard linking being negative
2020-10-13 11:06:29 +02:00
John Ericson
1b8ebe92dc
Merge remote-tracking branch 'obsidian/split_build_cc' into typed-goal-maps
2020-10-12 20:47:22 +00:00
John Ericson
a73959e6be
Merge remote-tracking branch 'upstream/master' into split_build_cc
2020-10-12 17:20:46 +00:00
John Ericson
d334fd4882
Merge branches 'split_build_hh-0', 'split_build_hh-1', 'split_build_hh-2', 'split_build_hh-3' and 'split_build_hh-4' into split_build_cc
2020-10-12 17:20:12 +00:00
John Ericson
542972f029
Trim worker.hh
2020-10-12 17:16:48 +00:00
John Ericson
0e2306204a
Rename to hand-hold git (worker.hh)
2020-10-12 17:16:48 +00:00
John Ericson
3ffa3546bd
Trim substitution-goal.hh
2020-10-12 17:16:25 +00:00
John Ericson
e77a2344d5
Rename to hand-hold git (substitution-goal.hh)
2020-10-12 17:16:25 +00:00
John Ericson
d585b4c54f
Trim hook-instance.hh
2020-10-12 17:16:13 +00:00
John Ericson
10b749a156
Rename to hand-hold git (hook-instance.hh)
2020-10-12 17:16:13 +00:00
John Ericson
8067d32f2a
Trim goal.hh
2020-10-12 17:16:00 +00:00
John Ericson
0d0e345cdc
Rename to hand-hold git (goal.hh)
2020-10-12 17:16:00 +00:00
John Ericson
2ce726947a
Trim derivation-goal.hh
2020-10-12 17:15:32 +00:00
John Ericson
4eb8c69853
Rename to hand-hold git (derivation-goal.hh)
2020-10-12 17:15:32 +00:00
John Ericson
f7099965bf
Change .cc files to use split build headers
2020-10-12 17:08:52 +00:00
John Ericson
5a97621d6d
Prepare for build/*.hh headers
2020-10-12 17:07:51 +00:00
volth
eee18f88dd
Handle amount of disk space saved by hard linking being negative
...
Fixes bogus messages like "currently hard linking saves 17592186044416.00 MiB".
2020-10-12 16:06:38 +00:00
Eelco Dolstra
20d2140e45
Merge pull request #4136 from obsidiansystems/split-uds-remote-store
...
Split out uds-remote-store.{cc.hh}
2020-10-12 14:11:58 +02:00
John Ericson
15fdb7cc6b
Split out uds-remote-store.{cc.hh}
2020-10-11 17:37:05 +00:00
John Ericson
38e3897162
Copy {uds-,}remote-store.{cc,hh}
...
This prepares for the splitting that happens in the next commit.
2020-10-11 17:18:26 +00:00
John Ericson
5c74a6147b
Properly type the derivation and substitution goal maps
...
As a bonus, Worker::removeGoal is less inefficient.
2020-10-11 17:07:14 +00:00
Eelco Dolstra
b0fbf3a653
Merge pull request #4135 from obsidiansystems/split-local-fs-store-header
...
Split out `local-fs-store.hh`
2020-10-11 18:49:40 +02:00
John Ericson
8cc510fb79
Merge branches 'build-1', 'build-2', 'build-3', 'build-4', 'build-5', 'build-6', 'build-7' and 'build-8' into split_build_cc
2020-10-11 16:44:34 +00:00
John Ericson
bcb67e1ed8
Trim lock.cc
2020-10-11 16:44:19 +00:00
John Ericson
e0be04129b
Rename to hand-hold git (lock.cc)
2020-10-11 16:44:14 +00:00
John Ericson
dbc588651c
Trim lock.hh
2020-10-11 16:44:07 +00:00
John Ericson
d0004bfcab
Rename to hand-hold git (lock.hh)
2020-10-11 16:43:59 +00:00
John Ericson
eed53ed87a
Trim build/worker.cc
2020-10-11 16:43:51 +00:00
John Ericson
904e315dae
Rename to hand-hold git (build/worker.cc)
2020-10-11 16:43:42 +00:00
John Ericson
d24ffe0eb1
Trim build/substitution-goal.cc
2020-10-11 16:43:24 +00:00
John Ericson
3633b3572b
Rename to hand-hold git (build/substitution-goal.cc)
2020-10-11 16:43:18 +00:00
John Ericson
4bdff7d1b0
Trim build/local-store-build.cc
2020-10-11 16:43:12 +00:00
John Ericson
dc5225cde5
Rename to hand-hold git (build/local-store-build.cc)
2020-10-11 16:43:05 +00:00
John Ericson
159054f730
Trim build/hook-instance.cc
2020-10-11 16:42:35 +00:00
John Ericson
f0b8987299
Rename to hand-hold git (build/hook-instance.cc)
2020-10-11 16:42:08 +00:00
John Ericson
819fe848ac
Trim build/goal.cc
2020-10-11 16:41:58 +00:00
John Ericson
184bfc301e
Rename to hand-hold git (build/goal.cc)
2020-10-11 16:41:18 +00:00
John Ericson
3bab1c5bb0
Trim build/derivation-goal.cc
2020-10-11 16:41:11 +00:00
John Ericson
9629290eda
Rename to hand-hold git (build/derivation-goal.cc)
2020-10-11 16:40:52 +00:00
John Ericson
a4f0fecb03
Trim build.hh
2020-10-11 16:40:34 +00:00
John Ericson
fc72cb0760
Rename to hand-hold git (build.hh)
2020-10-11 16:40:14 +00:00
John Ericson
428536fd75
Prepare for build/* files
2020-10-11 16:39:08 +00:00
John Ericson
aef44cbaa9
Split out commonChildInit
2020-10-11 16:38:46 +00:00
John Ericson
6cc1541782
Split out local-fs-store.hh
...
This matches the already-existing `local-fs-store.cc`.
2020-10-09 20:18:08 +00:00
Eelco Dolstra
725488b892
nix develop: Unset $HOSTNAME
...
This is set to "localhost" by stdenv which is probably not what you
want.
2020-10-09 22:03:18 +02:00
Eelco Dolstra
44349064f7
nix develop: Source ~/.bashrc
...
Fixes #4104 .
2020-10-09 22:02:00 +02:00
Eelco Dolstra
59bd6e87a4
Completions::add(): Guard against newlines
2020-10-09 21:55:59 +02:00
Eelco Dolstra
ea4b2b985f
Merge pull request #4128 from tweag/extended-completions
...
Add a zsh completion script
2020-10-09 21:53:12 +02:00
John Ericson
39de73550d
Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-builds
2020-10-09 18:26:47 +00:00
Eelco Dolstra
e845d19ae3
Remove Lazy
...
This fixes a crash during startup when compiling Nix as a single
compilation unit.
2020-10-09 17:54:59 +02:00
Eelco Dolstra
87157b2bd3
writeFile(): Add error context to writeFull() failure
...
Issue #4092 .
2020-10-09 16:02:53 +02:00
Eelco Dolstra
636ec17139
Remove stray DerivationOutputsAndPaths type
2020-10-09 15:41:24 +02:00
regnat
eea310b241
Add a zsh completion script
...
Based on @clhodapp's suggestion in https://github.com/spwhitt/nix-zsh-completions/issues/32#issuecomment-705315356 and adapted to use the description of the completions
2020-10-09 09:47:47 +02:00
regnat
04e5d0e704
Add a description in the completion outputs
...
Make nix output completions in the form `completion\tdescription`.
This can't be used by bash (afaik), but other shells like zsh or fish
can display it along the completion choices
2020-10-09 09:39:51 +02:00
Eelco Dolstra
58dadf2954
Remove stray 'Title:' from the manual
...
Closes #4096 .
2020-10-08 17:30:40 +02:00
Eelco Dolstra
9a1807aa01
Merge pull request #4125 from Horki/nix_rust_small_patches
...
rust: small patches
2020-10-08 15:07:32 +02:00
Horki
eaef251b2b
rust: small patches
2020-10-08 13:40:47 +02:00
Eelco Dolstra
54f4500457
Merge pull request #4121 from NixOS/no-user-namespace
...
Support user namespaces being disabled
2020-10-08 09:01:57 +02:00
Eelco Dolstra
97ffc1e013
Dynamically disable user namespaces if CLONE_NEWUSER fails
...
This makes builds work inside nixos-enter.
Fixes #3145 .
2020-10-07 22:46:01 +02:00
Eelco Dolstra
6aa64627c8
Support user namespaces being disabled
...
If max_user_namespaces is set to 0, then don't run the build in a user
namespace.
Fixes #4092 .
2020-10-07 22:02:36 +02:00
Eelco Dolstra
f66bbd8c7b
Doh
2020-10-07 21:25:06 +02:00
Eelco Dolstra
e705c24294
Tweak error messages
2020-10-07 17:28:43 +02:00
Eelco Dolstra
c43e882f54
Serialize exceptions from the daemon to the client
2020-10-07 17:13:54 +02:00
Eelco Dolstra
be149acfda
Serialize exceptions from the sandbox process to the parent
...
Fixes #4118 .
2020-10-07 16:34:03 +02:00
Eelco Dolstra
27ca87c46a
Formatting
2020-10-07 16:33:19 +02:00
Eelco Dolstra
5257a2559e
Merge pull request #4120 from obsidiansystems/no-poly-sum-worker-proto
...
Remove generic std::optional<T> suppport from worker proto
2020-10-07 15:18:33 +02:00
John Ericson
57d960dcd1
Remove generic std::optional<T> suppport from worker proto
...
See comment for rational; I think it's good to leave a comment lest
anyone is tempted to add such a sum-type instance again.
Fixes #4113
2020-10-07 12:50:37 +00:00
Maximilian Bosch
59f2dd8e8d
libfetchers/github: allow slashes in refs
...
Refs #4061
2020-10-06 20:08:51 +02:00
Eelco Dolstra
d761485010
Prevent a deadlock when user namespace setup fails
...
Observed on Centos 7 when user namespaces are disabled:
DerivationGoal::startBuilder() throws an exception, ~DerivationGoal()
waits for the child process to exit, but the child process hangs
forever in drainFD(userNamespaceSync.readSide.get()) in
DerivationGoal::runChild(). Not sure why the SIGKILL doesn't get
through.
Issue #4092 .
2020-10-06 18:57:23 +02:00
Eelco Dolstra
ad143c5b3b
Shut up some clang warnings
2020-10-06 14:52:30 +02:00
Eelco Dolstra
2856878b41
Merge pull request #4102 from B4dM4n/macos-sandbox-build
...
Fix macOS sandbox build
2020-10-06 14:41:06 +02:00
Eelco Dolstra
85c8be6286
Remove static variable name clashes
...
This was useful for an experiment with building Nix as a single
compilation unit. It's not very useful otherwise but also doesn't
hurt...
2020-10-06 13:49:20 +02:00
Eelco Dolstra
0419cd2695
Remove unneeded -lboost_* flags
2020-10-06 13:34:58 +02:00
Eelco Dolstra
0856c0a0b4
mk/precompiled-headers.mk: Remove special handling for clang
2020-10-06 13:27:09 +02:00
Eelco Dolstra
b4db315a56
mk/precompiled-headers.mk: Fix clang test
...
"clang++" includes the string "g++" so this test didn't work
properly. However the separate handling of clang might not be needed
anymore...
2020-10-06 13:26:00 +02:00
Eelco Dolstra
636455c471
Remove 'using namespace fetchers'
2020-10-06 11:16:32 +02:00
Eelco Dolstra
6691256e79
Factor out common showBytes()
2020-10-06 10:40:49 +02:00
Eelco Dolstra
d0bb544128
Add missing #pragma once
2020-10-06 10:40:07 +02:00
Eelco Dolstra
88a667e49e
Fix s3:// store
...
Fixes https://github.com/NixOS/nixos-org-configurations/issues/123 .
2020-10-05 17:53:30 +02:00
Eelco Dolstra
51c299213b
Merge pull request #3935 from obsidiansystems/binary-cache-addToStoreFromDump
...
Get rid of Hash::dummy from BinaryCacheStore
2020-10-05 14:41:28 +02:00
Eelco Dolstra
f3aba88737
Merge pull request #3895 from obsidiansystems/templated-daemon-protocol
...
More templated STL support for the daemon protocol
2020-10-05 14:40:27 +02:00
Fabian Möller
4abd5554ad
Fix macOS sandbox build
2020-10-02 15:40:55 +02:00
Eelco Dolstra
57b935a893
Merge pull request #4101 from B4dM4n/fix-profile-update
...
Fix profile update in nix command
2020-10-02 14:19:26 +02:00
Fabian Möller
d5d196b0a1
Fix profile update in nix command
2020-10-02 12:10:31 +02:00
Eelco Dolstra
4a358743d2
Merge pull request #4098 from DavHau/davhau-add-nix-run-examples
...
add more examples to --help of `nix run`
2020-10-01 12:45:24 +02:00
DavHau
f3280004e2
add more examples to --help of nix run
2020-10-01 11:34:13 +07:00
Eelco Dolstra
924712eef1
Installer: Set a known umask
...
Fixes #1560 , #2377 .
2020-09-30 17:48:49 +02:00
Eelco Dolstra
20a1e20d91
Style
2020-09-30 13:35:56 +02:00
Eelco Dolstra
274357eb6a
Simplify
2020-09-30 12:09:18 +02:00
Eelco Dolstra
002ce8449d
Merge branch 'access-tokens' of https://github.com/kquick/nix
2020-09-30 11:35:15 +02:00
John Ericson
69afaeace3
Merge remote-tracking branch 'upstream/master' into templated-daemon-protocol
2020-09-30 00:42:28 +00:00
John Ericson
b759701652
nix::worker_proto -> worker_proto
2020-09-30 00:41:18 +00:00
John Ericson
45a0ed82f0
Revert "Use template structs instead of phantoms"
...
This reverts commit 9ab07e99f5 .
2020-09-30 00:39:06 +00:00
Kevin Quick
5e7838512e
Remove github-access-token in favor of access-token.
2020-09-29 16:26:34 -07:00
Eelco Dolstra
76f000712e
Merge branch 'kwq/path-dir-query' of https://github.com/kquick/nix
2020-09-29 23:42:43 +02:00
Eelco Dolstra
64e9b3c83b
nix registry list: Show 'dir' attribute
...
Issue #4050 .
2020-09-29 23:33:16 +02:00
Kevin Quick
66c3959e8c
Merge branch 'master' into access-tokens
2020-09-29 08:32:06 -07:00
Eelco Dolstra
e2d398c200
Merge branch 'master' of github.com:NixOS/nix
2020-09-29 13:22:51 +02:00
Eelco Dolstra
5999978a05
Make Headers an optional argument
2020-09-29 13:05:19 +02:00
Eelco Dolstra
de86abbf3f
Cleanup
2020-09-29 12:55:06 +02:00
Domen Kožar
fc8eed8a3e
Merge pull request #4084 from NixOS/dependabot/github_actions/cachix/install-nix-action-v11
...
Bump cachix/install-nix-action from v10 to v11
2020-09-29 13:28:34 +03:00
Eelco Dolstra
cebd2fc35d
Merge branch 'github-api-token' of https://github.com/imalsogreg/nix
2020-09-29 12:17:00 +02:00
Eelco Dolstra
1e8855a7f7
Merge pull request #3958 from obsidiansystems/ca-floating-upstream
...
CA derivations that depend on other CA derivations
2020-09-29 11:37:29 +02:00
Eelco Dolstra
ed02d20e1d
Merge pull request #4085 from 0mp/patch-2
...
Fix tar invocation on FreeBSD
2020-09-29 11:31:46 +02:00
John Ericson
00135e13f4
Clarify comment a bit
2020-09-28 18:19:10 +00:00
Domen Kožar
f1428484be
Update .github/workflows/test.yml
2020-09-28 21:08:24 +03:00
Domen Kožar
c89fa3f644
Update .github/workflows/test.yml
2020-09-28 21:08:14 +03:00
Kevin Quick
887be7b6f2
Switch comment format from '// ...' to '/* ... */' for consistency.
2020-09-28 09:37:26 -07:00
Kevin Quick
128c98ab09
Clarification in the description of the FlakeInput.
2020-09-28 09:34:23 -07:00
Kevin Quick
5ae164b7cf
Update description of FlakeRef, incorporating suggestion.
2020-09-28 09:23:05 -07:00
Kevin Quick
bcb3da3b6b
Fix spelling error.
2020-09-28 08:58:14 -07:00
John Ericson
80e335bb58
Use drvPath2 and give it a better name
2020-09-28 15:43:56 +00:00
John Ericson
10202bbf29
Merge remote-tracking branch 'upstream/master' into ca-floating-upstream
2020-09-28 15:39:11 +00:00
John Ericson and Eelco Dolstra
6c31297d80
Update src/libstore/binary-cache-store.cc
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-09-28 11:32:58 -04:00
Mateusz Piotrowski
ed66d01065
Fix tar invocation on FreeBSD
...
tar(1) on FreeBSD does not use standard output or input when the -f flag
is not provided. Instead, it defaults to /dev/sa0 on FreeBSD.
Make this tar invocation a bit more robust and explicitly tell tar(1) to
use standard output.
This is one of the issues discovered while porting Nix to FreeBSD. It has
been tested and committed locally to FreeBSD ports:
https://svnweb.freebsd.org/ports/head/sysutils/nix/Makefile?revision=550026&view=markup#l108
2020-09-28 15:23:21 +02:00
Eelco Dolstra
649c465873
Merge pull request #4064 from serokell/balsoft/fix-max-jobs
...
Fix max-jobs option
2020-09-28 10:42:02 +02:00
Eelco Dolstra
5df687c316
Merge pull request #4077 from Ma27/left-whitespace-log
...
libmain/progress-bar: don't trim whitespace on the left
2020-09-28 10:40:00 +02:00
dependabot[bot]
095a91f55a
Bump cachix/install-nix-action from v10 to v11
...
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action ) from v10 to v11.
- [Release notes](https://github.com/cachix/install-nix-action/releases )
- [Commits](https://github.com/cachix/install-nix-action/compare/v10...95a8068e317b8def9482980abe762f36c77ccc99 )
Signed-off-by: dependabot[bot] <support@github.com >
2020-09-28 05:37:07 +00:00
Maximilian Bosch
3655875483
doc/manual: update hacking docs ( #4078 )
...
* By default, build artifacts should be installed into `outputs/` rather
than `inst/`[1].
* Add instructions on how to run unit-tests.
[1] 733d2e9402
2020-09-27 20:35:03 +00:00
Kevin Quick
5885b0cfd8
Miscellaneous spelling fixes in comments. ( #4071 )
2020-09-27 20:04:06 +00:00
Kevin Quick
bd5328814f
Add some internal documentation for flake support objects.
2020-09-26 14:32:58 -07:00
Maximilian Bosch
a76fb07314
libmain/progress-bar: don't trim whitespace on the left
...
When running `nix build -L` it can be fairly hard to read the output if
the build program intentionally renders whitespace on the left. A
typical example is `g++` displaying compilation errors.
With this patch, the whitespace on the left is retained to make the log
more readable:
```
foo> no configure script, doing nothing
foo> building
foo> foobar.cc: In function 'int main()':
foo> foobar.cc:5:5: error: 'wrong_func' was not declared in this scope
foo> 5 | wrong_func(1);
foo> | ^~~~~~~~~~
error: --- Error ------------------------------------------------------------------------------------- nix
error: --- Error --- nix-daemon
builder for '/nix/store/i1q76cw6cyh91raaqg5p5isd1l2x6rx2-foo-1.0.drv' failed with exit code 1
```
2020-09-26 17:38:11 +02:00
John Ericson and Robert Hensing
25fffdda86
Remove redundant nar hash and size setting
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com >
2020-09-26 10:17:30 -04:00
Mateusz Piotrowski
8b4a542d17
Fix a typo ( #4073 )
2020-09-26 11:33:04 +00:00
John Ericson
1832436526
Fix up BinaryCacheStore::addToStore taking a path
2020-09-26 04:56:29 +00:00
John Ericson
5db83dd771
BinaryCacheStore::addTextToStore include CA field
2020-09-26 03:21:36 +00:00
John Ericson
c40c832f19
Merge remote-tracking branch 'obsidian/master' into binary-cache-addToStoreFromDump
2020-09-26 00:21:45 +00:00
Kevin Quick
cb186f1e75
Use "?dir=..." portion of "registry add" local path specification.
...
The registry targets generally follow a URL formatting schema with
support for a query parameter of "?dir=subpath" to specify a sub-path
location below the URL root.
Alternatively, an absolute path can be specified. This specification
mode accepts the query parameter but ignores/drops it. It would
probably be better to either (a) disallow the query parameter for the
path form, or (b) recognize the query parameter and add to the path.
This patch implements (b) for consistency, and to make it easier for
tooling that might switch between a remote git reference and a local
path reference.
See also issue #4050 .
2020-09-25 09:36:18 -07:00
Gregory Hale
faa5607f54
Merge remote-tracking branch 'origin/master' into github-api-token
2020-09-25 12:10:58 -04:00
John Ericson
cfe791a638
stdout_ -> cout
...
Better to get creative than just sprinkle arbitrary underscores.
2020-09-25 11:30:04 -04:00
Eelco Dolstra
7d81582488
Merge pull request #3953 from obsidiansystems/basic-derivation-goal-outputs
...
Deduplicate basic derivation goals too
2020-09-25 17:21:19 +02:00
Kevin Quick
5a35cc29bf
Re-add support for github-access-token, but mark as deprecated.
2020-09-25 08:09:56 -07:00
Kevin Quick
ef2a14be19
Fix reference to older name for access-tokens config value.
2020-09-25 08:08:27 -07:00
Eelco Dolstra
cbb9862cd9
Merge pull request #3626 from W95Psp/master
...
Make `functionArgs` primitive accept primops (fix #3624 )
2020-09-25 15:14:18 +02:00
Eelco Dolstra
7b2ae472ff
expectArg(): Respect the 'optional' flag
2020-09-25 10:27:40 +02:00
Eelco Dolstra
2e5ff87d0e
Merge pull request #4065 from paulopiyo777/flakeBranch
...
Remove redundant value checks
2020-09-25 09:49:15 +02:00
Kevin Quick
8fba2a8b54
Update to use access-tokens configuration for github/gitlab access.
...
This change provides support for using access tokens with other
instances of GitHub and GitLab beyond just github.com and
gitlab.com (especially company-specific or foundation-specific
instances).
This change also provides the ability to specify the type of access
token being used, where different types may have different handling,
based on the forge type.
2020-09-24 22:49:44 -07:00
Kevin Quick
c2f48cfcee
Complete conversion of "url" to "host" with associated variable renaming.
...
Completes the change begun in commit 56f1e0d to consistently use the
"host" attribute for "github" and "gitlab" inputs instead of a "url"
attribute.
2020-09-24 22:46:03 -07:00
Kevin Quick
a439e9488d
Support StringMap configuration settings.
...
Allows Configuration values that are space-separated key=value pairs.
2020-09-24 22:42:59 -07:00
Kevin Quick
83fec38fc9
Update document generation for empty json object values.
2020-09-24 22:41:24 -07:00
Paul Opiyo
4d863a9fcb
Remove redundant value checks
...
std::optional had redundant checks for whether it had a value.
An object is emplaced either way so it can be dereferenced
without repeating a value check
2020-09-24 18:32:03 -05:00
Alexander Bantyev
ed218e1d6c
Fix max-jobs option
...
After 0ed946aa61 , max-jobs setting (-j/--max-jobs)
stopped working.
The reason was that nrLocalBuilds (which compared to maxBuildJobs to figure
out whether the limit is reached or not) is not incremented yet when tryBuild
is started; So, the solution is to move the check to tryLocalBuild.
Closes https://github.com/nixos/nix/issues/3763
2020-09-25 00:07:42 +03:00
Eelco Dolstra
5a7fd38dbb
Merge pull request #4063 from kquick/fix_hash-file_desc
...
Fixes fall-through to report correct description of hash-file command.
2020-09-24 23:01:32 +02:00
Kevin Quick
bd5f3dbe11
Fixes fall-through to report correct description of hash-file command.
2020-09-24 12:30:03 -07:00
Eelco Dolstra
8d9402f411
Merge pull request #4054 from edolstra/fix-4021
...
registerOutputs(): Don't call canonicalisePathMetaData() twice
2020-09-23 21:57:53 +02:00
Eelco Dolstra
4ce8a3ed45
Hopefully fix EPERM on macOS
2020-09-23 21:29:10 +02:00
Eelco Dolstra
9a24ece122
Fix exception
2020-09-23 20:21:08 +02:00
Eelco Dolstra
8ee779da7d
Merge pull request #4057 from martinetd/btrfs-compression
...
nix/store on btrfs compression: add workaround
2020-09-23 19:19:21 +02:00
Eelco Dolstra
236d9ee7f7
lstat() cleanup
2020-09-23 19:17:28 +02:00
Eelco Dolstra
688bd4fb50
After rewriting a path, make it read-only
2020-09-23 19:10:16 +02:00
Eelco Dolstra
31ab4c3816
Test whether build/repair results are read-only
2020-09-23 19:09:58 +02:00
Dominique Martinet
2548347bba
libutil/archive: add preallocate-contents option
...
Make archive preallocation (fallocate) optional because some filesystems
like btrfs do not behave as expected with fallocate.
See #3550 .
2020-09-23 18:49:11 +02:00
Eelco Dolstra
cec9473871
DerivationGoal::registerOutputs(): Don't canonicalize twice
...
Fixes #4021 .
2020-09-23 18:21:22 +02:00
Eelco Dolstra
d4f8163d10
canonicalisePathMetaData_(): Change assertion to error message
2020-09-23 18:21:22 +02:00
Eelco Dolstra
e8f0b1e996
DerivationGoal::registerOutputs(): Fix bad format string
2020-09-23 18:21:22 +02:00
Eelco Dolstra
9c95a8bebf
Merge pull request #4055 from tweag/link-with-gold
...
Use gold as the linker on Linux
2020-09-23 18:20:46 +02:00
John Ericson and Robert Hensing
3f226f71c1
Return more info from BinaryCacheStore::addToStoreCommon
...
We don't need it yet, but we could/should in the future, and it's a
cost-free change since we already have the reference. I like it.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com >
2020-09-23 14:40:41 +00:00
John Ericson and Robert Hensing
412b3a54fb
Clarify FIXME in BinaryCacheStore::addToStoreCommon
...
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com >
2020-09-23 10:36:55 -04:00
regnat
21639b2d17
Use gold as the linker on Linux
...
Saves ~7s in the linking phase
2020-09-23 16:10:31 +02:00
Eelco Dolstra
8a2e10827f
Remove unused Flake::vOutputs field
2020-09-23 14:08:52 +02:00
Domen Kožar
dac8a1a5e1
Merge pull request #4052 from ujjwaljainnn/fix-typo
...
fixed typo
2020-09-23 09:58:30 +02:00
John Ericson
9fbc31a65b
Get rid of Hash::dummy from BinaryCacheStore
2020-09-23 04:56:04 +00:00
ujjwal
a2f5c921d4
fixed typo
2020-09-22 23:37:06 +05:30
John Ericson
993229cdaf
Deduplicate basic derivation goals too
...
See comments for security concerns.
Also optimize goal creation by not traversing map twice.
2020-09-22 17:13:59 +00:00
John Ericson
e9fc2031f0
Merge remote-tracking branch 'upstream/master' into templated-daemon-protocol
2020-09-22 14:18:31 +00:00
regnat
67cc356bb3
Merge remote-tracking branch 'origin/master' into non-ca-depending-on-ca
2020-09-22 16:11:25 +02:00
Eelco Dolstra
980edd1f3a
RemoteStore::addCAToStore(): Don't hold connection while calling queryPathInfo()
...
This leads to a deadlock if we're at the connection limit.
2020-09-22 15:28:20 +02:00
Eelco Dolstra
5b107f2c5f
Merge pull request #4038 from maljub01/master
...
Add a nix.conf option for allowing a symlinked store
2020-09-22 13:19:22 +02:00
Eelco Dolstra
35a0ac1838
Style fixes
2020-09-22 11:40:19 +02:00
Eelco Dolstra
92ac8df0ec
Merge branch 'add-ca-to-store' of https://github.com/hercules-ci/nix
2020-09-22 11:31:33 +02:00
Eelco Dolstra
e7f1109f06
Merge pull request #4040 from OmnipotentEntity/master
...
Fix compatibility with nlohmann-json 3.9.1
2020-09-22 11:09:25 +02:00
Eelco Dolstra
7dd8baafe1
Merge pull request #4041 from cole-h/enum-stringify
...
Serialize SandboxMode enum to string for JSON
2020-09-22 11:08:56 +02:00
Eelco Dolstra
451567d259
Merge pull request #4049 from tweag/remove-signed-unsigned-warning
...
Silence a compiler warning in serialise.hh
2020-09-22 11:05:24 +02:00
Eelco Dolstra
38152410fb
Merge pull request #4048 from tweag/dont-fortify-on-dev
...
Disable `FORTIFY_SOURCE` when compiling without optims
2020-09-22 11:03:19 +02:00
regnat
c1e79f870c
Silence a compiler warning in serialise.hh
...
Explicitely cast to `uint64_t` in `readNum` to avoid a "comparison
between signed and unsigned" warning
2020-09-22 10:39:29 +02:00
regnat
97b5154750
Disable FORTIFY_SOURCE when compiling without optims
...
Otherwise the build is cluttered with
```
/nix/store/fwpn2f7a4iqszyydw7ag61zlnp6xk5d3-glibc-2.30-dev/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
382 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)
| ^~~~~~~
```
when building with `OPTIMIZE=0`
2020-09-22 10:04:25 +02:00
John Ericson
3786a801c3
Merge remote-tracking branch 'upstream/master' into ca-floating-upstream
2020-09-22 04:15:55 +00:00
John Ericson
b92d3b2edd
Merge remote-tracking branch 'upstream/master' into templated-daemon-protocol
2020-09-22 00:45:55 +00:00
Michael Reilly
d860295e11
Bump nlohmann-json version to 3.9.1
2020-09-21 14:24:43 -04:00
Cole Helbling
ba37299a03
Serialize SandboxMode enum to string for JSON
...
Rather than showing an integer as the default, instead show the boolean
referenced in the description.
The nix.conf.5 manpage used to show "default: 0", which is unnecessarily
opaque and confusing (doesn't 0 mean false, even though the default is
true?); now it properly shows that the default is true.
2020-09-21 10:36:45 -07:00
Eelco Dolstra
ecc8672aa0
fmt.hh: Don't include boost/algorithm/string/replace.hpp
...
This cuts compilation time by ~49s.
Issue #4045 .
2020-09-21 19:07:55 +02:00
Eelco Dolstra
557d2427ee
Random header cleanup
2020-09-21 18:59:02 +02:00
Eelco Dolstra
0716adaa8b
abstractsettingtojson.hh -> abstract-setting-to-json.hh
2020-09-21 18:49:43 +02:00
Eelco Dolstra
340ca382c4
Don't include nlohmann/json.hpp in globals.hh
...
This reduces compilation time by 207s.
Issue #4045 .
2020-09-21 18:47:18 +02:00
Eelco Dolstra
d51ba43047
Move Callback into its own header
...
This gets rid of the inclusion of <future> in util.hh, cutting
compilation time by ~20s (CPU time).
Issue #4045 .
2020-09-21 18:42:21 +02:00
Marwan Aljubeh
f80ffeb8c9
Update the variable name accordingly
2020-09-21 17:29:08 +01:00
Eelco Dolstra
e8e1d420f3
Don't include <regex> in header files
...
This reduces compilation time by ~15 seconds (CPU time).
Issue #4045 .
2020-09-21 18:22:45 +02:00
Marwan Aljubeh
4e1a04733d
Use a better name for the config option
2020-09-21 16:32:22 +01:00
Eelco Dolstra
cbe0bb29f4
Merge pull request #4035 from Ma27/url-attr
...
libfetchers/github: allow `url` attribute
2020-09-21 17:26:36 +02:00
Maximilian Bosch
56f1e0df05
libfetchers/github: rename url to host
2020-09-21 16:29:08 +02:00
Eelco Dolstra
d110fdd03f
Disable precompiled headers in 'nix develop'
...
They're still enabled in regular builds though.
2020-09-21 13:30:05 +02:00
Eelco Dolstra
fd721f06f5
Merge pull request #4043 from tweag/update-lowdown
...
Update lowdown version
2020-09-21 13:13:35 +02:00
regnat
9aa0dafe20
Update lowdown version
...
Fix #4042
According to https://github.com/kristapsdz/lowdown/commit/8aef9e9290de22a10c14ae138257bc1c7fa8ba1f , we shouldn't need to use a fork anymore so we can switch back to upstream
2020-09-21 13:11:31 +02:00
Eelco Dolstra
18eb0774bc
Merge pull request #4023 from maljub01/patch-2
...
Fix the nix-daemon Mac OS SSL CA cert
2020-09-21 12:32:06 +02:00
Eelco Dolstra
d93b373594
Merge pull request #4036 from chreekat/b/prefetch-executable
...
nix-prefetch-url: Add --executable flag
2020-09-21 12:25:46 +02:00
Robert Hensing
ca30abb3fb
Document addCAToStore/addToStoreFromDump source drainage
...
Also checked that all usages satisfy the requirement and
removed dead code.
2020-09-21 07:55:47 +02:00
Robert Hensing
fa08db5c4c
wopAddToStore: return ValidPathInfo
...
A ValidPathInfo is created anyway. By returning it we can save a
roundtrip and we have a nicer interface.
2020-09-21 07:55:47 +02:00
Robert Hensing
7c68264085
wopAddToStore: add RepairFlag
2020-09-21 07:55:47 +02:00
Robert Hensing and John Ericson
fbf509c113
parseContentAddressMethodPrefix: use string_view
...
Co-authored-by: John Ericson <git@JohnEricson.me >
2020-09-21 07:55:47 +02:00
Robert Hensing
8279178b07
Move FramedSink next to FramedSource
2020-09-21 07:55:47 +02:00
Robert Hensing and John Ericson
ecc8088cb7
wopAddToStore: Throw to clarify unused refs
...
Co-authored-by: John Ericson <git@JohnEricson.me >
2020-09-21 07:55:47 +02:00
Robert Hensing
c602ebfb34
Refactor wopAddToStore to make wopAddTextToStore obsolete
2020-09-21 07:55:45 +02:00
Robert Hensing
e34fe47d0c
Overhaul wopAddToStore
2020-09-21 07:54:05 +02:00
Marwan Aljubeh
e40772cd35
Lint issue: replacing tabs with spaces
2020-09-18 17:18:45 +01:00
Marwan Aljubeh
c00e078343
Add a nix.conf option for allowing a symlinked store
2020-09-18 17:10:39 +01:00
Bryan Richter
5fe375a8f1
nix-prefetch-url: Add --executable flag
...
pkgs.fetchurl supports an executable argument, which is especially nice
when downloading a large executable. This patch adds the same option to
nix-prefetch-url.
I have tested this to work on the simple case of prefetching a little
executable:
1. nix-prefetch-url --executable https://my/little/script
2. Paste the hash into a pkgs.fetchurl-based package, script-pkg.nix
3. Delete the output from the store to avoid any misidentified artifacts
4. Realise the package script-pkg.nix
5. Run the executable
I repeated the above while using --name, as well.
I suspect --executable would have no meaningful effect if combined with
--unpack, but I have not tried it.
2020-09-18 19:09:45 +03:00
Maximilian Bosch
2bcf8cbe7a
libfetchers/github: allow url attribute
...
Since 108debef6f we allow a
`url`-attribute for the `github`-fetcher to fetch tarballs from
self-hosted `gitlab`/`github` instances.
However it's not used when defining e.g. a flake-input
foobar = {
type = "github";
url = "gitlab.myserver";
/* ... */
}
and breaks with an evaluation-error:
error: --- Error --------------------------------------nix
unsupported input attribute 'url'
(use '--show-trace' to show detailed location information)
This patch allows flake-inputs to be fetched from self-hosted instances
as well.
2020-09-18 14:10:45 +02:00
Eelco Dolstra
958bf57123
nix build: find() -> get()
...
find() returns an iterator so "!attr" doesn't work.
2020-09-18 13:10:42 +02:00
Robert Hensing
14b30b3f3d
Move FramedSource and FramedSink, extract withFramedSink
2020-09-17 20:21:04 +02:00
Robert Hensing
dfa547c6a8
Add ContentAddressMethod and parse/render it
2020-09-17 20:21:04 +02:00
Robert Hensing
29c82ccc77
Add Source.drainInto(Sink)
2020-09-17 20:21:04 +02:00
Robert Hensing
9ee3122ec7
Remove redundant import
2020-09-17 20:21:04 +02:00
Robert Hensing
3f93bc0d39
Typo
2020-09-17 20:21:04 +02:00
John Ericson
b7df353f27
Merge remote-tracking branch 'upstream/master' into ca-floating-upstream
2020-09-17 16:33:10 +00:00
Eelco Dolstra
649d3aaf24
Merge pull request #3829 from obsidiansystems/remove-storetype-delegate-regStore
...
Remove storetype delegate reg store -- contains #3736
2020-09-17 13:55:01 +02:00
Eelco Dolstra
b94a35ef40
Merge pull request #4027 from tweag/fix-gc-of-ca-derivations
...
Fix garbage collection of CA derivations
2020-09-17 13:46:26 +02:00
Eelco Dolstra
fe5cbfd48f
Merge pull request #4025 from NixOS/remove-corepkgs-config
...
Remove corepkgs/config.nix
2020-09-17 13:42:05 +02:00
regnat
520895b1da
Fix garbage collection of CA derivations
...
Fix #4026
2020-09-17 13:36:58 +02:00
Eelco Dolstra
c9f51e8705
Remove corepkgs/config.nix
...
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-17 10:42:51 +02:00
Eelco Dolstra
787469c7b6
Remove corepkgs/unpack-channel.nix
2020-09-17 09:41:02 +02:00
Eelco Dolstra
10d1865f5f
Remove corepkgs/derivation.nix
2020-09-17 09:41:02 +02:00
John Ericson
f60b380a7f
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
2020-09-16 22:35:24 +00:00
John Ericson
2741fffa35
Ensure resolved CA derivations are written
...
so we can link outputs to deriver and thus properly cache.
2020-09-16 17:57:32 +00:00
John Ericson
7fdbb377ba
Start to fix floating CA + remote building
2020-09-16 17:50:48 +00:00
John Ericson
c5ccebae00
Merge remote-tracking branch 'upstream/master' into ca-floating-upstream
2020-09-16 17:50:40 +00:00
Greg Hale
a303c0b6dc
Fetch commits from github/gitlab using Auth header
...
`nix flake info` calls the github 'commits' API, which requires
authorization when the repository is private. Currently this request
fails with a 404.
This commit adds an authorization header when calling the 'commits' API.
It also changes the way that the 'tarball' API authenticates, moving the
user's token from a query parameter into the Authorization header.
The query parameter method is recently deprecated and will be disallowed
in November 2020. Using them today triggers a warning email.
2020-09-16 13:46:48 -04:00
Marwan Aljubeh
b7c02232b2
Fix the nix-daemon Mac OS SSL CA cert
...
Mac OS multi-user installations are currently broken because all requests
made by nix-daemon to the binary cache fail with:
```
unable to download ... Problem with the SSL CA cert (path? access rights?) (77).
```
This change ensures that the nix-daemon knows where to find the SSL CA cert file.
Fixes #2899 and #3261 .
2020-09-16 17:56:43 +01:00
Eelco Dolstra
5080d4e7b2
Merge branch 'document-store-options' of https://github.com/tweag/nix
2020-09-16 17:02:30 +02:00
Eelco Dolstra
0066ef6c59
Fix doc generation
2020-09-16 16:56:28 +02:00
Eelco Dolstra
39bc49318f
jq -> nix
2020-09-16 14:58:06 +02:00
Eelco Dolstra
2eacc1bc00
builtins.toFile: Fix indentation
2020-09-16 14:18:46 +02:00
Théophane Hufschmitt and Eelco Dolstra
77a0e2c5be
Remove useless exception copy
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-09-16 14:00:21 +02:00
regnat
c29624bf7d
Add a test for nix describe-stores
...
Doesn't test much, but at least ensures that the command runs properly
2020-09-16 13:53:28 +02:00
regnat
d72927aa7a
Fix the s3 store
...
Add some necessary casts in the initialisation of the store's config
2020-09-16 13:53:09 +02:00
regnat
e0817cbcdc
Don't include nlohmann/json.hpp in config.hh
...
Instead make a separate header with the template implementation of
`BaseSetting<T>::toJSONObj` that can be included where needed
2020-09-16 13:53:09 +02:00
regnat
93c0e14a30
Include the full nlohmann/json header in config.hh
...
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-16 13:53:09 +02:00
regnat
fc2d31c423
Add (StoreConfig*) casts to work around a GCC bug
...
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-16 13:53:09 +02:00
regnat
a1e82ba450
fixup! Add a default value for the settings
2020-09-16 13:53:09 +02:00
regnat
888f7afe9f
Fix build issues with gcc
2020-09-16 13:53:09 +02:00
regnat
634cb2a5ae
Add a markdown output to nix describe-stores
2020-09-16 13:53:09 +02:00
regnat
b73adacc1e
Add a name to the stores
...
So that it can be printed by `nix describe-stores`
2020-09-16 13:53:09 +02:00
regnat
f24f0888f9
Document the new store hierarchy
2020-09-16 13:53:09 +02:00
regnat
d65962db4d
Make uri schemes grammar more RFC-compliant
...
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-16 13:53:09 +02:00
regnat
29a632386e
fixup! Make the store plugins more introspectable
2020-09-16 13:53:09 +02:00
regnat
1129913c4e
fixup! Correctly call all the parent contructors of the stores
2020-09-16 13:53:09 +02:00
regnat
7f103dcddd
Properly filter the stores according to their declared uriSchemes
...
When opening a store, only try the stores whose `uriSchemes()` include
the current one
2020-09-16 13:53:09 +02:00
regnat
5895184df4
Correctly call all the parent contructors of the stores
...
Using virtual inheritance means that only the default constructors of
the parent classes will be called, which isn't what we want
2020-09-16 13:53:09 +02:00
regnat
d184ad1d27
fixup! Make the store plugins more introspectable
2020-09-16 13:53:09 +02:00
regnat
dae39f0a7a
Make nix describe-stores functional
...
Using the `*Config` class hierarchy
2020-09-16 13:53:08 +02:00
regnat
22afa8fb4d
Separate store configs from the implems
...
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-16 13:53:08 +02:00
regnat
aa4eac3788
fixup! Separate the instantiation and initialisation of the stores
2020-09-16 13:53:08 +02:00
regnat
35042c9623
Add a default value for the settings
...
The default value is initialized when creating the setting and unchanged
after that
2020-09-16 13:53:08 +02:00
regnat
3c525d1590
Complete the toJSON instance for Setting<T>
...
Don't let it just contain the value, but also the other fields of the
setting (description, aliases, etc..)
2020-09-16 13:53:08 +02:00
regnat
3b57181f8e
Separate the instantiation and initialisation of the stores
...
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-16 13:53:08 +02:00
regnat
fa32560169
Fix the registration of stores
2020-09-16 13:53:08 +02:00
regnat
7d5bdf8b56
Make the store plugins more introspectable
...
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-16 13:53:08 +02:00
Eelco Dolstra
609a6d6d9f
Merge branch 'single-ca-drv-build' of https://github.com/obsidiansystems/nix
2020-09-16 12:14:01 +02:00
John Ericson
3a5cdd737c
Rename Derivation::pathOpt to Derivation::path
...
We no longer need the `*Opt` to disambiguate.
2020-09-15 15:21:39 +00:00
John Ericson
6387550d58
Get rid of confusing std::optional<bool> for validity
2020-09-15 15:19:45 +00:00
John Ericson
c4bf219b55
Don't link deriver until after any delayed exception is thrown
...
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-15 14:28:06 +00:00
John Ericson
3ba552b245
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-09-15 14:17:06 +00:00
John Ericson
c08c9f08c7
Merge remote-tracking branch 'upstream/master' into remove-storetype-delegate-regStore
2020-09-15 14:08:35 +00:00
Eelco Dolstra
733d2e9402
.gitignore: inst -> outputs
2020-09-15 13:48:42 +02:00
Eelco Dolstra
2a80170920
Merge pull request #4014 from tweag/fix-queryDrvOutputMaps-for-old-daemons
...
gracefully handle old daemon versions
2020-09-15 11:25:19 +02:00
regnat
057c6203b5
gracefully handle old daemon versions
...
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-15 09:58:01 +02:00
Eelco Dolstra
885cc91405
Merge pull request #4012 from tweag/3989-escape-dollar-in-manifest
...
Escape `${` in strings when printing Nix expressions
2020-09-14 18:38:23 +02:00
regnat
250f8a4bba
Escape ${ in strings when printing Nix expressions
...
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-14 17:19:25 +02:00
Eelco Dolstra
a59e77d9e5
nix-daemon: Lower verbosity of restricted setting warning
...
Fixes #3992 .
2020-09-14 13:48:51 +02:00
Eelco Dolstra
35ba092019
Merge pull request #4005 from Infinisil/fix-autoArgs
...
Fix auto argument passing for more auto arguments than formals
2020-09-14 13:31:23 +02:00
Eelco Dolstra
9e5e5e6217
Merge pull request #4010 from leungbk/ccls
...
Add ccls files to .gitignore
2020-09-14 13:19:26 +02:00
Eelco Dolstra
8ebd10664e
Merge pull request #4008 from aszlig/fix-ub-in-reading-ca-map
...
Fix unspecified behaviour in readStorePathCAMap
2020-09-14 13:18:52 +02:00
Brian Leung
c8b17212c8
Add ccls files to .gitignore
2020-09-13 14:40:23 -07:00
aszlig
525b38eee8
Fix unspecified behaviour in readStorePathCAMap
...
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 66a62b3189 .
[1]: https://en.wikipedia.org/wiki/Unspecified_behavior#Order_of_evaluation_of_subexpressions
Signed-off-by: aszlig <aszlig@nix.build >
2020-09-13 02:40:51 +02:00
Jade and lf-
7cb5f643a6
docs+test: fix remaining installer downloads without -L ( #4006 )
...
Co-authored-by: lf- <lf-@users.noreply.github.com >
2020-09-12 22:08:40 +02:00
Silvan Mosberger
8dbd57a6a5
Fix auto argument passing for more auto arguments than formals
...
The change in 626200713b 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)
2020-09-11 20:41:51 +02:00
Domen Kožar
e1f2c93f88
Merge pull request #3988 from Gabriel439/gabriel/preserve_ps1
...
Add `nix-shell` support for preserving PS1
2020-09-11 12:33:03 +02:00
Vladimír Čunát
77d4758cf2
Merge #3982 : Minor docs updates
2020-09-07 21:54:59 +02:00
Gabriel Gonzalez
ee5906243a
Add nix-shell support for preserving PS1
...
Fixes https://github.com/NixOS/nix/issues/1268
`nix-shell` will now preserve `PS1` if the `NIX_SHELL_PRESERVE_PROMPT`
environment variable is set.
2020-09-04 20:05:43 -07:00
John Ericson
98dfd7531d
Fix querying outputs for CA derivations some more
...
If we resolve using the known path of a derivation whose output we
didn't have, we previously blew up. Now we just fail gracefully,
returning the map of all outputs unknown.
2020-09-04 18:33:58 +00:00
John Ericson
075d399e3f
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
2020-09-04 16:04:35 +00:00
John Ericson
5aed6f9b25
Document mkOutputString
2020-09-04 15:58:42 +00:00
John Ericson
e9fad3006b
Fix some of the issues raised by @edolstra
...
- More and better comments
- The easier renames
2020-09-04 15:18:25 +00:00
John Ericson and Eelco Dolstra
e86dd59dcc
Apply suggestions from code review
...
Thanks!
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-09-04 10:48:50 -04:00
John Ericson and Théophane Hufschmitt
c9f1ed912c
Don't chmod symlink before moving outputs around
...
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com >
2020-09-04 14:41:53 +00:00
John Ericson and Théophane Hufschmitt
b99062b023
Update tests/content-addressed.nix
...
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com >
2020-09-04 10:29:28 -04:00
John Ericson
ec14465a00
Separate lowdown lib and bin to be more precise
2020-09-04 02:43:56 +00:00
John Ericson
25f7ff16fa
Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-builds
2020-09-04 02:40:36 +00:00
John Ericson
e12bcabdcb
Remove duplicate buildInputs
2020-09-04 02:30:12 +00:00
John Ericson
aad4abcc9c
Fix floating CA tests
...
We will sometimes try to query the outputs of derivations we can't
resolve. That's fine; it just means we don't know what those outputs are
yet.
2020-09-04 01:17:38 +00:00
John Ericson
4409530fc9
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
2020-09-03 22:45:14 +00:00
John Ericson
b836662f50
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
...
Tests also now fail as they should
2020-09-03 22:45:00 +00:00
John Ericson
c224a5e5c1
Rename derivation in floating CA test
2020-09-03 22:35:13 +00:00
John Ericson
145915eb39
Beef up floating CA derivations test a bit
2020-09-03 22:14:45 +00:00
John Ericson
975a47f7fe
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
2020-09-03 22:09:04 +00:00
John Ericson
e7d93e7ece
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-09-03 15:43:17 +00:00
Eelco Dolstra
8a945d6ddb
Remove gc-check-reachability
2020-09-03 11:30:15 +02:00
Eelco Dolstra
82b77a7726
addPermRoot(): Remove indirect flag
2020-09-03 11:29:34 +02:00
Eelco Dolstra
00d25e8457
Remove the --indirect flag
...
All GC roots are now indirect.
2020-09-03 11:22:00 +02:00
Eelco Dolstra
b07167be5a
createGeneration(): Always create an indirect root
...
This means profiles outside of /nix/var/nix/profiles don't get
garbage-collected. It also means we don't need to scan
/nix/var/nix/profiles for GC roots anymore, except for compatibility
with previously existing generations.
2020-09-03 11:13:53 +02:00
Eelco Dolstra
b74f5cdd23
createGeneration(): Take a StorePath
2020-09-03 11:06:56 +02:00
Eelco Dolstra
94a043ff3b
EvalCache: Fix caching of strings
...
This was broken in 50f13b06fb . Once
again it turns out that putting a bool in a std::variant is a bad
idea, since pointers get silently cast to them...
2020-09-02 14:16:44 +02:00
Eelco Dolstra
14652da432
Merge pull request #3981 from domenkozar/http-binary-cache-allow-absolute-urls
...
Allow HTTP binary cache to request absolute uris
2020-09-02 12:06:28 +02:00
Domen Kožar
dd4b56c87f
Allow HTTP binary cache to request absolute uris
2020-09-01 21:35:48 +02:00
Cole Helbling
a72ed3e8a1
hacking.md: add --prefix flag to configure
...
Otherwise, the steps advertised in this document won't actually work
(e.g. `make install` will fail, trying to access /usr, and
`./inst/bin/nix` won't exist).
2020-09-01 12:06:02 -07:00
Cole Helbling
a76b8b5467
README: update link to Hacking section
2020-09-01 12:05:49 -07:00
John Ericson
ef278d00f9
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-09-01 18:01:48 +00:00
Eelco Dolstra
6d7f7efb89
github: Use access token when calling .../commits API
2020-09-01 15:29:04 +02:00
Eelco Dolstra
b721877b85
Merge pull request #3857 from edolstra/markdown
...
Convert manual to Markdown
2020-09-01 10:31:17 +02:00
Eelco Dolstra
50f46836f3
Merge remote-tracking branch 'origin/master' into markdown
2020-09-01 09:48:08 +02:00
Eelco Dolstra
ebb8e076eb
Restore some of the shellHook
2020-08-31 16:39:54 +02:00
Eelco Dolstra
84f5cabbea
Merge remote-tracking branch 'origin/master' into markdown
2020-08-31 14:24:26 +02:00
Domen Kožar
56707218f6
Merge pull request #3970 from NixOS/domenkozar-patch-1
...
speed up CI
2020-08-30 23:12:11 +02:00
Domen Kožar
f38fe24346
speed up CI
2020-08-30 22:52:34 +02:00
Domen Kožar
8757e7022a
mention how to run a single functional test for faster feedback loop
2020-08-30 19:41:21 +02:00
John Ericson
4db0010a93
Test CA derivation input caching
2020-08-28 22:03:54 +00:00
John Ericson
02e0001fc0
Merge branch 'ca-floating-upstream' of github.com:obsidiansystems/nix into ca-floating-upstream
2020-08-28 21:23:09 +00:00
John Ericson
421ed527c7
Update src/libstore/build.cc
...
Thanks for catching, @regnat.
2020-08-28 17:22:57 -04:00
John Ericson
48e8828050
Merge remote-tracking branch 'obsidian/single-ca-drv-build' into ca-floating-upstream
2020-08-28 20:38:25 +00:00
John Ericson
8017fe7487
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-08-28 19:59:14 +00:00
Eelco Dolstra
f15651303f
nix develop: Add convenience flags for running specific phases
...
For example, for building the Nix flake, you would do:
$ nix develop --configure
$ nix develop --install
$ nix develop --installcheck
2020-08-28 19:24:29 +02:00
Eelco Dolstra
50a8710ed1
Close stdin while running tests
...
For some reason, the bash shell started by 'nix develop' sometimes
reads from stdin, which can hang.
2020-08-28 18:43:34 +02:00
Eelco Dolstra
3156560d41
nix develop: Set output paths to writable locations
...
Currently, they're set to $(pwd)/outputs/$outputName. This allows
commands like 'make install' to work.
2020-08-28 18:16:03 +02:00
Eelco Dolstra
691a1bd717
Merge branch 'minimal-logger' of https://github.com/Ma27/nix
2020-08-28 10:50:52 +02:00
Eelco Dolstra
f4d3b4fb76
Merge pull request #3965 from glittershark/fix-top-level-ellipsis
...
Pass all args when auto-calling a function with an ellipsis
2020-08-27 19:52:43 +02:00
Griffin Smith
626200713b
Pass all args when auto-calling a function with an ellipsis
...
The command line options --arg and --argstr that are used by a bunch of
CLI commands to pass arguments to top-level functions in files go
through the same code-path as auto-calling top-level functions with
their default arguments - this, however, was only passing the arguments
that were *explicitly* mentioned in the formals of the function - in the
case of an as-pattern with an ellipsis (eg args @ { ... }) extra passed
arguments would get omitted. This fixes that to instead pass *all*
specified auto args in the case that our function has an ellipsis.
Fixes #598
2020-08-27 12:38:25 -04:00
Eelco Dolstra
eb75282b8d
Merge pull request #3434 from Ericson2314/derivation-header-include-order
...
Revise division of labor in deserialization of derivations
2020-08-27 16:39:28 +02:00
Eelco Dolstra
e915fd6d2a
Typo
2020-08-27 14:51:50 +02:00
Eelco Dolstra
a0f19d9f3a
RemoteStore::addToStore(): Fix race between stderrThread and NAR writer
...
As pointed out by @B4dM4n, the call to to.flush() on stderrThread is
unsafe because the NAR writer thread is also writing to 'to'.
Fixes #3943 .
2020-08-27 14:50:51 +02:00
Eelco Dolstra
c3efef9275
Remove obsolete comment
2020-08-26 09:28:10 +02:00
Eelco Dolstra
4bf5faf416
Merge remote-tracking branch 'origin/master' into markdown
2020-08-25 19:47:34 +02:00
Eelco Dolstra
7a02865b94
Move import docs
2020-08-25 14:06:01 +02:00
Eelco Dolstra
f53b5f1058
Add getDoc() function
2020-08-25 13:31:11 +02:00
Eelco Dolstra
3ccf3801fb
Merge pull request #3948 from garbas/fix-3947
...
set Content-Type to "text/plain" for install script
2020-08-25 12:47:38 +02:00
Eelco Dolstra
2a2121d264
Use RegisterPrimOp for some undocumented primops
2020-08-25 11:25:01 +02:00
Eelco Dolstra
b8416779e3
Document some primops
2020-08-25 11:16:45 +02:00
Eelco Dolstra
24b1c2c66b
Fix tests
2020-08-25 10:51:14 +02:00
Eelco Dolstra
f5219f8d84
Fix perlBindings job
2020-08-25 10:33:41 +02:00
Eelco Dolstra
b42789f013
Fix clang build
2020-08-24 21:13:39 +02:00
John Ericson and Théophane Hufschmitt
8eb73a8724
CA derivations that depend on other CA derivations
...
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com >
2020-08-24 19:01:15 +00:00
John Ericson
e0b0e18905
Add constructor for BasicDerivation -> Derivation
2020-08-24 19:01:07 +00:00
John Ericson
59979e7053
Fix bad debug format string
2020-08-24 19:01:07 +00:00
Eelco Dolstra
d9a8619762
Don't barf if corepkgs is in the store but not a valid path
...
This can happen when using a dummy store (or indeed any non-local store).
2020-08-24 19:15:17 +02:00
Eelco Dolstra
6a67e57019
Add DummyStore (dummy://)
...
DummyStore does not allow building or adding paths. This is useful for
evaluation tests when you don't want to initialize a "proper" store.
2020-08-24 18:54:16 +02:00
Eelco Dolstra
d0690bc311
nix repl ':doc': Render using lowdown
2020-08-24 18:10:33 +02:00
Eelco Dolstra
0f314f3c25
Generate builtins section of the manual
2020-08-24 14:49:30 +02:00
Eelco Dolstra
a990f063ff
Move primop docs inline
...
This makes them available to 'nix repl'.
2020-08-24 14:31:10 +02:00
Eelco Dolstra
33b1679d75
Allow primops to have Markdown documentation
2020-08-24 13:16:02 +02:00
Eelco Dolstra
88d5c9ec58
Fix tests
2020-08-24 10:37:10 +02:00
Eelco Dolstra
2530cc6827
Merge pull request #3950 from obsidiansystems/tabs-spaces
...
tabs -> spaces
2020-08-24 10:20:28 +02:00
Eelco Dolstra
187cc1fa2f
Merge pull request #3952 from obsidiansystems/write-derivation-borrow
...
`writeDerivation` just needs a plain store reference
2020-08-24 10:20:04 +02:00
John Ericson
b0b59fd05a
Merge remote-tracking branch 'obsidian/write-derivation-borrow' into HEAD
2020-08-23 15:11:10 +00:00
John Ericson
35e6288be1
writeDerivation just needs a plain store reference
2020-08-23 15:01:11 +00:00
John Ericson
3a7b330b64
"Downstream placeholders" should not be store paths
...
Insead they should be opaque `/<hash>` like the placeholders we already
have.
2020-08-21 19:35:35 +00:00
John Ericson
422affe102
tabs -> spaces
...
Sorry I let the tab sneak in there in the first place.
2020-08-21 19:19:24 +00:00
John Ericson
c265e0ea82
Merge remote-tracking branch 'upstream/master' into templated-daemon-protocol
2020-08-20 20:24:22 +00:00
John Ericson
27a3f82c0b
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-08-20 18:28:17 +00:00
John Ericson
45a2f1baab
Rename drv output querying functions, like master
...
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap`
- `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap
2020-08-20 18:14:12 +00:00
Eelco Dolstra
4d77513d97
Merge pull request #3859 from obsidiansystems/drv-outputs-map-allow-missing
...
`queryDerivationOutputMap` no longer assumes all outputs have a mapping
2020-08-20 16:49:23 +02:00
John Ericson
9a9d834dc7
Rename drv output querying functions
...
- `queryDerivationOutputMapAssumeTotal` -> `queryPartialDerivationOutputMap`
- `queryDerivationOutputMapAssumeTotal` -> `queryDerivationOutputMap`
2020-08-20 14:12:51 +00:00
Rok Garbas
8ce88adad9
set Content-Type to "text/plain" for install script
...
fixes #3947
2020-08-20 13:21:22 +02:00
Eelco Dolstra
25ecfffdc3
Remove PrimOp constructor
2020-08-20 12:34:04 +02:00
Eelco Dolstra
dc2f278c95
Allow 'nix' subcommands to provide docs in Markdown format
2020-08-20 12:21:46 +02:00
Eelco Dolstra
3c4f8c9175
List deprecated option aliases in the docs
2020-08-20 11:13:17 +02:00
Eelco Dolstra
acb99f03f9
Config: Use nlohmann/json
2020-08-20 11:02:16 +02:00
Eelco Dolstra
0d7376bd8a
Merge pull request #3945 from ryantm/patch-1
...
fix spelling
2020-08-20 10:24:32 +02:00
John Ericson
3df78858f2
Fix max fd calc and add test
2020-08-20 05:08:50 +00:00
Ryan Mulligan
f36793c7b9
fix spelling
2020-08-19 20:31:01 -07:00
John Ericson
a83694c7a1
Use RemoteStore to open connection for proxying daemon
...
Removes duplicate websocket opening code, and also means we should be
able to to ssh-ssh-... daemon relays, not just uds-uds-... ones.
2020-08-19 19:34:47 +00:00
Eelco Dolstra
b4ef3d7078
Revert "Add a separate manual job"
...
This reverts commit 5e3ad1dde0 . Manual
generation now depends on the 'nix' command.
2020-08-19 21:00:57 +02:00
Eelco Dolstra
c3e20d8c28
Consistency
2020-08-19 18:30:17 +02:00
Eelco Dolstra
c8fa39324a
Generate the nix.conf docs from the source code
...
This means we don't have two (divergent) sets of option descriptions
anymore.
2020-08-19 18:28:04 +02:00
John Ericson
d5af5763cf
Merge branch 'master' of github.com:NixOS/nix into remove-storetype-delegate-regStore
2020-08-19 15:54:50 +00:00
Eelco Dolstra
34b22e0123
Change option descriptions to Markdown
2020-08-19 14:21:27 +02:00
Eelco Dolstra
8a97b11374
Improve margins between sections
...
The default CSS puts almost no space between sections, but a lot of
space between subsections. This flips that around.
2020-08-19 12:31:18 +02:00
John Ericson
be0d429b95
Merge branch 'master' of github.com:NixOS/nix into templated-daemon-protocol
2020-08-19 03:17:41 +00:00
John Ericson
950ddfdb82
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
2020-08-18 14:36:44 +00:00
Eelco Dolstra
1c8b550e34
Merge pull request #3917 from obsidiansystems/output-env-var-unconditional
...
Simplify code as output env vars are unconditional
2020-08-18 16:21:17 +02:00
Eelco Dolstra
0c9365c6ba
Merge pull request #3940 from obsidiansystems/fixed-output-remote-builder-test
...
Add commented-out test for remote building with fixed output derivations
2020-08-18 16:12:35 +02:00
Eelco Dolstra
dfeb76dbf9
Merge pull request #3930 from obsidiansystems/legacy-ssh-build-paths
...
Define `LegacySSHStore::buildPaths` using `cmdBuildPaths`
2020-08-18 16:07:40 +02:00
Eelco Dolstra
069340179e
Improve nix.1 manpage generator
2020-08-18 15:15:35 +02:00
Carlo Nucera
07975979aa
Comment out fixed content address test
2020-08-17 15:04:54 -04:00
Eelco Dolstra
6f19c776db
Start generation of the nix.1 manpage
2020-08-17 19:33:18 +02:00
Eelco Dolstra
a72a20d68f
Add 'nix dump-args' to dump all commands/flags for manpage generation
2020-08-17 17:44:52 +02:00
Eelco Dolstra
7cdc739ece
Merge remote-tracking branch 'origin/master' into markdown
2020-08-17 13:43:39 +02:00
Eelco Dolstra
e849b19872
Merge pull request #3932 from chkno/no-show-signature
...
Don't try to parse signature check as commit timestamp
2020-08-17 11:00:24 +02:00
Eelco Dolstra
847a5392f4
Merge branch 'ca-no-need-trust' of https://github.com/obsidiansystems/nix
2020-08-17 10:57:02 +02:00
Eelco Dolstra
3c619f6290
Merge branch 'test-RemoteStore-buildDerivation' of https://github.com/obsidiansystems/nix
2020-08-17 10:53:18 +02:00
John Ericson
dbf96e10ec
Test remote building with fixed output derivations
2020-08-16 17:38:12 +00:00
John Ericson
6f7ac5e865
Remove extra closing paren
2020-08-14 21:59:31 +00:00
John Ericson
f899a7c6d7
Work around clang bug
2020-08-14 18:51:31 +00:00
John Ericson
3c8b5b6219
Merge remote-tracking branch 'upstream/master' into single-ca-drv-build
2020-08-14 17:00:13 +00:00
John Ericson and Eelco Dolstra
4b571ea321
Update src/libstore/daemon.cc
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-08-14 11:52:37 -04:00
Eelco Dolstra
13e49be660
Merge pull request #3875 from obsidiansystems/new-interface-for-path-pathOpt
...
Offer a safer interface for path and pathOpt
2020-08-14 17:19:19 +02:00
Eelco Dolstra
7714d9a943
Merge pull request #3924 from obsidiansystems/features-per-store
...
Make `system-features` a store setting
2020-08-14 17:13:07 +02:00
Eelco Dolstra
9b9d5297ba
Merge pull request #3909 from matthewbauer/readd-hashed-mirrors
...
Add hashed-mirrors back
2020-08-14 17:05:47 +02:00
Eelco Dolstra
d81f13f7cb
Merge pull request #3899 from obsidiansystems/make-narHash-not-optional
...
Make narHash in ValidPathInfo not optional
2020-08-14 17:00:18 +02:00
Chuck
ed026f7206
Don't try to parse signature check as commit timestamp
...
When the log.showSignature git setting is enabled, the output of
"git log" contains signature verification information in addition to the
timestamp GitInputScheme::fetch wants:
$ git log -1 --format=%ct
gpg: Signature made Sat 07 Sep 2019 02:02:03 PM PDT
gpg: using RSA key 0123456789ABCDEF0123456789ABCDEF01234567
gpg: issuer "user@example.com "
gpg: Good signature from "User <user@example.com >" [ultimate] 1567890123
1567890123
For folks that had log.showSignature set, this caused all nix operations
on flakes to fail:
$ nix build
error: stoull
2020-08-13 17:44:42 -07:00
John Ericson
e1308b1211
Define LegacySSHStore::buildPaths using cmdBuildPaths
...
Evidentally this was never implemented because Nix switched to using
`buildDerivation` exclusively before `build-remote.pl` was rewritten.
The `nix-copy-ssh` test (already) tests this.
2020-08-13 21:27:55 +00:00
John Ericson
5ccd94501d
Allow trustless building of CA derivations
...
Include a long comment explaining the policy. Perhaps this can be moved
to the manual at some point in the future.
Also bump the daemon protocol minor version, so clients can tell whether
`wopBuildDerivation` supports trustless CA derivation building. I hope
to take advantage of this in a follow-up PR to support trustless remote
building with the minimal sending of derivation closures.
2020-08-13 18:15:57 +00:00
Eelco Dolstra
e11bbfb0ab
Merge pull request #3928 from obsidiansystems/more-tee
...
Use `TeeSink` and `TeeSouce` in a few more places
2020-08-13 17:19:50 +02:00
John Ericson
85aacbee64
Use TeeSink and TeeSouce in a few more places
2020-08-13 14:51:17 +00:00
Eelco Dolstra
859cd4acea
Merge pull request #3923 from obsidiansystems/daemon-auth-cleanup
...
Separate auth and logic for the daemon
2020-08-13 11:01:53 +02:00
John Ericson
d2f2be0f70
Test RemoteStore::buildDerivation
...
Fix `wopNarFromPath` which needed a `toRealPath`.
2020-08-13 04:07:14 +00:00
John Ericson
5d67f18c86
Merge branch 'daemon-auth-cleanup' of github.com:obsidiansystems/nix into HEAD
2020-08-12 18:22:31 +00:00
John Ericson
4720853129
Make system-features a store setting
...
This seems more correct. It also means one can specify the features a
store should support with --store and remote-store=..., which is useful.
I use this to clean up the build remotes test.
2020-08-12 18:13:00 +00:00
John Ericson
8d4162ff9e
Separate auth and logic for the daemon
...
Before, processConnection wanted to know a user name and user id, and
`nix-daemon --stdio`, when it isn't proxying to an underlying daemon,
would just assume "root" and 0. But `nix-daemon --stdio` (no proxying)
shouldn't make guesses about who holds the other end of its standard
streams.
Now processConnection takes an "auth hook", so `nix-daemon` can provide
the appropriate policy and daemon.cc doesn't need to know or care what
it is.
2020-08-12 15:22:33 +00:00
John Ericson
5f80aea795
Break out lambda so output can be matched just once
...
This is much better.
2020-08-12 02:23:31 +00:00
John Ericson
18834f7764
Recheck path validity after acquiring lock
...
It might have changed, and in any event this is how the cod used to work
so let's just keep it.
2020-08-11 23:44:02 +00:00
John Ericson
2de201254e
Don't assume a total output map in two places in build.cc
...
Thanks @regnat for catching one of them. The other follows for many of
the same reasons. I'm find fixing others on a need-to-fix basis,
provided their are no regressions.
2020-08-11 23:07:50 +00:00
John Ericson
4c6aac8fdf
Clarify comment on sandbox and temp fresh paths
2020-08-11 22:46:05 +00:00
John Ericson
6d57139050
Clarify outputReferences variable with self-describing type
...
Thanks for the idea, @Regnat!
2020-08-11 22:34:09 +00:00
John Ericson
8a068bd025
Remove redundant equality check
2020-08-11 21:25:40 +00:00
John Ericson
07e3466eb4
Float comment to out describe gaveUpOnSubstitution in general
2020-08-11 21:16:14 +00:00
John Ericson and Théophane Hufschmitt
d0f6e338dd
Apply suggestions from code review
...
Thanks!!
Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com >
2020-08-11 16:49:10 -04:00
Eelco Dolstra
574bf60b4d
Merge pull request #3919 from bburdette/issue-2238-demotion
...
demote remote build message to Info
2020-08-11 20:32:29 +02:00
Ben Burdette
1a281ec07f
demote remote build message to Info
2020-08-11 10:29:43 -06:00
Eelco Dolstra
7a911b6783
Merge pull request #3914 from obsidiansystems/small-drv-serialize-cleanup
...
Two small derivation serialization cleanups
2020-08-11 07:14:38 +02:00
Eelco Dolstra
5f263e1fb7
Merge pull request #3916 from Ma27/progress-bar-coloring
...
Always reset ANSI colors in progress-bar line
2020-08-11 07:13:41 +02:00
John Ericson
d3fa8c04c6
Simplify code as output env vars are unconditional
...
Since the jsonObject unique ptr is reset to flush the string to make
`__json`, all these `!jsonObject` conditions will always be true.
2020-08-11 01:13:26 +00:00
John Ericson
2a0902634e
Fix error in merge breaking floating CA drvs
...
Forgot to add this hunk!
2020-08-11 00:13:19 +00:00
Maximilian Bosch
5f8ae16c8b
Always reset ANSI colors in progress-bar line
...
When having a message like `waiting for a machine to build X` and
building with `nix build -L`, the log-prefix is always colored yellow[1]
on a small terminal-width as everything (including the ANSI color-reset) is
stripped away.
To work around that problem, this patch explicitly adds an `ANSI_NORMAL`
to the end of the line.
[1] https://imgur.com/a/FjtJOk3
2020-08-10 17:44:17 +02:00
John Ericson
1b5c24662b
Merge branch 'small-drv-serialize-cleanup' of github.com:obsidiansystems/nix into single-ca-drv-build
2020-08-10 01:57:54 +00:00
John Ericson
581183d4d5
Deduplicate parsing and reading derivations
2020-08-10 01:40:50 +00:00
John Ericson
bcd0629c2e
Remove name parameter from writeDerivation
...
The name is now stored with the derivation itself.
2020-08-10 01:35:59 +00:00
John Ericson
f7696c66e8
Fix perl FFI for floating ca derivations
...
Path is null when not known statically.
2020-08-08 15:48:51 +00:00
John Ericson
e913a2989f
Squashed get CA derivations building
2020-08-07 19:51:55 +00:00
Eelco Dolstra
edfd676e05
Fix .ls file names in binary caches
...
These are not supposed to include the 'name' part of the store
path. This was broken by 759947bf72 .
2020-08-07 21:18:29 +02:00
John Ericson
8f92bb5ad9
Merge branch 'drv-outputs-map-allow-missing' of github.com:obsidiansystems/nix into templated-daemon-protocol
2020-08-07 18:51:01 +00:00
John Ericson
f7ba16f9cb
Merge remote-tracking branch 'upstream/master' into drv-outputs-map-allow-missing
2020-08-07 17:46:39 +00:00
John Ericson
47644e49ca
Specialize std::optional<StorePath> so this is backwards compatible
...
While I am cautious to break parametricity, I think it's OK in this
cases---we're not about to try to do some crazy polymorphic protocol
anytime soon.
2020-08-07 17:05:14 +00:00
John Ericson
39ae9a3d4a
Merge remote-tracking branch 'upstream/master' into fix-and-ci-static-builds
2020-08-07 14:44:47 +00:00
Eelco Dolstra
3c75ddc16b
nix build (and others): Force re-evaluation of cached errors
...
Fixes #3872 .
This is a bit hacky. Ideally we would automatically re-evaluate the
failed attribute iff we need to print the error message (so in
commands like 'nix search' we wouldn't re-evaluate because we're
suppressing errors).
2020-08-07 14:47:23 +02:00
Eelco Dolstra
2ffc058950
Make --no-eval-cache a global setting
2020-08-07 14:13:24 +02:00
Matthew Bauer
96c158d6e1
Fix build
2020-08-06 21:04:31 -05:00
Matthew Bauer
8abc577cc2
Merge remote-tracking branch 'origin/master' into readd-hashed-mirrors
2020-08-06 18:58:59 -05:00
Carlo Nucera
46f9dd56da
Fix bug due to non-deterministic arg eval order
2020-08-06 19:30:05 -04:00
Matthew Bauer
641c950701
Add hashed-mirrors back
...
Some users have their own hashed-mirrors setup, that is used to mirror
things in addition to what’s available on tarballs.nixos.org. Although
this should be feasable to do with a Binary Cache, it’s not always
easy, since you have to remember what "name" each of the tarballs has.
Continuing to support hashed-mirrors is cheap, so it’s best to leave
support in Nix. Note that NIX_HASHED_MIRRORS is also supported in
Nixpkgs through fetchurl.nix.
Note that this excludes tarballs.nixos.org from the default, as in
\#3689. All of these are available on cache.nixos.org.
2020-08-06 18:19:09 -05:00
Carlo Nucera
9ab07e99f5
Use template structs instead of phantoms
2020-08-06 18:04:13 -04:00
Carlo Nucera
3d8240c32e
Remove leftover commented code
2020-08-06 16:04:18 -04:00
Carlo Nucera
f795f0fabc
Merge branch 'drv-outputs-map-allow-missing-namespace' of github.com:obsidiansystems/nix into templated-daemon-protocol
2020-08-06 15:53:09 -04:00
John Ericson
e89b5bd0bf
Minimize the usage of Hash::dummy
2020-08-06 18:31:48 +00:00
John Ericson
5e59b25a23
Merge remote-tracking branch 'upstream/master' into make-narHash-not-optional
2020-08-06 15:34:15 +00:00
Eelco Dolstra
6146447842
Merge pull request #3856 from obsidiansystems/buildable-variant
...
Make `Buildable` a `std::variant`
2020-08-06 14:14:06 +02:00
Eelco Dolstra
59067f0f58
repl.cc: Check for HAVE_BOEHMGC
...
Fixes #3906 .
2020-08-06 11:40:41 +02:00
Eelco Dolstra
3321b2bc65
Merge pull request #3897 from bburdette/error-2238
...
error messages for issue 2238
2020-08-06 11:31:36 +02:00
Carlo Nucera
8b175f58d1
Simplify the namespace
2020-08-05 17:57:07 -04:00
Carlo Nucera
0739d428e0
Solve template deduction problem
...
We had to predeclare our template functions
2020-08-05 17:49:45 -04:00
John Ericson
6c66331d5c
WIP: Put the worker protocol read and write in a namespace to disambig
2020-08-05 20:37:48 +00:00
Carlo Nucera
d5d9907a9e
Fix perl integration
2020-08-05 15:57:42 -04:00
Carlo Nucera
1d2e80ddd6
Merge branch 'master' of github.com:NixOS/nix into new-interface-for-path-pathOpt
2020-08-05 15:45:33 -04:00
John Ericson
ed96e603e1
Proxy -> Phantom to match Rust
...
Sorry, Haskell.
2020-08-05 19:44:08 +00:00
Carlo Nucera
8241e660ba
Remove Hash::operator bool ()
...
Since the hash is not optional anymore
2020-08-05 15:30:38 -04:00
Carlo Nucera
be6e1c6457
Merge branch 'master' of github.com:NixOS/nix into make-narHash-not-optional
2020-08-05 15:14:47 -04:00
Carlo Nucera
1ad6394b33
Add Hash::dummy to signal default value
...
We did this in the same spirit of the dummy value that's present in
libstore/path.hh
2020-08-05 15:11:49 -04:00
Carlo Nucera
1d71028f4d
Remove optionality in ValidPathInfo::narInfo
2020-08-05 14:42:48 -04:00
John Ericson
7302761f64
Merge remote-tracking branch 'obsidian/drv-outputs-map-allow-missing' into templated-daemon-protocol
2020-08-05 17:53:24 +00:00
Ben Burdette
31f1af0cab
don't crash if there's no drvPath
2020-08-05 11:26:06 -06:00
Ben Burdette
e4eae078a5
add derivation path to hint
2020-08-05 11:21:36 -06:00
Ben Burdette
f1a47a96b6
error messages for issue 2238
2020-08-05 10:58:00 -06:00
John Ericson
cf939055c8
Merge remote-tracking branch 'upstream/master' into drv-outputs-map-allow-missing
2020-08-05 16:43:30 +00:00
John Ericson
a9bbfaa851
Fix --profile with multiple opaque paths
2020-08-05 16:27:15 +00:00
John Ericson
d89472a912
Merge remote-tracking branch 'upstream/master' into buildable-variant
2020-08-05 15:41:57 +00:00
John Ericson and Eelco Dolstra
b3e73547a0
Update src/libexpr/primops.cc
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-08-05 11:05:46 -04:00
John Ericson
0559ff3d8b
Merge branch 'master' of github.com:NixOS/nix into derivation-primop-floating-output
2020-08-05 14:56:40 +00:00
John Ericson
92ad550e96
Merge remote-tracking branch 'obsidian/misc-ca' into derivation-primop-floating-output
2020-08-05 14:51:41 +00:00
Eelco Dolstra
790b694be7
Style fix
2020-08-05 16:51:06 +02:00
Eelco Dolstra
e48f944e9d
Merge branch 'misc-ca' of https://github.com/obsidiansystems/nix
2020-08-05 16:50:05 +02:00
John Ericson
b9ebe373bb
Sed some names to perhaps avoid conflicts
2020-08-05 14:49:25 +00:00
Eelco Dolstra
25f7912156
Style fix
2020-08-05 16:47:48 +02:00
John Ericson
e561a13a58
Reanme DerivationType::Regular defintion too
...
This is the one non-prefixed occurence
2020-08-05 14:45:56 +00:00
John Ericson
e7b0847f2d
Make names more consistent
2020-08-05 14:44:39 +00:00
John Ericson
839f0fe095
Merge remote-tracking branch 'upstream/master' into misc-ca
2020-08-05 14:40:01 +00:00
John Ericson
03f4fafc27
Merge remote-tracking branch 'upstream/master' into misc-ca
2020-08-05 14:36:25 +00:00
Eelco Dolstra
b91dc7ebad
Merge pull request #3730 from obsidiansystems/better-ca-parse-errors
...
Improve hash parsing and errors
2020-08-05 16:33:07 +02:00
Eelco Dolstra
75f220a595
Merge pull request #3864 from obsidiansystems/more-topo-sort
...
Abstract out topo sorting logic
2020-08-05 16:07:29 +02:00
Eelco Dolstra
088dcea0e8
Typo
2020-08-05 15:41:51 +02:00
John Ericson
6d003d87b6
Merge branch 'drv-outputs-map-allow-missing' into templated-daemon-protocol
2020-08-04 22:39:49 +00:00
John Ericson
16c98bf57c
Get rid of some unneeded temporaries
2020-08-04 22:36:31 +00:00
John Ericson
89bda7f2f8
Merge branch 'drv-outputs-map-allow-missing' into templated-daemon-protocol
2020-08-04 22:33:11 +00:00
John Ericson
1dfcbebc95
Organize and format code a bit
2020-08-04 22:28:10 +00:00
John Ericson
46cafb13fa
Merge branch 'drv-outputs-map-allow-missing' into templated-daemon-protocol
2020-08-04 22:19:13 +00:00
John Ericson
45b6fdb22b
Remove unused functions
2020-08-04 22:10:13 +00:00
John Ericson
1bab8a321f
Remove unneeded definition
...
Template instantiations will cover this case fine.
2020-08-04 21:56:42 +00:00
John Ericson
2f2ae993dc
WIP systematize more of the worker protocol
...
This refactor should *not* change the wire protocol.
2020-08-04 19:02:05 +00:00
John Ericson
fbeb8695fb
Merge remote-tracking branch 'upstream/master' into drv-outputs-map-allow-missing
2020-08-04 18:35:33 +00:00
John Ericson
d3452a5ed6
Merge remote-tracking branch 'upstream/master' into better-ca-parse-errors
2020-08-04 16:13:20 +00:00
Eelco Dolstra
5b22a2c0d4
Merge pull request #3894 from obsidiansystems/json-test-order-agnostic
...
Make JSON equality tests agnostic to ordering
2020-08-04 17:24:46 +02:00
John Ericson
6d9ccde20d
Make JSON equality tests agnostic to ordering
...
It is in fact more sorted than before, but I don't think we want to
guarantee anything about the ordering.
2020-08-04 14:20:13 +00:00
Eelco Dolstra
4e7f1c7f11
S3BinaryCacheStore: Fix size determination
2020-08-04 16:01:13 +02:00
Eelco Dolstra
dfe66420e7
Revert "Remove putBytes"
...
This reverts commit b8eea7e81a .
2020-08-04 15:56:10 +02:00
Eelco Dolstra
327b1bf378
BinaryCacheStore: Explicitly flush file sink
...
The file sink is also flushed in its destructor, but we ignore any
exceptions in the destructor.
Issue #3886 .
2020-08-04 14:54:07 +02:00
Eelco Dolstra
ed52cf632b
Merge pull request #3892 from obsidiansystems/path-info-header
...
Move ValidPathInfo to its own header
2020-08-04 10:44:47 +02:00
John Ericson
fe7e57a80d
tab -> space
2020-08-04 03:47:09 +00:00
John Ericson
062533f7cd
Merge remote-tracking branch 'upstream/master' into path-info-header
2020-08-03 21:02:28 +00:00
Eelco Dolstra
24e07c428f
Delete compressed NARs
...
Fixes #3891 .
2020-08-03 18:34:52 +02:00
Eelco Dolstra
a2842588ec
Merge pull request #3885 from obsidiansystems/generalize-addToStore-adapter
...
`addToStore` in terms of `addToStoreFromDump` is not local-store-specific
2020-08-03 10:33:56 +02:00
John Ericson
54281f3ac1
addToStore in terms of addToStoreFromDump is not local-store-specific
2020-08-03 04:13:45 +00:00
John Ericson
9357512d73
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
2020-08-01 19:38:35 +00:00
John Ericson
c4ada76e86
Fix error message and avoid recalculation
2020-08-01 16:22:50 +00:00
John Ericson
bc165e28ae
Embelish documentation of new Hash functions
2020-08-01 15:32:20 +00:00
John Ericson
3cbee1e840
Convert to C-style comments
2020-08-01 15:26:57 +00:00
Carlo Nucera
b6d97fdbf4
Merge branch 'master' of github.com:NixOS/nix into drv-outputs-map-allow-missing
2020-07-31 13:12:51 -04:00
Eelco Dolstra
a3f9625818
Tweak description
2020-07-31 17:32:40 +02:00
Eelco Dolstra
935723eb3b
Merge branch 'nix-command-build-check' of https://github.com/Ma27/nix
2020-07-31 17:30:55 +02:00
Eelco Dolstra
f56dfce734
nix bundle: Set category
2020-07-31 17:30:12 +02:00
Maximilian Bosch
5a09eb86f1
nix/build: add --rebuild option
...
Occasionally, `nix-build --check` is fairly helpful and I'd like to be
able to use this feature for flakes that need to be built with `nix
build` as well.
2020-07-31 17:17:03 +02:00
Eelco Dolstra
3e30710d95
Merge pull request #3788 from crinklywrappr/master
...
Add a script to install nix on non-systemd systems.
2020-07-31 16:44:26 +02:00
Eelco Dolstra
bf290c2306
Merge remote-tracking branch 'origin/master' into markdown
2020-07-31 16:07:04 +02:00
Eelco Dolstra
2ae9ac2369
console -> shell
2020-07-31 16:02:37 +02:00
Eelco Dolstra
1d0a7b54fa
Enable syntax highlighting
2020-07-31 15:43:25 +02:00
Eelco Dolstra
0604cfd0eb
Merge pull request #3880 from matthewbauer/nix-bundle
...
Add "bundle" command to Nix
2020-07-31 11:45:53 +02:00
Eelco Dolstra
358da474d7
Merge pull request #3881 from matthewbauer/fix-builtins-path
...
Fix builtins.path
2020-07-31 10:25:28 +02:00
John Ericson
e3a2154f5a
Fix indentation
2020-07-31 01:07:59 +00:00
Carlo Nucera
eee6ef86cd
Merge branch 'master' of github.com:NixOS/nix into better-ca-parse-errors
2020-07-30 18:27:25 -04:00
Matthew Bauer
cdc2386644
Make expectedHash optional in prim_path
...
This fixes an error found in builtins.path that looks like:
store path mismatch in (possibly filtered) path added from '/private/tmp/nix-shell.CyXViH/nix-test/filter-source/filterin'
when no hash is specified
2020-07-30 16:40:40 -05:00
Matthew Bauer
0bdd6cf6ea
Add test for builtins.path
2020-07-30 16:38:04 -05:00
Matthew Bauer
3537670fef
Only enable static on linux
2020-07-30 15:53:49 -05:00
Matthew Bauer
13ef7a07b9
Fix build
2020-07-30 15:49:45 -05:00
Matthew Bauer
fa2d1fb36e
Pass system to bundler
2020-07-30 15:37:05 -05:00
Matthew Bauer
22fcfdf18a
Address misc review
2020-07-30 15:18:57 -05:00
Matthew Bauer
1a705637ce
Remove single file restriction for bundler
2020-07-30 15:16:29 -05:00
Matthew Bauer
52407f83a1
exporter -> bundler
2020-07-30 15:16:23 -05:00
Matthew Bauer
d7ffe327ae
Merge remote-tracking branch 'origin/master' into fix-and-ci-static-builds
2020-07-30 14:59:57 -05:00
Eelco Dolstra
0744f7f83b
Merge pull request #3689 from matthewbauer/substitute-other-storedir
...
Substitutions from different store dirs
2020-07-30 21:56:59 +02:00
Matthew Bauer
05ac4db39a
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-07-30 12:38:24 -05:00
Matthew Bauer
5d04a4db9b
Handle exporters checking correctly
2020-07-30 11:45:47 -05:00
Matthew Bauer
2f4250a416
Add "export" to Nix
...
This adds a ‘nix export’ command which hooks into nix-bundle. It can
be used in a similar way as nix-bundle, with the benefit of hooking
into the new “app” functionality. For instance,
$ nix export nixpkgs#jq
$ ./jq --help
jq - commandline JSON processor [version 1.6]
...
$ scp jq machine-without-nix:
$ ssh machine-without-nix ./jq
jq - commandline JSON processor [version 1.6]
...
Note that nix-bundle currently requires Linux to run. Other exporters
might not have that requirement.
“exporters” are meant to be reusable, so that, other repos can
implement their own bundling.
Fixes #3705
2020-07-30 11:33:22 -05:00
Eelco Dolstra
a785b3eddf
Fix build
2020-07-30 15:27:28 +02:00
Eelco Dolstra
3f6e88a552
unsigned long long -> uint64_t
2020-07-30 13:34:04 +02:00
Eelco Dolstra
ebee2b7852
receiveContents(): unsigned int -> size_t
2020-07-30 13:00:30 +02:00
Eelco Dolstra
3f3740d676
Merge pull request #3879 from illiusdope/nix-build-shell-flags
...
Prevent nix-build from accepting nix-shell flags
2020-07-30 09:19:28 +02:00
Mat Marini
d9e23bfee2
Prevent nix-build from accepting --run/--command
2020-07-29 20:53:02 -04:00
Mat Marini
e4f6f8da77
Prevent nix-build from accepting --packages
2020-07-29 20:50:06 -04:00
Eelco Dolstra
0c94c17644
Merge remote-tracking branch 'origin/master' into markdown
2020-07-29 18:08:57 +02:00
Eelco Dolstra
f63839bfa4
Cleanup
2020-07-29 18:04:51 +02:00
Eelco Dolstra
39311e7009
Merge pull request #3549 from Ma27/fetchgit-hash
...
Merge legacy `fetchGit`-builtin with the generic `fetchTree`-function
2020-07-29 11:33:27 +02:00
Eelco Dolstra
7c097275c4
Merge pull request #3877 from matthewbauer/develop-continuous-regex
...
Set regex_constants::match_continuous for quicker search in nix develop
2020-07-29 10:07:52 +02:00
Eelco Dolstra
428e716193
Merge pull request #3876 from NixOS/nix-copy-latency
...
Fix RemoteStore::addToStore() latency
2020-07-29 10:04:26 +02:00
Matthew Bauer
fa8515d7ec
Set regex_constants::match_continuous for quicker search
...
match_continuous limits the search to the current start position,
instead of searching the entire file.
On libc++, this improves performance dramatically:
$ time /nix/store/70ai68dfm6xbzwn26j5n4li9di52ylia-nix-3.0pre20200728_c159f48/bin/nix print-dev-env >/dev/null
/nix/store/70ai68dfm6xbzwn26j5n4li9di52ylia-nix-3.0pre20200728_c159f48/bin/ni 2.39s user 0.19s system 64% cpu 4.032 total
$ time /nix/store/cwjfxxlp83zln4mfyy1d2dbsx7f6s962-nix-3.0pre20200728_dirty/bin/nix print-dev-env >/dev/null
/nix/store/cwjfxxlp83zln4mfyy1d2dbsx7f6s962-nix-3.0pre20200728_dirty/bin/nix 0.09s user 0.05s system 65% cpu 0.204 total
Fixes #3874
2020-07-29 00:57:20 -05:00
Eelco Dolstra
4c0077a07d
Fix RemoteStore::addToStore() latency
...
Since 6185d25e52 , this was very
latency-bound since it required a round-trip for every 32 KiB. So for
example copying a 514 MiB closure over a virtual ethernet device with
a articial delay of just 1 ms took 343s. Now it takes 2.7s.
Fixes #3372 .
2020-07-29 00:48:39 +02:00
Eelco Dolstra
c159f48a39
Cleanup
2020-07-29 00:24:55 +02:00
John Ericson
df707d05d1
Merge branch 'ca-drv' of github.com:Ericson2314/nix into misc-ca
2020-07-28 21:12:36 +00:00
Maximilian Bosch
e4940e90f3
Restore backwards-compat for current builtins.fetchGit
...
If a repo is dirty, it used to return a `rev` object with an "empty"
sha1 (0000000000000000000000000000000000000000). Please note that this
only applies for `builtins.fetchGit` and *not* for `builtins.fetchTree{
type = "git"; }`.
2020-07-28 22:46:39 +02:00
Carlo Nucera
2980b244b7
Use assert(false) instead of abort()
2020-07-28 15:39:45 -04:00
Carlo Nucera
cfe96bd7ce
Merge branch 'master' of github.com:NixOS/nix into ca-drv
2020-07-28 15:36:45 -04:00
Carlo Nucera
c318d398f3
Merge branch 'misc-ca' of github.com:obsidiansystems/nix into new-interface-for-path-pathOpt
2020-07-28 14:22:24 -04:00
Carlo Nucera
7ef1e3cd14
Use the new interface
2020-07-28 13:59:24 -04:00
Carlo Nucera
d564ac1c50
Offer a safer interface for pathOpt
...
The new interface we offer provides a way of getting all the
DerivationOutputs with the storePaths directly, based on the observation
that it's the most common usecase.
2020-07-28 13:55:15 -04:00
Eelco Dolstra
b8eea7e81a
Remove putBytes
...
istream->tellg() returns -1 so we can't get the number of bytes
written.
Fixes 'uploaded 's3://nix-cache/nar/00819r9lp5kajr6baxfw5dhhc0cx8ndxaz43qmd2f0gn1hk1ynlp.nar.xz' (-1 bytes) in 11620 ms' messages.
2020-07-28 13:27:56 +02:00
Eelco Dolstra
189e6f5e1d
Bump version to 3.0
...
Since there are some incompatible changes, it's better to bump the
major version number.
2020-07-28 13:18:27 +02:00
Maximilian Bosch
f742438465
Merge legacy fetchGit-builtin with the generic fetchTree-function
...
The original idea was to implement a git-fetcher in Nix's core that
supports content hashes[1]. In #3549[2] it has been suggested to
actually use `fetchTree` for this since it's a fairly generic wrapper
over the new fetcher-API[3] and already supports content-hashes.
This patch implements a new git-fetcher based on `fetchTree` by
incorporating the following changes:
* Removed the original `fetchGit`-implementation and replaced it with an
alias on the `fetchTree` implementation.
* Ensured that the `git`-fetcher from `libfetchers` always computes a
content-hash and returns an "empty" revision on dirty trees (the
latter one is needed to retain backwards-compatibility).
* The hash-mismatch error in the fetcher-API exits with code 102 as it
usually happens whenever a hash-mismatch is detected by Nix.
* Removed the `flakes`-feature-flag: I didn't see a reason why this API
is so tightly coupled to the flakes-API and at least `fetchGit` should
remain usable without any feature-flags.
* It's only possible to specify a `narHash` for a `git`-tree if either a
`ref` or a `rev` is given[4].
* It's now possible to specify an URL without a protocol. If it's missing,
`file://` is automatically added as it was the case in the original
`fetchGit`-implementation.
[1] https://github.com/NixOS/nix/pull/3216
[2] https://github.com/NixOS/nix/pull/3549#issuecomment-625194383
[3] https://github.com/NixOS/nix/pull/3459
[4] https://github.com/NixOS/nix/pull/3216#issuecomment-553956703
2020-07-28 00:44:39 +02:00
John Ericson
8065c6d160
Abstract out topo sorting logic
2020-07-27 20:45:34 +00:00
John Ericson
951415b568
Require ca-derivations everywhere we create a CA derivation
...
"create" as in read one in from a serialized form, or build one from
scratch in memory.
2020-07-27 17:56:36 +00:00
John Ericson
e32a9e124b
Merge branch 'misc-ca' of github.com:obsidiansystems/nix into derivation-primop-floating-output
2020-07-27 17:50:06 +00:00
John Ericson
7cf978440c
Merge branch 'ca-derivation-data-types' of github.com:obsidiansystems/nix into misc-ca
2020-07-27 17:47:40 +00:00
John Ericson
e6115ca004
Merge remote-tracking branch 'upstream/master' into ca-derivation-data-types
2020-07-27 17:41:43 +00:00
Eelco Dolstra
86805a2c0a
Merge pull request #3738 from obsidiansystems/hash-always-has-type
...
Hash always has a valid type
2020-07-27 18:40:57 +02:00
John Ericson
1d7d94ceea
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-07-27 16:17:50 +00:00
John Ericson
43f2bd8dc5
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-07-27 16:13:57 +00:00
John Ericson
387699fe7f
Merge branch 'ca-derivation-data-types' of github.com:obsidiansystems/nix into misc-ca
2020-07-27 15:00:28 +00:00
John Ericson
ac89462b74
Merge remote-tracking branch 'upstream/master' into ca-derivation-data-types
2020-07-27 14:59:16 +00:00
Eelco Dolstra
a5f7d310dd
Merge pull request #3795 from obsidiansystems/optional-derivation-output-storepath
...
Only store hash in DerivationOutput for fixed output derivations
2020-07-27 16:48:41 +02:00
John Ericson
78466bcb2f
Merge branch 'optional-derivation-output-storepath' into ca-derivation-data-types
2020-07-27 14:40:08 +00:00
John Ericson
d5bb67cfa4
Merge remote-tracking branch 'upstream/master' into optional-derivation-output-storepath
2020-07-27 14:29:32 +00:00
John Ericson
699fc89b39
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-07-27 14:22:45 +00:00
Eelco Dolstra
d7c0f094cb
Merge pull request #3860 from matthewbauer/precompile-headers-cross
...
Allow PRECOMPILE_HEADERS in cross-compilation
2020-07-26 13:09:36 +02:00
Maximilian Bosch
6ccfdb79c7
libutil/logging: extend internal-json logger to make it more machine-readable
...
The new error-format is pretty nice from a UX point-of-view, however
it's fairly hard to parse the output e.g. for editor plugins such as
vim-ale[1] that use `nix-instantiate --parse` to determine syntax errors in
Nix expression files.
This patch extends the `internal-json` logger by adding the fields
`line`, `column` and `file` to easily locate an error in a file and the
field `raw_msg` which contains the error-message itself without
code-lines and additional helpers.
An exemplary output may look like this:
```
[nix-shell]$ ./inst/bin/nix-instantiate ~/test.nix --log-format minimal
{"action":"msg","column":1,"file":"/home/ma27/test.nix","level":0,"line":4,"raw_msg":"syntax error, unexpected IF, expecting $end","msg":"<full error-msg with code-lines etc>"}
```
[1] https://github.com/dense-analysis/ale
2020-07-26 02:29:57 +02:00
Matthew Bauer
72f8771094
Allow PRECOMPILE_HEADERS in cross-compilation
...
In cross, CXX will look like aarch64-unknown-linux-gnu-g++. We could
run some command to check what kind of compiler it is, but for now we
can just check if g++ is anywhere in the string. I couldn’t find any
"ends with" for makefile, so it can be anywhere in CXX.
2020-07-25 18:02:42 -05:00
John Ericson
2c7557481b
queryDerivationOutputMap no longer assumes all outputs have a mapping
...
This assumption is broken by CA derivations. Making a PR now to do the
breaking daemon change as soon as possible (if it is already too late,
we can bump protocol intead).
2020-07-24 21:14:06 +00:00
Eelco Dolstra
1308c8404e
Remove DocBook manual
2020-07-24 15:48:40 +02:00
Eelco Dolstra
05a282295f
Fix internal links
2020-07-24 15:46:16 +02:00
Eelco Dolstra
da3d776cb9
Fix some dangling references
2020-07-24 14:31:33 +02:00
Eelco Dolstra
4a79b3598f
Fix nix-copy-closure manpage
2020-07-24 13:01:00 +02:00
Eelco Dolstra
7a0e6f076a
Move figures
2020-07-24 12:58:31 +02:00
Eelco Dolstra
758c9ee1bb
Clean up the manpages
2020-07-24 12:56:19 +02:00
Eelco Dolstra
8d0b311a1c
Get rid of footnotes
...
Markdown doesn't support them.
2020-07-24 11:43:44 +02:00
Eelco Dolstra
a71d1cedff
printVersion(): Show system types
2020-07-24 11:34:01 +02:00
Eelco Dolstra
2292814049
createUnixDomainSocket(): Fix off-by-one error in copying the socket path
...
Reported by Kane York.
2020-07-24 11:19:17 +02:00
John Ericson
58e55c0923
Merge branch 'misc-ca' of github.com:obsidiansystems/nix into derivation-primop-floating-output
2020-07-23 19:17:52 +00:00
John Ericson
a2af25c55a
Merge remote-tracking branch 'upstream/master' into misc-ca
2020-07-23 19:14:17 +00:00
John Ericson
e1de1fe0d8
Make Buildable a std::variant
...
I think this better captures the intent of what's going on: we either
have an opaque store path, or a drv path with some outputs.
Having this structure will also help us support CA derivations: we'll
have to allow the outpath paths to be optional, so the structure we gain
now makes up for the structure we loose then.
2020-07-23 19:02:57 +00:00
Eelco Dolstra
5e3ad1dde0
Add a separate manual job
2020-07-23 18:27:20 +02:00
Eelco Dolstra
69333cb62c
Sigh
2020-07-23 18:27:20 +02:00
Eelco Dolstra
802150f987
<replaceable> -> <emphasis>
...
Pandoc doesn't know <replaceable> so let's force it to be rendered as
italics.
2020-07-23 18:27:20 +02:00
Eelco Dolstra
ee05108472
<simplesect> -> <section>
...
Pandoc silently ignores <simplesect>...
2020-07-23 18:27:20 +02:00
Eelco Dolstra
136fd55bb2
Get rid of <figure>
2020-07-23 18:27:20 +02:00
Eelco Dolstra
ca130b73a0
Get rid of <example>
...
Markdown doesn't have floats so we can't have this.
2020-07-23 18:27:20 +02:00
Eelco Dolstra
13df1faf25
Get rid of callouts since Markdown doesn't support them
2020-07-23 18:27:20 +02:00
Eelco Dolstra
efff6cf163
Install all manpages
2020-07-23 18:27:12 +02:00
Eelco Dolstra
504b7abc45
Convert commands
2020-07-23 18:27:12 +02:00
Eelco Dolstra
efdb89994c
Convert nix.conf manpage
2020-07-23 18:27:11 +02:00
Eelco Dolstra
f390303566
Reconvert
2020-07-23 18:27:11 +02:00
Eelco Dolstra
c20c082383
<envar> -> <literal>
2020-07-23 18:27:11 +02:00
Eelco Dolstra
942cd687f9
Remove libxml2 / libxslt prerequisites
2020-07-23 18:26:48 +02:00
Eelco Dolstra
ef606760ab
Pandoc conversion
2020-07-23 18:26:48 +02:00
Eelco Dolstra
d004715665
Fix link
2020-07-23 18:26:48 +02:00
Eelco Dolstra
315407c16f
Remove subtitles
2020-07-23 18:26:48 +02:00
Eelco Dolstra
ebdc1f6dfb
Typo
2020-07-23 18:26:48 +02:00
Eelco Dolstra
8e41c38867
Remove references to xmllint
2020-07-23 18:26:48 +02:00
Eelco Dolstra
e0ea3c82ca
Use mdbook
2020-07-23 18:26:48 +02:00
Eelco Dolstra
650ae14ced
Markdown test
2020-07-23 18:26:48 +02:00
Eelco Dolstra
26fcab53e0
Remove unused file
2020-07-23 18:25:09 +02:00
John Ericson
c36916eca0
Merge branch 'misc-ca' of github.com:obsidiansystems/nix into derivation-primop-floating-output
2020-07-23 15:06:56 +00:00
John Ericson
6fcd9966bf
Merge remote-tracking branch 'upstream/master' into misc-ca
2020-07-23 15:02:29 +00:00
Eelco Dolstra
a7b8f79938
Merge pull request #3855 from obsidiansystems/delete-find-output
...
Get rid of `basicDerivation::findOutput`
2020-07-23 16:56:58 +02:00
John Ericson
66a2067288
Merge remote-tracking branch 'upstream/master' into better-ca-parse-errors
2020-07-23 14:56:35 +00:00
John Ericson
2274f63453
Get rid of basicDerivation::findOutput
...
It's a tiny function which is:
- hardly worth abstrating over, and also only used once.
- doesn't work once we get CA drvs
I rewrote the one callsite to be forwards compatable with CA
derivations, and also potentially more performant: instead of reading in
the derivation it can ust consult the SQLite DB in the common case.
2020-07-23 14:39:02 +00:00
Eelco Dolstra
4bfba1305e
Merge pull request #3854 from B4dM4n/registry-pin-write
...
Save changes made by "nix registry pin" to user registry
2020-07-23 16:13:05 +02:00
Fabian Möller
b9ead08ca8
Save changes made by "nix registry pin" to user registry
2020-07-23 14:21:27 +02:00
Eelco Dolstra
d58ab591d4
Merge pull request #3850 from obsidiansystems/references-scan-cleanup
...
Separate concerns in `scanForReferences` with TeeSink
2020-07-23 12:51:01 +02:00
John Ericson
9423f64ee2
Parse CA derivations using new output variants
...
We no longer need `ParsedDerivation` because everything libstore needs
to know about is in the `BasicDerivation` proper.
2020-07-22 23:59:25 +00:00
John Ericson
c56356bacc
Separate concerns in scanForReferences with TeeSink
...
This also will make it easier to use a `HashModuloSink` instead for CA
derivations.
2020-07-22 22:13:44 +00:00
Eelco Dolstra
090960b725
Merge pull request #3848 from knedlsepp/patch-1
...
README: Fix link to hacking guide
2020-07-22 14:31:40 +02:00
Josef Kemetmüller
ae9e9753ce
README: Fix link to hacking guide
...
The link was previously interpreted as if it were relative to the current file.
2020-07-22 13:45:15 +02:00
Eelco Dolstra
ff314f186e
Merge pull request #3736 from obsidiansystems/allow-relative-paths-in-store-option
...
Allow relative paths in --store option
2020-07-21 19:43:07 +02:00
Eelco Dolstra
0951330680
Merge pull request #3714 from obsidiansystems/add-body-to-network-errors
...
Add response body to network errors
2020-07-21 18:09:42 +02:00
John Ericson
02639716ea
Merge branch 'allow-relative-paths-in-store-option' into remove-storetype-delegate-regStore
2020-07-21 15:55:27 +00:00
John Ericson
6cce32c8e8
Change logic for deciding what is a relative path for the local store
...
The was Eelco's prefered logic, and it looks good to me!
2020-07-21 15:39:47 +00:00
Eelco Dolstra
1346da4669
Merge pull request #3844 from obsidiansystems/update-chunksize-to-suggested-value
...
Update chunkSize to the suggested value
2020-07-21 16:39:31 +02:00
Carlo Nucera
922a845ffc
Update chunkSize to the suggested value
...
This was a suggested course of action in a review in one of our earlier
commits, https://github.com/NixOS/nix/pull/3801#discussion_r457557079
2020-07-21 10:24:19 -04:00
John Ericson
54e507a7aa
Merge remote-tracking branch 'upstream/master' into add-body-to-network-errors
2020-07-21 14:17:59 +00:00
John Ericson
5ce95b9529
Update src/libstore/build.cc
2020-07-21 09:47:40 -04:00
John Ericson
cdb3f39b64
Merge remote-tracking branch 'upstream/master' into better-ca-parse-errors
2020-07-21 13:43:20 +00:00
Eelco Dolstra
0835447eaa
Merge pull request #3801 from obsidiansystems/from-dump-stream
...
Constant space `addToStoreFromDump` and deduplicate code
2020-07-21 15:11:52 +02:00
Eelco Dolstra
7e91cdd9ee
Merge pull request #3840 from Mic92/docs
...
README: improve development docs
2020-07-21 13:20:13 +02:00
Eelco Dolstra
51ee506693
Merge pull request #3842 from obsidiansystems/fix-and-document-addToStoreSlow
...
Correct bug, thoroughly document addToStoreSlow
2020-07-21 10:01:34 +02:00
John Ericson
5055c595bd
Merge branch 'fix-and-document-addToStoreSlow' of github.com:obsidiansystems/nix into ca-derivation-data-types
2020-07-21 01:20:53 +00:00
John Ericson
5a37413796
Merge branch 'fix-and-document-addToStoreSlow' of github.com:obsidiansystems/nix into from-dump-stream
2020-07-21 01:20:14 +00:00
John Ericson
bf0dca7790
Merge branch 'fix-and-document-addToStoreSlow' of github.com:obsidiansystems/nix into misc-ca
2020-07-21 01:18:33 +00:00
Carlo Nucera
9aae179f34
Correct bug, thoroughly document addToStoreSlow
2020-07-20 20:18:12 -04:00
Jörg Thalheim and Eelco Dolstra
6633605341
Update doc/manual/hacking.xml
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-07-20 22:30:39 +01:00
Carlo Nucera
0ca9744694
Use heuristics to decide when to show the response
...
Due to https://github.com/NixOS/nix/issues/3841 we don't know how print
different messages for different verbosity levels.
2020-07-20 15:57:58 -04:00
Carlo Nucera
6357b1b0fb
Add another Unimplemented case
2020-07-20 14:17:25 -04:00
Carlo Nucera
007bf6d17a
Merge branch 'ca-derivation-data-types' of github.com:obsidiansystems/nix into misc-ca
2020-07-20 14:14:39 -04:00
Carlo Nucera
362ae93851
Add UnimplementedError to ease grepping for these
2020-07-20 14:13:37 -04:00
John Ericson
c58c6165c5
Remove period at the end of the exception message
2020-07-20 17:43:19 +00:00
John Ericson
bf61871271
parser.hh -> split.hh
2020-07-20 17:42:34 +00:00
John Ericson
eab945f591
Merge remote-tracking branch 'upstream/master' into from-dump-stream
2020-07-20 17:29:23 +00:00
Eelco Dolstra
1c5f8bbfb5
Merge pull request #3822 from obsidiansystems/dump-thrice-fixme
...
Optimize `addToStoreSlow` and remove `TeeParseSink`
2020-07-20 18:55:05 +02:00
John Ericson and Eelco Dolstra
ac2fc7ba1f
Apply suggestions from code review
...
Co-authored-by: Eelco Dolstra <edolstra@gmail.com >
2020-07-20 11:29:46 -04:00
Jörg Thalheim
f0100f5590
README: improve development docs
2020-07-20 15:46:28 +01:00
Eelco Dolstra
a79b6ddaa5
Merge pull request #3834 from ajkovar/source-line-3393
...
Add newline to profile sourcing line #3393
2020-07-19 14:01:56 +02:00
Alex Kovar
3294b0a4b0
Add newline to profile sourcing line #3393
2020-07-18 10:24:22 -05:00
Eelco Dolstra
31826c60e1
Merge pull request #3832 from Mic92/shell-impurity
...
fix make's impurity on /bin/sh
2020-07-18 09:39:43 +02:00
Eelco Dolstra
0e9fb4a869
Merge pull request #3828 from BurNiinTRee/restore-signals-before-edit
...
nix edit: call restoreSignals() before `execvp`-ing the $EDITOR
2020-07-18 09:39:11 +02:00
Jörg Thalheim
5526683ad3
fix make's impurity on /bin/sh
...
This is important when using tooling like BEAR to generate
compilation database since the used glibc version needs to match
for LD_PRELOAD to work. It might be also beneficial when building
on systems other than NixOS with nix develop since /bin/sh might
be not bash (which is what all nix devs use for testing).
This fix is not perfect because Makefile.config.in itself is
also build with make but strictly better than the status quo.
2020-07-18 08:05:36 +01:00
John Ericson
5ae747b434
Remove stray added file
2020-07-17 21:50:09 +00:00
Carlo Nucera
0aa79dcc6f
Remove StoreType abstraction and delegate regStore
...
to each Store implementation. The generic regStore implementation will
only be for the ambiguous shorthands, like "" and "auto".
This also could get us close to simplifying the daemon command.
2020-07-17 17:24:02 -04:00
John Ericson
6756cecfcf
Add DerivationType::CAFloating
2020-07-17 19:55:41 +00:00
Carlo Nucera
4178f36a1d
Test relative store paths
2020-07-17 15:50:53 -04:00
Carlo Nucera
fefd6c9e5f
Merge branch 'master' of github.com:NixOS/nix into allow-relative-paths-in-store-option
2020-07-17 14:34:20 -04:00
Carlo Nucera
bbc633c98c
Revert "Don't anticipate CA but not fixed outputs for now"
...
This reverts commit 3a9e4c3262 .
2020-07-17 13:10:32 -04:00
Carlo Nucera
205dcd140d
Revert "Don't anticipate multiple CA outputs for now"
...
This reverts commit 74b251b2f3 .
2020-07-17 12:43:46 -04:00
Carlo Nucera
1feb8981df
Revert "Don't anticipate hash algo without hash in derivation for now"
...
This reverts commit 3804e3df9b .
2020-07-17 12:05:54 -04:00
Lars Mühmel
bc73590151
nix edit: call restoreSignals() before execvp-ing the $EDITOR
...
Currently resizing of the terminal doesn't play nicely with
nix edit when using kakoune as the editor, as it relies on the
SIGWINCH signal which is trapped by nix. How this is not a problem
with e.g. vim is beyond me.
Virtually all other exec* calls are following a call to
restoreSignals(). This commit adds this behavior to nix edit
as well.
2020-07-17 17:35:59 +02:00
Carlo Nucera
487c5751c6
Merge branch 'ca-drv' of github.com:Ericson2314/nix into misc-ca
2020-07-17 11:32:59 -04:00
Carlo Nucera
a395c12830
Merge branch 'master' of github.com:NixOS/nix into misc-ca
2020-07-17 11:06:54 -04:00
Eelco Dolstra
3f01fa1c9c
Merge pull request #3827 from obsidiansystems/add-back-compat-shell.nix
...
Add back flake-compat shell.nix
2020-07-17 17:05:00 +02:00
John Ericson
c123fee959
Add back flake-compat shell.nix
...
This was removed in the merge commit
adf2fbbdc2 . I think this was a mistake
that occurred when resolving a conflict.
2020-07-17 14:58:59 +00:00
Carlo Nucera
5cb840541b
Merge branch 'multi-output-hashDerivationModulo' of github.com:Ericson2314/nix into misc-ca
2020-07-17 10:28:33 -04:00
Eelco Dolstra
17f75f9cc4
parseFlakeRef(): Only search for the top-level directory for CLI flakerefs
2020-07-17 14:54:21 +02:00
Eelco Dolstra
52c8be38e0
nix profile diff-closures: Don't inherit EvalCommand
2020-07-17 12:36:12 +02:00
Carlo Nucera
745a03cef5
Merge branch 'optional-derivation-output-storepath' of github.com:obsidiansystems/nix into ca-derivation-data-types
2020-07-16 13:36:01 -04:00
John Ericson
e45754e530
Merge branch 'better-ca-parse-errors' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-07-16 17:33:10 +00:00
Carlo Nucera
048e916f64
Merge branch 'master' of github.com:NixOS/nix into optional-derivation-output-storepath
2020-07-16 13:32:28 -04:00
John Ericson
cc0d77f8c9
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-07-16 17:28:52 +00:00
Carlo Nucera
e3a3406db8
Merge branch 'master' of github.com:NixOS/nix into add-body-to-network-errors
2020-07-16 12:04:10 -04:00
Eelco Dolstra
16c9f6762d
Add command 'nix profile diff-closure'
...
This shows all changes between generations of a profile. E.g.
$ nix profile diff-closures --profile /nix/var/nix/profiles/system
Generation 654 -> 655:
nix: 2.4pre20200617_5d69bbf → 2.4pre20200701_6ff9aa8, +42.2 KiB
Generation 655 -> 656:
blender-bin: 2.83.0 → 2.83.1, -294.2 KiB
Generation 656 -> 657:
curl: 7.68.0 → 7.70.0, +19.1 KiB
firmware-linux-nonfree: 2020-01-22 → 2020-05-19, +30827.7 KiB
ibus: -21.8 KiB
initrd-linux: 5.4.46 → 5.4.49
...
2020-07-16 17:00:42 +02:00
John Ericson
5ea817dace
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-07-16 14:58:53 +00:00
John Ericson
3dcca18c30
Fix bug in TeeSource
...
We use this to simplify `LocalStore::addToStoreFromDump`.
Also, hope I fixed build error with old clang (used in Darwin CI).
2020-07-16 13:39:27 +00:00
Carlo Nucera
e3b394b6e8
Small namespace fix
2020-07-16 09:36:02 -04:00
Eelco Dolstra
5517eee17e
Generations API cleanup
2020-07-16 15:18:21 +02:00
Eelco Dolstra
8807ff902e
nix diff-closures: Fix build
2020-07-16 14:25:51 +02:00
Eelco Dolstra
716eafaca4
Merge branch 'diff-closures'
2020-07-16 14:19:35 +02:00
Eelco Dolstra
3f264916db
Merge remote-tracking branch 'origin/flakes'
2020-07-16 14:07:32 +02:00
John Ericson
68dfb8c6ae
Optimize addToStoreSlow and remove TeeParseSink
2020-07-16 05:09:41 +00:00
John Ericson
5602637d9e
Revert "LocalStore::addToStoreFromDump copy in chunks"
...
This reverts commit 592851fb67 . We don't
need this extra feature anymore
2020-07-15 23:37:49 +00:00
John Ericson
bc109648c4
Get rid of LocalStore::addToStoreCommon
...
I got it to just become `LocalStore::addToStoreFromDump`, cleanly taking
a store and then doing nothing too fancy with it.
`LocalStore::addToStore(...Path...)` is now just a simple wrapper with a
bare-bones sinkToSource of the right dump command.
2020-07-15 23:14:30 +00:00
Carlo Nucera
455bdee205
Merge branch 'master' of github.com:NixOS/nix into derivation-header-include-order
2020-07-15 17:58:30 -04:00
Carlo Nucera
c8a3c89420
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-07-15 17:28:06 -04:00
John Ericson
64b7421741
Merge branch 'handle-flat-case' into from-dump-stream
2020-07-15 21:22:55 +00:00
Carlo Nucera
d090562348
Merge branch 'master' of github.com:NixOS/nix into hash-always-has-type
2020-07-15 17:21:01 -04:00
John Ericson
d087cf4855
Revert "Revert "LocalStore::addToStore(srcPath): Handle the flat case""
...
This reverts commit cff2157185 .
2020-07-15 21:10:33 +00:00
John Ericson
aff69e229c
Merge remote-tracking branch 'obsidian/fix-add-to-star-narhash' into from-dump-stream
2020-07-15 21:05:29 +00:00
Eelco Dolstra
36a1242603
nix why-depends: Fix shortest path calculation
...
This was completely broken since d8972317fc .
2020-07-15 21:11:07 +02:00
Eelco Dolstra
2d6d53bc87
nix: Fix examples
2020-07-15 20:28:16 +02:00
Eelco Dolstra
3624c042ac
nix: Add --derivation flag to operate on .drv paths
...
For instance, 'nix why-depends --use-derivation nixpkgs#hello
nixpkgs#glibc' shows why hello's .drv depends on glibc's .drv.
2020-07-15 20:25:10 +02:00
Eelco Dolstra
dfe8f3ebc6
nix why-depends: Fix misleading message
2020-07-15 20:09:50 +02:00
Eelco Dolstra
94eb5fad76
Clean up RealiseMode
2020-07-15 20:05:42 +02:00
Eelco Dolstra
e3c2b00237
Make InstallableStorePath behave consistently with InstallableValue
...
That is, the commands 'nix path-info nixpkgs#hello' and 'nix path-info
/nix/store/00ls0qi49qkqpqblmvz5s1ajl3gc63lr-hello-2.10.drv' now do the
same thing (i.e. build the derivation and operate on the output store
path, rather than the .drv path).
2020-07-15 19:50:32 +02:00
Carlo Nucera
2d2a10e79a
Merge branch 'master' of github.com:NixOS/nix into add-body-to-network-errors
2020-07-15 13:06:08 -04:00
Eelco Dolstra
0356f14459
Add 'nix diff-closures' command
...
This command makes it easier to see what changed between two closures,
i.e. what packages/versions got added or removed, and whether there
were any notable changes in path size.
For example:
$ nix diff-closures /nix/var/nix/profiles/system-655-link /nix/var/nix/profiles/system-658-link
blender-bin: 2.83.0 → 2.83.2, -294.2 KiB
curl: 7.68.0 → 7.70.0, +19.1 KiB
firmware-linux-nonfree: 2020-01-22 → 2020-05-19, +30827.7 KiB
ibus: -21.8 KiB
initrd-linux: 5.4.46 → 5.4.51, +16.9 KiB
libexif: 0.6.21 → 0.6.22, +497.6 KiB
linux: 5.4.46 → 5.4.51, +13.2 KiB
mesa: 19.3.3 → 19.3.5, -183.9 KiB
nix: 2.4pre20200701_6ff9aa8 → 2.4pre20200708_9223603, +9.7 KiB
nix-bash-completions: 0.6.8 → ∅, -57.6 KiB
nixos-system-hagbard: 20.03.20200615.a84b797 → 20.03.20200713.add5529
nvidia-persistenced: 440.82 → 440.100
nvidia-settings: 440.82 → 440.100
nvidia-x11: 440.82-5.4.46 → 440.100-5.4.51, +664.7 KiB
pcre: 8.43 → 8.44
php: 7.3.16 → 7.3.20, -26.2 KiB
python3.7-youtube-dl: 2020.06.06 → 2020.06.16.1, +8.4 KiB
samba: 4.11.5 → 4.11.9, +30.1 KiB
sane-backends: 1.0.28 → 1.0.30, +680.5 KiB
source: -182.0 KiB
zfs-kernel: 0.8.3-5.4.46 → 0.8.4-5.4.51, +9.9 KiB
zfs-user: 0.8.3 → 0.8.4, +20.1 KiB
2020-07-15 16:24:25 +02:00
Eelco Dolstra
cff2157185
Revert "LocalStore::addToStore(srcPath): Handle the flat case"
...
This reverts commit a2c27022e9 . See
addToStoreSlow(), we don't need to handle this case efficiently
anymore. In fact, we can almost remove the method/hashAlgo arguments
since the non-recursive and/or non-SHA256 are almost not used anymore.
2020-07-15 12:49:03 +02:00
John Ericson
650c2c6558
Rename variable nar -> dump according to TODO
2020-07-14 21:28:50 +00:00
John Ericson
8173e7bfef
Fix localhost::addToStore(...Path...)
...
We were calculating the nar hash wrong when the file ingestion method
was flat. I don't think there's anything we can do in that case but dump
the file again, so that's what I do.
As an optomization, we again could reuse the original dump for just the
recursive and non-sha256 case, but I rather do that after this fix, and
after my other PRs which deduplicate this code.
2020-07-14 21:12:11 +00:00
John Ericson
592851fb67
LocalStore::addToStoreFromDump copy in chunks
...
Rather than copying byte-by-byte, we let the coroutine know how much
data we would like it to send back to us.
2020-07-14 13:56:36 +00:00
John Ericson
9de96ef7d4
Dedup LocalStore::addToStore*
...
The downsides is that the coroutine has byte-by-byte loop transfer. Will
fix that next.
2020-07-14 13:56:36 +00:00
John Ericson
c86fc3a965
Crudely make addToStoreFromDump take Source not string
...
I just as little beyond the type as possible, so the implementation
changes this enables can be reviewed separately.
2020-07-14 13:56:36 +00:00
John Ericson
9ec10046e0
Narrow scope of temporary value
2020-07-14 13:54:29 +00:00
Eelco Dolstra
298ff6af8f
Merge pull request #3809 from Ma27/gitlab-refs
...
Fix gitlab-fetcher to obtain tags and branches
2020-07-14 15:22:52 +02:00
Eelco Dolstra
da3aea291d
EvalCache: Ignore SQLite errors
...
Fixes #3794 .
2020-07-14 15:17:38 +02:00
Eelco Dolstra
832e111494
Merge remote-tracking branch 'origin/master' into flakes
2020-07-14 13:56:18 +02:00
Eelco Dolstra
926c3a6664
Doh
2020-07-14 11:55:54 +02:00
Eelco Dolstra
43b8e96d30
Fix 'nix verify --all' on a binary cache (cached case)
2020-07-13 20:17:00 +02:00
Eelco Dolstra
9502c0e2eb
nix verify: Show correct path when using --all on a binary cache
2020-07-13 20:12:44 +02:00
Eelco Dolstra
7c2fef0a81
Make 'nix copy' to s3:// binary caches run in constant memory
2020-07-13 20:07:19 +02:00
Maximilian Bosch
cf9f33995b
Fix gitlab-fetcher to obtain tags and branches
...
Until now, the `gitlab`-fetcher determined the source's rev by checking
the latest commit of the given `ref` using the
`/repository/branches`-API.
This breaks however when trying to fetch a gitlab-repo by its tag:
```
$ nix repl
nix-repl> builtins.fetchTree gitlab:Ma27/nvim.nix/0.2.0
error: --- Error ------------------------------------------------------------------------------------- nix
unable to download 'https://gitlab.com/api/v4/projects/Ma27%2Fnvim.nix/repository/branches/0.2.0 ': HTTP error 404 ('')
```
When using the `/commits?ref_name`-endpoint[1] you can pass any kind of
valid ref to the `gitlab`-fetcher.
Please note that this fetches the only first 20 commits on a ref,
unfortunately there's currently no endpoint which only retrieves the
latest commit of any kind of `ref`.
[1] https://docs.gitlab.com/ee/api/commits.html#list-repository-commits
2020-07-13 19:22:59 +02:00
Eelco Dolstra
493961b689
Remove istringstream_nocopy
2020-07-13 18:31:19 +02:00
Eelco Dolstra
545bb2ed03
Remove 'accessor' from addToStore()
...
This is only used by hydra-queue-runner and it's better to implement
it there.
2020-07-13 18:31:19 +02:00
Eelco Dolstra
0a9da00a10
NarAccessor: Run in constant memory
2020-07-13 17:30:42 +02:00
Eelco Dolstra
fc84c358d9
Make 'nix copy' to file:// binary caches run in constant memory
2020-07-13 16:28:45 +02:00
Eelco Dolstra
400f1a9b59
Store::pathInfoToJSON(): Use consistent format for downloadHash
2020-07-13 16:26:09 +02:00
Eelco Dolstra
c0dd05131e
toStorePath(): Return a StorePath and the suffix
2020-07-13 16:25:48 +02:00
Eelco Dolstra
143a5f32ed
Add a test for local NAR caching
2020-07-13 16:25:48 +02:00
Eelco Dolstra
1d01ae816b
Fix 'nix verify --all' on a binary cache and add a test
2020-07-13 14:35:01 +02:00
Eelco Dolstra
2900a441f5
Add a test for DWARF debug info index generation
2020-07-13 13:38:01 +02:00
Eelco Dolstra
41bdf429ec
Add a test for NAR listing generation
2020-07-13 13:32:33 +02:00
Eelco Dolstra
d7026cc571
Merge pull request #3805 from Ma27/ansi-color-fix
...
Fix ANSI color constants
2020-07-13 10:10:22 +02:00
John Ericson
c466cb2091
Merge branch 'hash-always-has-type' into better-ca-parse-errors
2020-07-13 03:02:09 +00:00
John Ericson
4415765385
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-07-13 03:01:44 +00:00
John Ericson
230c9b4329
Change types to prepare the way for CA derivations
...
We've added the variant to `DerivationOutput` to support them, but made
`DerivationOutput::path` partial to avoid actually implementing them.
With this chage, we can all collaborate on "just" removing
`DerivationOutput::path` calls to implement CA derivations.
2020-07-12 23:53:33 +00:00
John Ericson
fedfc913ad
Use more std::visit to prepare for new variant
...
N.B. not using `std::visit` for fetchurl because there is no attempt to
handle all the cases (e.g. no `else`) and lambda complicates early
return.
2020-07-12 23:51:40 +00:00
John Ericson
ffc18583b1
Move C++17 "pattern matching" boilerplat to utils.hh
2020-07-12 22:15:14 +00:00
John Ericson
886c91dfcc
Try to fix perl bindings
2020-07-12 18:26:10 +00:00
John Ericson
503b425690
DerivationOutputExtensional -> DerivationOutputInputAddressed
...
Thanks @regnat for the great name.
2020-07-12 15:56:20 +00:00
John Ericson
a8d4707107
Undo erroneous indentation change
2020-07-12 15:54:12 +00:00
John Ericson
18152406ce
String .drv suffix to create derivation name
2020-07-12 15:40:14 +00:00
John Ericson
5d0b75e5b6
std::string_view for new derivation name parameters
2020-07-12 15:02:36 +00:00
Maximilian Bosch
64f03635d7
Fix ANSI color constants
...
The `m` acts as termination-symbol when declaring graphics. Because
of this, the `;1m` doesn't have any effect and is directly printed to
the console:
```
$ nix repl
> builtins.fetchGit { /* ... */ }
{ outPath = "/nix/store/s0f0iz4a41cxx2h055lmh6p2d5k5bc6r-source"; rev = "e73e45b723a9a6eecb98bd5f3df395d9ab3633b6"; revCount = ;1m428; shortRev = "e73e45b"; submodules = ;1mfalse; }
```
Introduced by 6403508f5a .
2020-07-12 16:52:20 +02:00
John Ericson
13ec627e0a
Set derivation name in dervationStrict
2020-07-12 03:03:12 +00:00
John Ericson
1c9bec226f
Don't improperly assume path is store path
2020-07-12 02:38:03 +00:00
John Ericson
abea26a968
BasicDerivation::findOutput cannot return reference anymore
2020-07-12 01:57:06 +00:00
John Ericson
442d43178b
Merge remote-tracking branch 'upstream/master' into optional-derivation-output-storepath
2020-07-11 02:27:45 +00:00
Matthew Bauer
acb74d4d94
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-07-10 18:13:45 -04:00
Eelco Dolstra
8efa23bb99
Avoid a redundant hash
2020-07-10 15:56:24 +02:00
Eelco Dolstra
5dff49f661
Factor out commonality between nix-prefetch-url and nix-store --add-fixed
2020-07-10 13:21:37 +02:00
Eelco Dolstra
7f1a86d57c
nix-store --add-fixed: Run in constant memory
2020-07-10 12:51:56 +02:00
Eelco Dolstra
06e3dd9005
nix-prefetch-url: Run in constant memory when using RemoteStore
...
Fixes #3684 .
2020-07-10 11:22:48 +02:00
Eelco Dolstra
062a584f12
.dir-locals.el: Set c-block-comment-prefix
2020-07-10 11:21:06 +02:00
John Ericson
323d51a7a0
Merge branch 'master' of github.com:NixOS/nix into better-ca-parse-errors
2020-07-09 19:07:06 +00:00
Matthew Bauer
a7884970c5
Fix DerivationOutputExtensional name
2020-07-09 11:37:18 -04:00
Eelco Dolstra
a2c27022e9
LocalStore::addToStore(srcPath): Handle the flat case
...
This helps nix-prefetch-url when using a local store.
2020-07-09 15:54:32 +02:00
Eelco Dolstra
2dd8443e30
Merge pull request #3797 from nix-macos-perf-test/macos-perf-test
...
add temp CI job to test syspolicy impact
2020-07-09 11:59:22 +02:00
Travis A. Everett
cfe6ea746c
add temp CI job to test syspolicy impact
...
Starting in Catalina, macOS runs a syspolicyd "assessment" that hits the network for each binary/script executable. It does cache these results, but Nix tends to introduce many "new" executables per build. (You can read more about this at https://github.com/NixOS/nix/issues/3789 ).
This PR adds a temporary, redundant macOS job with these assessments disabled. I'm hoping you can adopt it for a few weeks to help me collect more data on how this affects real projects.
2020-07-08 20:10:22 -05:00
Matthew Bauer
06a4e15478
Fix build.cc on linux
2020-07-08 19:27:51 -04:00
Matthew Bauer
8e0d0689be
Only store hash of fixed derivation output
...
we don’t need a full storepath for a fixedoutput derivation. So just
putting the ingestion method + the hash is sufficient.
2020-07-08 19:11:39 -04:00
Eelco Dolstra
b981e5aacf
Cleanup
2020-07-08 22:07:21 +02:00
Eelco Dolstra
34f25124ba
Make LocalStore::addToStore(srcPath) run in constant memory
...
This reduces memory consumption of
nix-instantiate \
-E 'with import <nixpkgs> {}; runCommand "foo" { src = ./blender; } "echo foo"' \
--option nar-buffer-size 10000
(where ./blender is a 1.1 GiB tree) from 1716 to 36 MiB, while still
ensuring that we don't do any write I/O for small source paths (up to
'nar-buffer-size' bytes). The downside is that large paths are now
always written to a temporary location in the store, even if they
produce an already valid store path. Thus, adding large paths might be
slower and run out of disk space. ¯\_(ツ)_/¯ Of course, you can always
restore the old behaviour by setting 'nar-buffer-size' to a very high
value.
2020-07-08 22:07:21 +02:00
Matthew Bauer
af95a7c16b
Add name to BasicDerivation
...
We always have a name for BasicDerivation, since we have a derivation
store path that has a name.
2020-07-08 15:38:01 -04:00
Eelco Dolstra
7d8d78f06a
upload-release.pl: Update latest-release branch
2020-07-08 17:01:20 +02:00
Eelco Dolstra
9223603908
Merge remote-tracking branch 'origin/master' into flakes
2020-07-08 15:55:19 +02:00
Eelco Dolstra
16ec7785ca
Fix 'got unknown message type 1 from Nix daemon'
...
Example:
$ nix-build -E 'with import <nixpkgs> {}; runCommand "foo" { x = runCommand "bar" {} "exit 1"; } "echo foo; exit 1"'
warning: unknown setting 'auto-allocate-uids'
these 2 derivations will be built:
/nix/store/v4fbdbhcdi949929a67g8farwf72zgam-bar.drv
/nix/store/k4fsvrjl7cp2xpz7927iv7g0dqj1zyhs-foo.drv
warning: unknown setting 'auto-allocate-uids'
building '/nix/store/v4fbdbhcdi949929a67g8farwf72zgam-bar.drv'...
error: --- Error ----------------------------------------------------------------------------------------------------------------------------------------------------------------- nix-daemon
builder for '/nix/store/v4fbdbhcdi949929a67g8farwf72zgam-bar.drv' failed with exit code 1
error: --- Error ------------------------------------------------------------------------------------------------------------------------------------------------------------------ nix-build
got unknown message type 1 from Nix daemon
2020-07-08 15:53:14 +02:00
Daniel Fitzpatrick
39859b853c
merged systemd installer with non-systemd installer.
2020-07-07 15:08:23 -05:00
Eelco Dolstra
1ab9da9154
Merge remote-tracking branch 'origin/master' into flakes
2020-07-07 14:38:57 +02:00
Eelco Dolstra
4055cfee36
Fix coverage build
2020-07-07 14:37:47 +02:00
Eelco Dolstra
7c9ece5dca
exportReferencesGraph: Fix support for non-top-level store paths
...
Fixes #3471 .
2020-07-07 14:25:43 +02:00
Daniel Fitzpatrick
fd42176a21
Add a script to install nix on non-systemd systems.
2020-07-06 21:59:18 -05:00
Carlo Nucera
0f05a36e20
Merge branch 'master' of github.com:NixOS/nix into better-ca-parse-errors
2020-07-06 16:57:09 -04:00
Eelco Dolstra
c385535c18
Merge pull request #3783 from bburdette/macos-test
...
address failing addTrace test
2020-07-06 22:37:44 +02:00
Ben Burdette
efd6a8b230
bump
2020-07-06 11:54:53 -06:00
Ben Burdette
75bfcf8d15
revamp trace code and test
2020-07-06 10:51:48 -06:00
Eelco Dolstra
68f524d717
nix develop: Support derivations with multiple outputs
2020-07-06 18:34:58 +02:00
Eelco Dolstra
cd8eb8a7d1
nix develop: Fall back to "bash" if nixpkgs#bashInteractive is unavailable
2020-07-06 17:08:54 +02:00
Eelco Dolstra
54712aaf8a
Merge remote-tracking branch 'origin/master' into flakes
2020-07-06 16:40:10 +02:00
John Ericson
f1c7746eb4
See if setting -std=c++17 for perl bindings helps
2020-07-05 21:50:27 +00:00
John Ericson
a38ab99d57
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
2020-07-05 21:49:01 +00:00
Ben Burdette
a168224464
spacing
2020-07-04 18:30:49 -06:00
John Ericson
465daa9396
Merge remote-tracking branch 'upstream/master' into add-body-to-network-errors
2020-07-03 17:08:39 +00:00
John Ericson
d4250fef23
Fix Perl, again...
2020-07-03 15:17:20 +00:00
John Ericson
d291be444b
Fix Perl
2020-07-03 14:49:22 +00:00
Eelco Dolstra
14227aeb32
Merge branch 'add-trace' of https://github.com/bburdette/nix
2020-07-03 16:27:39 +02:00
John Ericson
3134db1a83
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-07-03 14:12:38 +00:00
John Ericson
dbffd309fe
Merge branch 'master' of github.com:NixOS/nix into hash-always-has-type
2020-07-03 14:11:38 +00:00
Ben Burdette
b29a4ea1dc
Merge branch 'master' into add-trace
2020-07-03 07:57:36 -06:00
Eelco Dolstra
c3c7aedbb5
nix develop: Fix bad regex
...
This was accepted by libstdc++ but not libc++.
https://hydra.nixos.org/build/123569154
2020-07-03 14:58:58 +02:00
Eelco Dolstra
6f8fd3a3f2
Shut up a clang warning
2020-07-03 14:50:07 +02:00
Eelco Dolstra
dfaad374ff
Merge pull request #3778 from tweag/parallel-tests
...
Parallel tests fixes
2020-07-03 13:17:10 +02:00
Eelco Dolstra
017efae01f
Hopefully fix macOS test failure
2020-07-03 13:16:22 +02:00
regnat
223fbe644a
Shorten the path to the test root
...
Fix a socket length failure on the OSX builders
2020-07-03 09:20:01 +02:00
regnat
5101ed18bc
Fix the test dependencies
...
Reuse the pre-existing list rather than the one written as part of #3777
2020-07-03 09:20:01 +02:00
John Ericson
13796be78d
Have splitPrefix and splitPrefixTo parser helpers
2020-07-02 23:18:22 +00:00
John Ericson
a7cd7425d9
Move getParsedTypeAndSRI to a more suitable location
...
Also mark it static
2020-07-02 23:10:11 +00:00
John Ericson
2f93d9f2ba
Merge branch 'hash-always-has-type' into HEAD
2020-07-02 21:47:51 +00:00
John Ericson
1be279af26
Fix Narinfo corruption detection bug
...
The aim of this check was just to ensure each key occurs once.
2020-07-02 21:46:10 +00:00
Eelco Dolstra
5596f879b4
Add test for nix develop
2020-07-02 18:32:45 +02:00
Eelco Dolstra
b5e4253697
Fix abort in 'nix develop'
2020-07-02 18:24:11 +02:00
Carlo Nucera
1fc835aa22
Tighten parsing for drv files and pathinfo
2020-07-02 11:57:21 -04:00
Ben Burdette
5818271c6e
spacing
2020-07-02 09:41:54 -06:00
Carlo Nucera
b6b10b1d4c
Write the implementation for parseNonSRIUnprefixed
2020-07-02 11:34:40 -04:00
Carlo Nucera
ea48e3a5b5
Abstract common parsing functionality
2020-07-02 11:29:33 -04:00
Carlo Nucera
36cbc74689
Inline and simplify in parseAnyPrefixed
2020-07-02 11:21:00 -04:00
Matthew Bauer
fc2ab42e86
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-07-02 11:14:04 -04:00
Matthew Bauer
d2e8b9ff0e
Store subPath in SubstitutionGoal
2020-07-02 11:12:05 -04:00
Carlo Nucera
9462d8a50b
Rename fromSRI to parseSRI for constistency
2020-07-02 11:11:18 -04:00
Carlo Nucera
f61bc45d19
Get rid of the std::pair
2020-07-02 11:09:04 -04:00
Ben Burdette
bf2788e4c1
move showTrace to new loggerSettings
2020-07-02 09:04:31 -06:00
Carlo Nucera
27c8029573
Inline newFunction
2020-07-02 11:01:10 -04:00
Matthew Bauer
1f9cb06db2
Try next when no ca exists and have different store dirs
2020-07-02 10:59:24 -04:00
Carlo Nucera
343d1569b1
Fix test suite
2020-07-02 10:48:47 -04:00
Eelco Dolstra
a5b6e870fe
Set gc-reserved-space to 0 in tests
...
This reduces the amount of disk space needed to run the tests from
half a gigabyte to 10 megabytes.
2020-07-02 16:38:42 +02:00
Eelco Dolstra
ec5d7cb8e2
Merge branch 'parallel-tests' of https://github.com/tweag/nix
2020-07-02 16:38:38 +02:00
regnat
11ba4ec795
Make the gc-auto test more reliable
...
Use a fifo pipe to handle the synchronisation between the different
threads rather than relying on delays
2020-07-02 16:13:36 +02:00
regnat
c762385457
Make the gc-concurrent test more reliable
...
Use a fifo pipe to handle the synchronisation between the different
threads rather than relying on delays
2020-07-02 16:13:36 +02:00
regnat
1b5aa60767
Run the tests in parallel
...
Cause the time needed to run the testsuite to drop from ~4mins to ~40s
2020-07-02 16:13:36 +02:00
Ben Burdette
5ae498872a
assert for invalid fileorigin
2020-07-02 07:14:40 -06:00
Carlo Nucera
263ccdd489
Rename two hash constructors to proper functions
2020-07-01 18:34:18 -04:00
Carlo Nucera
c8c4bcf90e
Inline Hash::init()
2020-07-01 18:03:35 -04:00
Carlo Nucera
d63a5ded76
Remove unused import
2020-07-01 17:53:24 -04:00
Carlo Nucera
6faeec3b2a
Keep the previous name, for diffing
2020-07-01 17:50:34 -04:00
Carlo Nucera
274a8136fb
Correct FIXMEs in libfetchers
2020-07-01 17:47:15 -04:00
Carlo Nucera
c2e7f7a712
Fixed build, we still have test errors
2020-07-01 17:32:06 -04:00
Ben Burdette
8497891b99
spacing
2020-07-01 13:50:18 -06:00
Eelco Dolstra
6ff9aa8df7
Don't process an option if any of its arguments need completion
2020-07-01 20:31:39 +02:00
Eelco Dolstra
d746503e5c
Add --inputs-from to use flake inputs as registry entries
...
This allows you to refer to an input from another flake. For example,
$ nix run --inputs-from /path/to/hydra nixpkgs#hello
runs 'hello' from the 'nixpkgs' inputs of the 'hydra' flake.
Fixes #3769 .
2020-07-01 20:25:13 +02:00
Ben Burdette
a295b2ea96
if no errLoc, no Loc.
2020-07-01 12:02:02 -06:00
Ben Burdette
3629b0585a
don't include errpos for addErrorContext
2020-07-01 11:49:01 -06:00
Ben Burdette
2a39c083dc
non-pos trace test
2020-07-01 10:37:31 -06:00
Eelco Dolstra
38ccf2e241
Cleanup
2020-07-01 15:31:34 +02:00
Eelco Dolstra
86a4aba6c4
Merge branch 'remote-query-outputs' of https://github.com/tweag/nix
2020-07-01 15:10:29 +02:00
Eelco Dolstra
7d554f295c
Support building flakes from a shallow Git repo
...
Fixes #3756 .
2020-07-01 14:57:59 +02:00
Ben Burdette
a7d5d26443
fix tests with the 'from string' change
2020-06-30 22:05:21 -06:00
Ben Burdette
dabbb4538f
'from string'
2020-06-30 16:43:01 -06:00
Ben Burdette
9159dfe3d8
comments and cleanup
2020-06-30 16:31:55 -06:00
Ben Burdette
70bcb39d3f
double addtrace for 'called from'
2020-06-30 15:44:19 -06:00
Matthew Bauer
09833126f3
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-30 16:35:08 -04:00
Ben Burdette
ddb81ca126
Merge branch 'master' into add-trace
2020-06-30 12:21:45 -06:00
Carlo Nucera
b798efb829
WIP initial design
2020-06-30 14:10:30 -04:00
Eelco Dolstra
ee1582494e
Merge pull request #3767 from bburdette/pos-null-check
...
Pos null check
2020-06-30 19:52:22 +02:00
Ben Burdette
a0705e0dd1
invalid pos check
2020-06-30 11:01:46 -06:00
Ben Burdette
e72a16a339
check for a null symbol
2020-06-30 11:00:51 -06:00
Carlo Nucera
a1f66d1d9e
Factor the prefix splitting in hash
2020-06-30 12:49:00 -04:00
Carlo Nucera
77b51f4598
Factor the prefix splitting in content-address
2020-06-30 11:57:46 -04:00
Carlo Nucera
7ba0fae0dd
Create the spitPrefix function in parser.hh
2020-06-30 11:57:09 -04:00
John Ericson
baaab2aab5
Add nativeBuildInputs to shell.nix
2020-06-30 14:54:06 +00:00
Ben Burdette
c484a67914
trace formatting
2020-06-29 15:46:21 -06:00
John Ericson
696bb134c1
Fix shell.nix
2020-06-29 21:36:09 +00:00
John Ericson
24da034bc3
Add possibly missing <string> include
2020-06-29 21:22:00 +00:00
Eelco Dolstra
2b834d48aa
NAR parser: Fix missing name field check
...
Discovered by @Kloenk.
2020-06-29 22:45:41 +02:00
Matthew Bauer
ded6589953
Fixup coverage build
2020-06-29 20:34:45 +00:00
Matthew Bauer
78fadaf863
fix release.nix eval
2020-06-29 20:34:45 +00:00
Matthew Bauer
289558dffb
Add unordered_set to globals.cc header
2020-06-29 20:34:45 +00:00
Matthew Bauer
da77331cb7
Remove lazy lookup in getHome
...
this seems to break in Musl/Static with:
terminate called after throwing an instance of 'std::bad_function_call'
what(): bad_function_call
2020-06-29 20:34:26 +00:00
Matthew Bauer
70719a9dd8
Add -lz to end of linking
...
this is needed for static linking to work properly
2020-06-29 20:34:26 +00:00
Matthew Bauer
07dae2ff77
Setup static building of nix
2020-06-29 20:34:26 +00:00
Matthew Bauer
88cf6ffce3
Rename logging->stdout to logging->stdout_
...
musl doesn't like this identifier
2020-06-29 20:34:26 +00:00
John Ericson
a83566e5bc
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into better-ca-parse-errors
2020-06-29 18:40:34 +00:00
John Ericson
987a4a0be9
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-06-29 18:03:21 +00:00
Eelco Dolstra
26cf0c674f
nix run: Use packages/legacyPackages as fallback if there is no app definition
...
'nix run' will try to run $out/bin/<name>, where <name> is the
derivation name (excluding the version). This often works well:
$ nix run nixpkgs#hello
Hello, world!
$ nix run nix -- --version
nix (Nix) 2.4pre20200626_adf2fbb
$ nix run patchelf -- --version
patchelf 0.11.20200623.e61654b
$ nix run nixpkgs#firefox -- --version
Mozilla Firefox 77.0.1
$ nix run nixpkgs#gimp -- --version
GNU Image Manipulation Program version 2.10.14
though not always:
$ nix run nixpkgs#git
error: unable to execute '/nix/store/kp7wp760l4gryq9s36x481b2x4rfklcy-git-2.25.4/bin/git-minimal': No such file or directory
2020-06-29 19:08:50 +02:00
Eelco Dolstra
50f13b06fb
EvalCache: Store string contexts
2020-06-29 19:08:37 +02:00
Ben Burdette
8f81fae116
showTrace flag in loggers
2020-06-29 10:20:51 -06:00
Eelco Dolstra
b681408879
Factor out EvalCache::forceDerivation()
2020-06-29 16:39:41 +02:00
Eelco Dolstra
ca946860ce
Fix bash completion
2020-06-29 14:37:22 +02:00
Eelco Dolstra
bc03c6f23d
Move App
2020-06-29 14:14:23 +02:00
Eelco Dolstra
58bc3b6578
Merge pull request #3729 from obsidiansystems/simpler-hased-mirror
...
hashed-mirrors: Use parsed derivation output rather than reconstructing it
2020-06-29 14:04:12 +02:00
Eelco Dolstra
64232f3ea6
Merge pull request #3749 from rodarima/master
...
Fall back to copyPath if link fails with EPERM
2020-06-29 13:31:24 +02:00
Domen Kožar
3fcbe30eea
Merge pull request #3758 from NixOS/dependabot/github_actions/cachix/install-nix-action-v10
...
Bump cachix/install-nix-action from v8 to v10
2020-06-28 08:16:01 +02:00
dependabot[bot]
9937f4ed37
Bump cachix/install-nix-action from v8 to v10
...
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action ) from v8 to v10.
- [Release notes](https://github.com/cachix/install-nix-action/releases )
- [Commits](https://github.com/cachix/install-nix-action/compare/v8...63cf434de4e4292c6960639d56c5dd550e789d77 )
Signed-off-by: dependabot[bot] <support@github.com >
2020-06-28 06:02:57 +00:00
Domen Kožar
b7795a3496
Merge pull request #3757 from Mic92/dependabot
...
dependabot: automatically keep github actions up-to-date
2020-06-28 08:02:24 +02:00
Jörg Thalheim
7af734bac1
dependabot: automatically keep github actions up-to-date
2020-06-27 20:37:05 +01:00
Ben Burdette
ef24a0835d
showtrace as function arg
2020-06-27 12:19:31 -06:00
Carlo Nucera
278a679782
Merge branch 'master' of github.com:NixOS/nix into allow-relative-paths-in-store-option
2020-06-26 10:40:13 -04:00
Eelco Dolstra
adf2fbbdc2
Merge remote-tracking branch 'origin/master' into flakes
2020-06-26 08:46:46 +02:00
John Ericson
d92d4f85a5
Move ValidPathInfo to its own header
2020-06-25 17:48:49 +00:00
Eelco Dolstra
b7ccf7ae2a
build-remote.sh: Test LegacySSHStore
2020-06-25 18:42:55 +02:00
Ben Burdette
bc9e87412c
'string' makes more sense in nix repl
2020-06-25 09:56:32 -06:00
Ben Burdette
9ab808c926
showTrace flag for ErrorInfo; showTrace test.
2020-06-25 09:23:12 -06:00
Eelco Dolstra
de2641ae99
Fix empty std::optional dereference in writeDerivation()
...
https://hydra.nixos.org/build/123017579
2020-06-25 15:50:30 +02:00
Rodrigo
3a642187c3
Fall back to copyPath if link fails with EPERM
...
BeeGFS doesn't allow hard-links and returns EPERM, so we fall back
to copyPath. See https://github.com/NixOS/nix/issues/3748
2020-06-25 12:03:26 +02:00
Ben Burdette
9c0e1fd4f1
add trace test; error formatting refinements
2020-06-24 18:31:28 -06:00
Ben Burdette
6359d71d6b
re-enable --show-trace check
2020-06-24 18:28:20 -06:00
Ben Burdette
023912def3
convenience form of addTrace
2020-06-24 13:46:25 -06:00
Ben Burdette
93e9307329
repl indenting
2020-06-24 13:14:49 -06:00
Ben Burdette
b18ed02b76
repl indenting
2020-06-24 13:10:41 -06:00
regnat
d38f860c3e
Add a way to get all the outputs of a derivation with their label
...
Generalize `queryDerivationOutputNames` and `queryDerivationOutputs` by
adding a `queryDerivationOutputMap` that returns the map
`outputName=>outputPath`
(not that this is not equivalent to merging the results of
`queryDerivationOutputs` and `queryDerivationOutputNames` as sets don't
preserve the order, so we would end up with an incorrect mapping).
squash! Add a way to get all the outputs of a derivation with their label
Rename StorePathMap to OutputPathMap
2020-06-24 20:38:40 +02:00
Ben Burdette
6fe660acf9
re-remove
2020-06-24 12:33:05 -06:00
Matthew Bauer
bcf8582091
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-24 12:52:09 -04:00
John Ericson
d9fb9e9f26
Merge remote-tracking branch 'upstream/master' into ca-drv
2020-06-24 15:41:29 +00:00
Ben Burdette
00fe653ea5
nixCode -> LinesOfCode
2020-06-24 08:33:53 -06:00
Domen Kožar
3c50e84387
Merge pull request #3739 from Mic92/curl
...
docs/installer: add correct curl flags
2020-06-24 07:15:41 +02:00
Jörg Thalheim
3685f4eec6
docs/installer: add correct curl flags
...
also see https://nixos.org/download.html
2020-06-23 23:04:10 +01:00
Ben Burdette
1d43a6e123
use plain errPos instead of nixCode; fix tests
2020-06-23 15:30:13 -06:00
Carlo Nucera
8d51d38e4c
Fix test suite
2020-06-23 17:16:20 -04:00
John Ericson
ec3a857307
Fix and clean up hash parser
2020-06-23 18:19:40 +00:00
John Ericson
98e5d1af03
Merge remote-tracking branch 'upstream/master' into hash-always-has-type
2020-06-23 17:03:37 +00:00
Ben Burdette
d0e78fbb03
re-add Pos origin in tests
2020-06-23 10:51:58 -06:00
Ben Burdette
abe0552504
Merge remote-tracking branch 'upstream/master' into add-trace
2020-06-23 09:40:28 -06:00
Ben Burdette
13e87535ff
traces to bottom
2020-06-23 09:36:58 -06:00
Carlo Nucera
e197bc6229
Enable the --store option to take relative paths
...
In nix commands which accept --store options, we can now specify a
relative path, which will be canonicalized.
2020-06-23 11:13:18 -04:00
Eelco Dolstra
09fc06daab
nix flake init: Use git add --force
2020-06-23 16:25:32 +02:00
Eelco Dolstra
015e1c2131
Merge pull request #3724 from bburdette/hintfmt-percent
...
Hintfmt percent test, and fix
2020-06-23 12:26:00 +02:00
John Ericson
55d4bd6e0e
Improve content address parsing
...
- Ensure hash is in form <algo>-<prefix> and not SRI.
- Better errors if something goes wrong
- string_view for no coppying
2020-06-22 18:08:27 +00:00
Ben Burdette
9d1cb0c5e6
with normaltxt, elide yellow color code instead of canceling it; use normaltxt on plain_string hintfmt
2020-06-22 11:32:20 -06:00
Matthew Bauer
66a62b3189
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-22 13:08:11 -04:00
Ben Burdette and John Ericson
28b079067f
Update src/libutil/fmt.hh
...
Co-authored-by: John Ericson <git@JohnEricson.me >
2020-06-22 10:00:37 -06:00
John Ericson
f4a5913125
hashed-mirrors: Use parsed derivation output rather than reconstructing it
...
Now the derivation outputs are parsed up front, we can avoid a reparse
by doing it. Also, this just feels a bit better as the `output*` env
vars are more of a `libnixexpr` interface than `libnixstore` interface:
ultimately, it's the derivation outputs that decide whether the
derivation is fixed-output.
Yes, hashed mirrors might go away with #3689 , but this bit of code would
be moved rather than deleted, so it's worth doing a cleanup anyways I
think.
2020-06-22 15:17:20 +00:00
Carlo Nucera
3dc10f7393
Merge branch 'hash-always-has-type' of github.com:obsidiansystems/nix into hash-always-has-type
2020-06-22 10:09:22 -04:00
Carlo Nucera
73ac003b37
More bug fixing
2020-06-22 10:03:19 -04:00
Eelco Dolstra
965b80347e
Merge pull request #3649 from obsidiansystems/validPathInfo-ca-proper-datatype
...
ValidPathInfo: make ca field a proper datatype
2020-06-22 14:34:00 +02:00
Eelco Dolstra
334e26bfc2
nix flake check: Don't build apps
...
This was inconsistent since we're not building 'packages' or
'defaultPackage' either.
Closes #3726 .
2020-06-22 11:31:07 +02:00
John Ericson
93bbe6e8ab
Merge remote-tracking branch 'upstream/master' into ca-drv
2020-06-21 21:11:58 +00:00
John Ericson
3804e3df9b
Don't anticipate hash algo without hash in derivation for now
...
When we merge with master, the new lack of string types make this case
impossible (after parsing). Later, when we actually implemenent
CA-derivations, we'll change the types to allow that.
2020-06-21 21:05:37 +00:00
John Ericson
8313f0e939
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
2020-06-21 20:39:10 +00:00
John Ericson
bf9f040112
Tweak declaration
...
I think this is clearer
2020-06-21 16:51:39 +00:00
John Ericson
fdeabf7160
Merge remote-tracking branch 'upstream/master' into multi-output-hashDerivationModulo
2020-06-21 16:43:17 +00:00
Ben Burdette
be4f444175
tidying up
2020-06-19 16:58:12 -06:00
Ben Burdette
0309488a66
fmt -> hintfmt test
2020-06-19 16:46:49 -06:00
Matthew Bauer
f2a6cee334
Update worker protocol to support sending storepath maps
...
We need to also send the ca to daemon in addition to the path.
2020-06-19 18:06:19 -04:00
Ben Burdette
397dbe114e
remove formathelper
2020-06-19 15:57:19 -06:00
John Ericson
507aa48739
WIP: Make Hash always store a valid hash type
2020-06-19 21:48:57 +00:00
Ben Burdette
b193aca4ae
escape percents
2020-06-19 15:29:19 -06:00
Ben Burdette
db475f9e7e
too few, too many args
2020-06-19 15:28:13 -06:00
Ben Burdette
cdddf24f25
add hintfmt test
2020-06-19 14:54:41 -06:00
Carlo Nucera
e7a14118df
WIP bug fixing
2020-06-19 16:50:28 -04:00
Ben Burdette
54e8f550c9
addErrorTrace
2020-06-19 13:44:08 -06:00
John Ericson
20799a5151
WIP: Make Hash always store a valid hash type
2020-06-19 19:32:29 +00:00
Matthew Bauer
e8e1f5282f
Replace error message in getDerivationCA
2020-06-19 15:19:09 -04:00
Matthew Bauer
0c9c1b8826
Return map of StorePaths in copyPaths
...
This allows the caller to know what values were actually added to the
store.
2020-06-19 14:48:57 -04:00
John Ericson
e288c0987a
Merge remote-tracking branch 'upstream/master' into validPathInfo-ca-proper-datatype
2020-06-19 18:44:24 +00:00
Matthew Bauer
7e11cf3399
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-19 14:40:49 -04:00
Eelco Dolstra
984e521392
Merge pull request #3650 from obsidiansystems/no-hash-type-unknown
...
Remove `HashType::htUnknown`
2020-06-19 20:22:36 +02:00
Matthew Bauer
2796b01e86
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-19 14:22:06 -04:00
John Ericson
29691edb2f
Merge remote-tracking branch 'upstream/master' into validPathInfo-ca-proper-datatype
2020-06-19 17:54:50 +00:00
John Ericson
68294746ae
Merge remote-tracking branch 'upstream/master' into no-hash-type-unknown
2020-06-19 17:53:34 +00:00
John Ericson
c98081d270
Merge remote-tracking branch 'upstream/master' into no-hash-type-unknown
2020-06-19 17:50:05 +00:00
John Ericson
c1892a5316
tabs -> spaces
2020-06-19 17:49:57 +00:00
Eelco Dolstra
424bb5819f
Merge pull request #3439 from Ericson2314/no-stringly-typed-derivation-output
...
Store parsed hashes in `DerivationOutput`
2020-06-19 19:47:43 +02:00
John Ericson
911fc88bcb
More designated initializers
2020-06-19 17:42:56 +00:00
John Ericson
2f0e395c99
Merge remote-tracking branch 'me/no-stringly-typed-derivation-output' into validPathInfo-ca-proper-datatype
2020-06-19 15:26:59 +00:00
John Ericson
fb39a5e00c
Remove unneeded constructor for DerivationOutputHash
2020-06-19 15:11:11 +00:00
John Ericson
b90cac3bad
Remove uneeded = default for Hash
2020-06-19 15:00:38 +00:00
John Ericson
01dc8b0bab
Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output
2020-06-19 14:59:05 +00:00
John Ericson
145d88cb2a
Use designated initializers for DerivationOutputHash
2020-06-19 14:58:30 +00:00
John Ericson
237d88c97e
FileSystemHash -> DerivationOutputHash
2020-06-19 14:47:10 +00:00
Eelco Dolstra
2886c92aef
Merge pull request #3669 from gilligan/add-compression-tests
...
Add compression unit tests
2020-06-19 13:59:04 +02:00
John Ericson
3fc58a9638
Remove some Base:: that crept in
2020-06-19 00:24:47 +00:00
John Ericson
3f8dcfe3fd
Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatype
2020-06-18 23:01:58 +00:00
John Ericson
669c3992e8
Merge branch 'no-hash-type-unknown' into validPathInfo-temp
2020-06-18 22:33:07 +00:00
John Ericson
15abb2aa2b
Revert the enum struct change
...
Not a regular git revert as there have been many merges and things.
2020-06-18 22:11:26 +00:00
John Ericson
bbbf3602a3
Merge branch 'enum-class' into no-hash-type-unknown
2020-06-18 22:11:19 +00:00
John Ericson
40526fbea5
Merge remote-tracking branch 'upstream/master' into enum-class
2020-06-18 21:38:15 +00:00
Ben Burdette
4d1a4f0217
addTrace
2020-06-18 15:25:26 -06:00
Ben Burdette
e6f93b94fc
Merge branch 'master' into caveman-LOCs
2020-06-18 13:07:53 -06:00
John Ericson
1b23fe4afb
Fix bugs
...
- Bad dynamic cast target ...classic
- std::shared_ptr need explicit deref
2020-06-18 19:03:10 +00:00
John Ericson
fb432b0bd2
Merge remote-tracking branch 'obsidian/fix-url-format' into add-body-to-network-errors
2020-06-18 18:08:02 +00:00
John Ericson
639e20dc3e
Prevent '%' in URL from causing crashes
...
We have a larger problem that passsing computed strings to the first
variable argument of many exception constructors is unsafe because that
first variable argument is interpreted not as a plain string, but format
string, and if it contains '%' boost::format will abort, since there are
no arguments to the format string.
In this particular instance '%' was used as part of an escape code in a
URL, which, when the download failed, caused Nix to abort displaying the
`FileTransferError`.
2020-06-18 17:54:16 +00:00
Eelco Dolstra
6c000eed80
Merge pull request #3709 from expipiplus1/master
...
Mention number of derivations to be build/fetched in output
2020-06-18 19:03:05 +02:00
John Ericson
74b219ef6e
Adjust FileTransferError message to use opt response
2020-06-18 14:48:45 +00:00
Eelco Dolstra
5771c8bbf2
Don't provide 'getFlake' if the 'flakes' feature is not enabled
...
(cherry picked from commit 0a1d3c1dd3 )
2020-06-18 14:03:00 +02:00
Eelco Dolstra
2a61bbf77f
Some backports from the flakes branch
2020-06-18 14:03:00 +02:00
Eelco Dolstra
377345e26f
Remove unneeded #include
2020-06-18 13:47:05 +02:00
Eelco Dolstra
7083d33efe
Make constant primops lazy
...
(cherry picked from commit aa0e2a2e70 )
2020-06-18 13:42:47 +02:00
Eelco Dolstra
3d492199bb
github: Respect default branch
2020-06-18 13:25:08 +02:00
Eelco Dolstra
25a1be9904
Merge pull request #3716 from SamirTalwar/follow-redirects-when-installing
...
Instruct the user to follow redirects when installing Nix.
2020-06-18 11:03:27 +02:00
Samir Talwar
9069759767
Instruct the user to follow redirects when installing Nix.
...
Nix installation now requires following redirects using `curl -L`. This
is currently represented on the [Nix download page][] but not in the
manual. This change updates the manual to reflect this.
Using `curl` without the `-L` flag results in an empty body, making
installation a no-op.
[Nix download page]: https://nixos.org/download.html
2020-06-18 10:29:24 +02:00
Eelco Dolstra
d1e0627cea
Merge pull request #3715 from tweag/ca-derivations_feature_flag
...
Rename content-addressed-paths into ca-derivations
2020-06-18 10:09:00 +02:00
regnat
4fef2ba7e4
Rename content-addressed-paths into ca-derivations
...
See <https://github.com/NixOS/nix/pull/3710#issuecomment-645480333 >
2020-06-18 09:25:55 +02:00
Carlo Nucera
004570a377
Add HTTP responses to FileTransferErrors
2020-06-17 22:34:31 +00:00
Carlo Nucera
a835c740ca
Replace TransferItem::status with a local variable
...
Everywhere seems to use `getHTTPStatus` now.
2020-06-17 22:16:24 +00:00
Carlo Nucera
289b9b8dcf
Create a new TeeSink abstraction
...
This is a bit complex because we want to expose extra functionality the
wrapped class has. Perhaps there is some inheritancy trickery to do this
nicer, but I don't know it, and this is the first thing we tried after a
series of attempts that did build.
This design is kind of like that of Rust's Writer, Reader, or Iter
adapters, which impliment more traits based on what the inner type
implements.
2020-06-17 22:09:32 +00:00
Carlo Nucera
fb05a6adcf
Eliminate old TeeSink abstraction
...
This was introduced in fa125b9b28 , and
then "reverted" in 1cf4801108 , except that
revert left the struct around doing nothing useful.
We're removing it all the way now because we want to make a new
`TeeSink` complementing the already-exiting `TeeSource`, that is
actually a completely different concept as far as the class hierarchy is
concerned.
2020-06-17 22:07:22 +00:00
Eelco Dolstra
2b8f33bf5f
Merge pull request #3713 from matthewbauer/cleanup-warnings
...
Cleanup class StorePath warning
2020-06-17 21:19:30 +02:00
Matthew Bauer
5e631e3304
Add StorePathCAMap for querySubstitutablePathInfos
...
I’m not 100% sure this is wanted since it kind of makes everything
have to know about ca even if they don’t really want to. But it also
make things easier in dealing with looking up ca.
2020-06-17 15:03:05 -04:00
Matthew Bauer
be50de1142
Make sure references are empty for store path replacing
...
also copy info2 instead of casting
2020-06-17 14:15:08 -04:00
Matthew Bauer
8974755d19
Add assert for replaced storePath
2020-06-17 14:04:46 -04:00
Eelco Dolstra
3078404e35
Merge pull request #3712 from obsidiansystems/make-http-successful-states-coherent
...
Make successful states coherent
2020-06-17 19:37:46 +02:00
Matthew Bauer
7bd88cc1dc
Merge remote-tracking branch 'origin/master' into substitute-other-storedir
2020-06-17 13:32:29 -04:00
Matthew Bauer
22d7d36703
Remove unused narInfoFile in binary-cache-store
2020-06-17 13:27:19 -04:00
Matthew Bauer
f767bedfac
Replace struct StorePath with class StorePath
...
also a similar case with struct Goal
2020-06-17 13:26:37 -04:00
Eelco Dolstra
5d69bbf3fe
Simplify shell.nix and default.nix
2020-06-17 19:21:46 +02:00
Carlo Nucera
4930cb48a2
Include review comments
2020-06-17 12:58:59 -04:00
Matthew Bauer
6438ba1e99
Update strings from review comment
2020-06-17 12:31:01 -04:00
Eelco Dolstra
2f51cd8dc9
Merge pull request #3710 from tweag/reserve_ca_derivations
...
Reserve the `__contentAddressed` derivation parameter
2020-06-17 18:28:26 +02:00
Eelco Dolstra
4d5169bdd5
Merge pull request #3707 from p01arst0rm/outdated-function-fix
...
replaced uncaught_exception with uncaught_exceptions
2020-06-17 18:26:01 +02:00
Eelco Dolstra
2e4bd78211
nix eval: Add --apply flag for post-processing the result
2020-06-17 18:12:24 +02:00
Eelco Dolstra
de08baf159
Merge pull request #3711 from obsidiansystems/dedup-escape-codes
...
Use `ansicolor.hh` in `nix repl` rather than duplicates
2020-06-17 17:46:21 +02:00
regnat
480b54e1c6
fixup! Reserve the __contentAddressed derivation parameter
2020-06-17 17:37:04 +02:00
Carlo Nucera
079c6e87de
Make successful states coherent
...
The successful states used in these two places in the code were slightly
different. Should they be the same list?
2020-06-17 11:16:16 -04:00
Eelco Dolstra
5332c439d0
InstallableFlake: Show all possible attribute names
...
E.g.
$ nix run nixpkgs#hello
error: --- Error ---------- nix
flake 'flake:nixpkgs' does not provide attribute 'apps.x86_64-linux.hello' or 'hello'
instead of
$ nix run nixpkgs#hello
error: --- Error ---------- nix
flake 'flake:nixpkgs' does not provide attribute 'hello'
2020-06-17 17:13:01 +02:00
John Ericson
6403508f5a
Use ansicolor.hh in nix repl rather than duplicates
2020-06-17 15:13:00 +00:00
Eelco Dolstra
ad66fb0a37
getFlake -> builtins.getFlake
2020-06-17 17:05:08 +02:00
Eelco Dolstra
0a1d3c1dd3
Don't provide 'getFlake' if the 'flakes' feature is not enabled
2020-06-17 16:54:32 +02:00
regnat
56d75bf4fc
Reserve the __contentAddressed derivation parameter
...
Not implementing anything here, just throwing an error if a derivation
sets `__contentAddressed = true` without
`--experimental-features content-addressed-paths`
(and also with it as there's nothing implemented yet)
2020-06-17 15:41:17 +02:00
Eelco Dolstra
fdff09e57c
Fix coverage build
2020-06-17 15:18:10 +02:00
Eelco Dolstra
ccbea8255c
Merge pull request #3657 from obsidiansystems/sligthly-improve-store-path-documentation
...
Clarify the description of StorePath inputs
2020-06-17 14:54:37 +02:00
Joe Hermaszewski
da8aac6ce8
Mention number of derivations to be build/fetched in output
...
Also correct grammar for the case of a single derivation.
2020-06-17 20:27:27 +08:00
Eelco Dolstra
ea5bcfb59b
Merge pull request #3708 from p01arst0rm/extern-char-fix
...
appended ' __attribute__((weak)); ' to 'extern char * * environ '
2020-06-17 10:33:42 +02:00
Eelco Dolstra
1524752c17
Merge remote-tracking branch 'origin/master' into flakes
2020-06-17 10:26:52 +02:00
Eelco Dolstra
9ce994d45e
Remove rustfmt
2020-06-17 10:02:33 +02:00
John Ericson
517f5980e2
Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output
2020-06-17 04:58:43 +00:00
John Ericson
18493fd9c4
Move some Store functions from derivations.cc to store-api.cc
...
This further continues with the dependency inverstion. Also I just went
ahead and exposed `parseDerivation`: it seems like the more proper
building block, and not a bad thing to expose if we are trying to be
less wedded to drv files on disk anywas.
2020-06-17 04:30:16 +00:00
John Ericson
7130f0a3a6
Don't need abstract struct Derivation in local-store
2020-06-17 04:05:38 +00:00
John Ericson
21ef342172
Merge remote-tracking branch 'upstream/master' into derivation-header-include-order
2020-06-17 03:52:01 +00:00
John Ericson
02928f76fd
Merge remote-tracking branch 'upstream/master' into multi-output-hashDerivationModulo
2020-06-17 03:51:02 +00:00
John Ericson
49308ef039
Merge remote-tracking branch 'upstream/master' into ca-drv
2020-06-17 03:39:39 +00:00
p01arst0rm
e9970a34e8
appended ' __attribute__((weak)); ' to 'extern char * * environ '
2020-06-17 03:25:34 +01:00
p01arst0rm
c9d06558b6
replaced uncaught_exception with uncaught_exceptions
2020-06-17 03:15:47 +01:00
Eelco Dolstra
29542865ce
Remove StorePath::clone() and related functions
2020-06-16 22:20:18 +02:00
Eelco Dolstra
df4da4f5da
Merge pull request #3702 from NixOS/store-path-cxx
...
Rewrite StorePath class in C++
2020-06-16 21:37:26 +02:00
Eelco Dolstra
2cb59f4e99
Merge pull request #3704 from obsidiansystems/fix-include
...
Add another missing #include
2020-06-16 17:39:06 +02:00
John Ericson
fbf90bd693
Add another missing #include
2020-06-16 14:19:49 +00:00
Eelco Dolstra
cc83a86276
release.nix: Remove vendoredCrates
2020-06-16 14:33:03 +02:00
Eelco Dolstra
759947bf72
StorePath: Rewrite in C++
...
On nix-env -qa -f '<nixpkgs>', this reduces maximum RSS by 20970 KiB
and runtime by 0.8%. This is mostly because we're not parsing the hash
part as a hash anymore (just validating that it consists of base-32
characters).
Also, replace storePathToHash() by StorePath::hashPart().
2020-06-16 14:28:41 +02:00
Eelco Dolstra
72e17290d4
Fix FTP support
...
Fixes #3618 .
2020-06-16 11:53:04 +02:00
Domen Kožar
a8d51767ee
Merge pull request #3700 from gilligan/fix-master
...
Fix master
2020-06-16 10:44:55 +02:00
Tobias Pflug
cd8214c398
Fix logging unit tests
2020-06-16 10:23:15 +02:00
John Ericson
7e7e3b71f3
Add mising #include for strerror
2020-06-15 23:35:07 +00:00
Eelco Dolstra
a588b6b19d
Print only one error message if a build fails
...
E.g. instead of
error: --- BuildError ----------------------------------------------- nix
builder for '/nix/store/03nk0a3n8h2948k4lqfgnnmym7knkcma-foo.drv' failed with exit code 1
error: --- Error ---------------------------------------------------- nix
build of '/nix/store/03nk0a3n8h2948k4lqfgnnmym7knkcma-foo.drv' failed
we now get
error: --- Error ---------------------------------------------------- nix
builder for '/nix/store/03nk0a3n8h2948k4lqfgnnmym7knkcma-foo.drv' failed with exit code 1
2020-06-15 19:35:31 +02:00
Eelco Dolstra
24a3208247
Include only the base name of the program in error messages
2020-06-15 19:35:31 +02:00
Eelco Dolstra
8b099812ea
Respect terminal width printing error messages
2020-06-15 19:35:31 +02:00
Eelco Dolstra
f20bb983ca
Cleanup
2020-06-15 18:16:03 +02:00
Eelco Dolstra
4e995bc8a6
Always hide the progress bar on exit
2020-06-15 18:01:05 +02:00
Eelco Dolstra
31707735b6
Remove unnecessary amDone() overrides
2020-06-15 16:47:21 +02:00
Eelco Dolstra
ccfa6b3eee
Give better error message about <...> in pure eval mode
2020-06-15 16:12:27 +02:00
Eelco Dolstra
5ed5d7acbd
Improve "waiting for locks" messages
...
These are now shown in the progress bar.
Closes #3577 .
2020-06-15 16:03:29 +02:00
Eelco Dolstra
e14e62fddd
Remove trailing whitespace
2020-06-15 14:12:39 +02:00
Eelco Dolstra
1fb762d11f
Get rid of explicit ErrorInfo constructors
2020-06-15 14:06:58 +02:00
Eelco Dolstra
fd64e4fb96
Disambiguate BaseError(Args) constructor
...
This means that 'throw Error({ ... ErrorInfo ... })' now works.
2020-06-15 13:50:33 +02:00
Eelco Dolstra
7a77762961
Merge branch 'errors-phase-2' of https://github.com/bburdette/nix
2020-06-15 11:46:31 +02:00
Eelco Dolstra
25d64f3a30
Merge pull request #3690 from obsidiansystems/more-string-view
...
Use `std::string_view` in a few more places
2020-06-15 10:40:02 +02:00
Eelco Dolstra
340d0b055a
upload-release.pl: Fix nix-fallback-paths.nix generation
2020-06-15 10:28:59 +02:00
Matthew Bauer
9ac0d98a59
Remove -vvvvv from tests/fetchurl.sh nix-build call
2020-06-13 00:14:30 -05:00
Matthew Bauer
c214cda940
Correctly substitute from different storeDir
...
Originally, the test was only checking for different “real” storeDir.
That’s an easy case to handle, but the much harder one is if different
virtual store dirs are used. To do this, we need the SubstitutionGoal
to know about the ca, so it can recalculate the path to copy it over.
An important note here is that the store path passed to copyStorePath
needs to be one for srcStore - so that queryPathInfo works properly.
This also adds an error message when the store path from queryPathInfo
is different from the one we requested.
2020-06-13 00:07:42 -05:00
Matthew Bauer
b2cb288cdd
Add makeFixedOutputPathFromCA function
...
This puts what we are already doing into a shared method. It just
needs a path name and a ca and produces a store path.
2020-06-12 16:36:35 -05:00
John Ericson
f6f01416b7
Use std::string_view in a few more places
2020-06-12 21:32:30 +00:00
Matthew Bauer
006f1252d2
Fix SRI test
...
We can’t use custom name here because different names will have
different store paths. This is a limitation of the Store API’s
reliance on store paths.
We might be able to get around the above in the future by using a
dummy name for certain fixed output paths.
2020-06-12 15:33:24 -05:00
Matthew Bauer
88120442d2
Debug when storePath changes
...
these rewrites should be transparent, but they are important to know
about when debugging
2020-06-12 15:32:52 -05:00
Matthew Bauer
e3cb536f19
Fix add-to-store --flat to put in correct hash
2020-06-12 15:25:45 -05:00
Matthew Bauer
5b386b05f5
Recompute storePath based on isContentAddressed
2020-06-12 14:57:45 -05:00
Matthew Bauer
85d01e1f65
Don’t use makeStorePath
2020-06-12 14:53:30 -05:00
Matthew Bauer
1c148a80fe
Replace --hashed-mirrors with substituters test
2020-06-12 14:39:44 -05:00
Matthew Bauer
9077b9e6b2
Separate dstStore path from srcStore path
2020-06-12 14:27:28 -05:00
Matthew Bauer
2f2ac850b5
Compute new store path correctly
2020-06-12 14:03:17 -05:00
Matthew Bauer
1c55f16a16
Add --flat to nix add-to-store
...
This can be used to add flat hashes to the nix store.
2020-06-12 12:42:54 -05:00
Eelco Dolstra
2853ba4ab2
Fix build
2020-06-12 19:00:48 +02:00
Eelco Dolstra
00fa7e2205
Merge pull request #3674 from matthewbauer/allow-empty-hash2
...
Allow empty hash in derivations
2020-06-12 18:18:12 +02:00
Matthew Bauer
ea0d29d99a
Provide base argument to to_string
2020-06-12 10:18:27 -05:00
Matthew Bauer
11c97070f3
Fix storeDir != storeDir condition
...
this needs to only continue if the path replacement fails.
2020-06-12 10:14:03 -05:00
Matthew Bauer
b260c9ee03
Add newHashAllowEmpty helper function
...
This replaces the copy&paste with a helper function in hash.hh.
2020-06-12 10:11:16 -05:00
Matthew Bauer
3e3eaa90dd
Remove hashed-mirrors
2020-06-12 09:51:44 -05:00
Matthew Bauer
79c169d1c6
Allow substituting from different storeDir
...
Substituters can substitute from one store dir to another with a
little bit of help. The store api just needs to have a CA so it can
recompute the store path based on the new store dir. We can only do
this for fixed output derivations with no references, though.
2020-06-12 09:49:09 -05:00
Eelco Dolstra
9f736dd89d
Add Store::readDerivation() convenience function
2020-06-12 13:04:52 +02:00
Eelco Dolstra
045b07200c
Remove Store::queryDerivationOutputNames()
...
This function was used in only one place, where it could easily be
replaced by readDerivation() since it's not
performance-critical. (This function appears to have been modelled
after queryDerivationOutputs(), which exists only to make the garbage
collector faster.)
2020-06-12 12:46:33 +02:00
Eelco Dolstra
4a4c063222
Merge pull request #3670 from gilligan/add-pool-tests
...
Add tests for pool.hh
2020-06-12 11:19:05 +02:00
Eelco Dolstra
7db879e65e
Check 'follows' inputs
2020-06-12 00:52:56 +02:00
Ben Burdette
ef1b3f21b6
Merge remote-tracking branch 'upstream/master' into errors-phase-2
2020-06-11 14:06:35 -06:00
Eelco Dolstra
d15c20efd5
diffLockFiles(): Show 'follows' changes
2020-06-11 22:00:58 +02:00
Eelco Dolstra
ac4d43a31b
Merge pull request #3073 from tweag/machine-logs
...
Add an option to print the logs in a machine-readable format
2020-06-11 15:45:18 +02:00
Eelco Dolstra
dd9bb11d0d
Move names.{cc,hh} to libstore
2020-06-11 15:42:18 +02:00
Eelco Dolstra
95eb064062
Shut up warning
2020-06-11 15:39:30 +02:00
Eelco Dolstra
8bd892117a
Style fixes
2020-06-11 15:39:08 +02:00
Eelco Dolstra
0c62b4ad0f
Represent 'follows' inputs explicitly in the lock file
...
This fixes an issue where lockfile generation was not idempotent:
after updating a lockfile, a "follows" node would end up pointing to a
new copy of the node, rather than to the original node.
2020-06-11 14:40:21 +02:00
Tobias Pflug
4750d98bbd
Add tests for pool.hh
2020-06-10 22:29:50 +02:00
Eelco Dolstra
195ed43b60
Preserve 'isFlake' when not updating a lock file entry
2020-06-10 16:24:05 +02:00
Eelco Dolstra
2226e97ec2
Combine lock file update messages
2020-06-10 15:22:12 +02:00
Eelco Dolstra
fc6c7af424
Add helper function printInputPath()
2020-06-10 15:20:00 +02:00
Eelco Dolstra
b9ae1bdd7a
Merge pull request #3655 from zimbatm/hash-encoding-prepare
...
libutils/hash: remove default encoding
2020-06-10 11:48:38 +02:00
Eelco Dolstra
f64cc6d9b1
Merge pull request #3668 from tweag/fix-remote-nix-env-test
...
Actually test nix-env with a remote store
2020-06-10 11:45:35 +02:00
Eelco Dolstra
dc719b9745
Merge pull request #3677 from matthewbauer/static-nix-one-translation-unit
...
Prelink static libraries into an object file
2020-06-10 10:19:55 +02:00
Matthew Bauer
7eca8a16ea
Prelink static libraries into an object file
...
This combines the *.o into a big .o producing one translation unit.
This preserve our unused static initializers, as specified in the C++
standard:
If no variable or function is odr-used from a given translation
unit, the non-local variables defined in that translation unit may
never be initialized (this models the behavior of an on-demand
dynamic library).
Note that this is very similar to how the --whole-archive flag works.
One advantage of this is that users of the final .a library don’t have
to worry about specifying --whole-archive, or that we have unused
static initializers at all!
2020-06-09 23:35:38 -05:00
Matthew Bauer
b2c8061b44
Disable extra-platforms = i686-linux on wsl1 ( #3676 )
...
WSL1 doesn’t support i686-linux emulation, see https://github.com/microsoft/wsl/issues/2468
2020-06-09 21:53:53 +00:00
Matthew Bauer
19aa892f20
Support empty hash in fetchers
...
fetchTarball, fetchTree, and fetchGit all have *optional* hash attrs.
This means that we need to be careful with what we allow to avoid
accidentally making these defaults. When ‘hash = ""’ we assume the
empty hash is wanted.
2020-06-09 11:10:54 -05:00
Eelco Dolstra
29e0748847
Show HTTP status message
...
For example:
warning: unable to download 'https://api.github.com/repos/edolstra/dwarffs/commits/master ': HTTP error 403 ('rate limit exceeded'); using cached version
2020-06-09 14:20:22 +02:00
Eelco Dolstra
447ea52b07
FileTransfer: Don't store status since curl already does that
2020-06-09 14:05:15 +02:00
Eelco Dolstra
6cfc2db494
Fix applyOverride() for github
2020-06-09 13:45:07 +02:00
Eelco Dolstra
1205b41849
flake.lock: Update
...
Flake input changes:
* Updated 'nixpkgs': 'github:NixOS/nixpkgs/b88ff468e9850410070d4e0ccd68c7011f15b2be' -> 'github:NixOS/nixpkgs/70717a337f7ae4e486ba71a500367cad697e5f09'
2020-06-09 11:24:06 +02:00
Eelco Dolstra
e938add10d
flake.nix: Remove edition
2020-06-09 11:23:23 +02:00
Matthew Bauer
762273f1fd
Allow empty hash in derivations
...
follow up of https://github.com/NixOS/nix/pull/3544
This allows hash="" so that it can be used for debugging purposes. For
instance, this gives you an error message like:
warning: found empty hash, assuming you wanted 'sha256:0000000000000000000000000000000000000000000000000000'
hash mismatch in fixed-output derivation '/nix/store/asx6qw1r1xk6iak6y6jph4n58h4hdmbm-nix':
wanted: sha256:0000000000000000000000000000000000000000000000000000
got: sha256:0fpfhipl9v1mfzw2ffmxiyyzqwlkvww22bh9wcy4qrfslb4jm429
2020-06-09 01:23:37 -05:00
Ben Burdette
2f19650768
add file origin to Pos in stests
2020-06-08 11:21:17 -06:00
Ben Burdette
b1c53b034c
Merge branch 'errors-phase-2' into caveman-LOCs
2020-06-08 11:10:13 -06:00
regnat
801112de1a
Move progress-bar.cc to libmain
...
Needed so that we can include it as a logger in loggers.cc without
adding a dependency on nix
This also requires moving names.hh to libutil to prevent a circular
dependency between libmain and libexpr
2020-06-08 17:16:52 +02:00
Eelco Dolstra
e073f2c584
nix flake: Require 'flakes' feature
2020-06-08 16:23:54 +02:00
Eelco Dolstra
6470450ab4
Add completion for --update-input
2020-06-08 16:20:00 +02:00
Eelco Dolstra
c27f92698b
Style fixes
2020-06-08 13:24:01 +02:00
Tobias Pflug
cd6dbf951a
Add compression unit tests
2020-06-08 11:34:37 +02:00
regnat
f6ac888d3e
Actually test nix-env with a remote store
...
The `remote-store` test loads the `user-env` one to test nix-env when
using the daemon, but actually does it incorrectly because every test
starts (in `common.sh`) by resetting the value of `NIX_REMOTE`, meaning
that the `user-env` test will never use the daemon.
Fix this by setting `NIX_REMOTE_` before sourcing `user-env.sh` in the
`remote-store` test, so that `NIX_REMOTE` is correctly set inside the
test
2020-06-08 10:01:14 +02:00
regnat
4983401440
Unify the printing of the logs between bar-with-logs and raw
...
Make the printing of the build logs systematically go through the
logger, and replicate the behavior of `no-build-output` by having two
different loggers (one that prints the build logs and one that doesn't)
2020-06-08 09:31:15 +02:00
zimbatm
2c4de6af10
add documentation
2020-06-08 09:31:15 +02:00
regnat
170e86dff5
Make the logger customisable
...
Add a new `--log-format` cli argument to change the format of the logs.
The possible values are
- raw (the default one for old-style commands)
- bar (the default one for new-style commands)
- bar-with-logs (equivalent to `--print-build-logs`)
- internal-json (the internal machine-readable json format)
2020-06-08 09:31:15 +02:00
Ben Burdette
94c347577e
set verbosity levels
2020-06-07 07:24:49 -06:00
Tobias Pflug
e60747b5fb
Remove error-demo/error-demo.cc
...
The logging.hh superseeds the demo
2020-06-06 10:23:12 +02:00
Tobias Pflug
952e72c804
Add tests for logging.hh
2020-06-06 10:22:32 +02:00
Eelco Dolstra
9ef6048d78
diffLockFiles(): Fix assertion failure
...
There are some cases where this inequality didn't hold, in particular
due to the Input / TreeInfo merge, where we're not always showing
narHash.
2020-06-05 20:52:23 +02:00
Eelco Dolstra
d558fb98f6
Merge pull request #3656 from obsidiansystems/handle-unknown-file-ingestion
...
Add error message when FileIngestionMethod is out of bounds
2020-06-05 17:18:12 +02:00
Eelco Dolstra
488ff83e6b
Fix completion of --template
2020-06-05 14:09:12 +02:00
Eelco Dolstra
39e84c35d0
Fix log-prefix of nix build -L
...
Alternative fix to #3661 . The cause was that 'name' is a
std::string_view into a temporary which could get overwritten.
2020-06-05 10:45:05 +02:00
Eelco Dolstra
ef798f73ea
Merge pull request #3664 from obsidiansystems/gitignore-test-file
...
Add `src/libutil/tests/libutil-tests` to `.gitignore`
2020-06-05 10:18:42 +02:00
Carlo Nucera
d614166cb6
Fix condition error and make test suite pass
2020-06-04 17:21:21 -04:00
John Ericson
efc5e45e95
Add src/libutil/tests/libutil-tests to .gitignore
...
I gather this comes from the new unit tests.
2020-06-04 21:05:41 +00:00
John Ericson
e5cc1ebc5d
Merge remote-tracking branch 'upstream/master' into no-stringly-typed-derivation-output
2020-06-04 21:04:35 +00:00
John Ericson
a7b82fd006
Remove file which shouldn't be committed
2020-06-04 21:04:20 +00:00
John Ericson
94ddea9e2f
Use readString rather than >> temporary
...
Fixed the rest of these before, but this one slipped through.
2020-06-04 20:55:08 +00:00
John Ericson
744ce9ce16
Merge branch 'master' of github.com:NixOS/nix into validPathInfo-ca-proper-datatype
2020-06-04 20:46:58 +00:00
John Ericson
2041499b5e
Flip boolean
...
Thanks Matt!
2020-06-04 20:42:25 +00:00
John Ericson
ed86acf02a
Use some std::optional::has_value for clarity
2020-06-04 20:42:02 +00:00
John Ericson
574d5460f0
Make sure info.ca tag bit is set in nix add-to-store
2020-06-04 20:33:28 +00:00
Eelco Dolstra
ab54031e04
getDefaultUrl() -> value_or()
2020-06-04 20:24:28 +02:00
Eelco Dolstra
810b2c6a48
nix flake init: Add a '--template' flag
...
The initial contents of the flake is specified by the
'templates.<name>' or 'defaultTemplate' output of another flake. E.g.
outputs = { self }: {
templates = {
nixos-container = {
path = ./nixos-container;
description = "An example of a NixOS container";
};
};
};
allows
$ nix flake init -t templates#nixos-container
Also add a command 'nix flake new', which is identical to 'nix flake
init' except that it initializes a specified directory rather than the
current directory.
2020-06-04 20:22:25 +02:00
Ben Burdette
94427ffee3
add some comments
2020-06-04 11:53:19 -06:00
Matthew Bauer
2299ef705c
Add error message when FileIngestionMethod is out of bounds
...
bool coerces anything >0 to true, but in the future we may have other
file ingestion methods. This shows a better error message when the
“recursive” byte isn’t 1.
2020-06-04 11:32:39 -05:00
Eelco Dolstra
dc305500c3
Merge pull request #3660 from Kloenk/selfhost-gitlab
...
add support for selfhosted gitlab/github
2020-06-04 14:59:33 +02:00
Eelco Dolstra
d746ef4a81
Disable eval cache with --impure
...
Fixes
$ nix build nixpkgs#zoom-us
error: Package ‘zoom-us-5.0.399860.0429’ in /nix/store/m79v7h75b69fkk8d2qcwm555l3wq6fmv-source/pkgs/applications/networking/instant-messengers/zoom-us/default.nix:126 has an unfree license (‘unfree’), refusing to evaluate.
$ nix build nixpkgs#zoom-us --impure
error: cached failure of attribute 'legacyPackages.x86_64-linux.zoom-us.drvPath'
2020-06-04 14:53:51 +02:00
Finn Behrens
108debef6f
add support for selfhosted gitlab/github
2020-06-04 14:42:39 +02:00
Eelco Dolstra
959295cf4b
Fix completion script install name
2020-06-04 13:37:37 +02:00
Eelco Dolstra
f85606c431
Merge remote-tracking branch 'origin/master' into flakes
2020-06-04 13:16:28 +02:00
Eelco Dolstra
0f44b60e6d
Make 'nix dev-shell' a deprecated alias for 'nix develop'
2020-06-04 11:14:19 +02:00
Eelco Dolstra
61e3d598b6
Rename 'nix dev-shell' to 'nix develop'
...
Fixes #3648 .
2020-06-04 10:57:40 +02:00
John Ericson
53bc8ff152
No C++ designated initializers yet with Clang 7
2020-06-03 20:45:14 -04:00
Ben Burdette
721943e1d4
update error grep
2020-06-03 17:32:57 -06:00
Ben Burdette
4335ba999b
Merge remote-tracking branch 'upstream/master' into errors-phase-2
2020-06-03 17:00:00 -06:00
Ben Burdette
f97576c5d9
newline-as-prefix; no final newline in output.
2020-06-03 14:47:00 -06:00
Carlo Nucera
132d6f2c24
Clarify the description of StorePath construction
2020-06-03 16:08:32 -04:00
John Ericson
74b251b2f3
Don't anticipate multiple CA outputs for now
2020-06-03 18:53:04 +00:00
John Ericson
3a9e4c3262
Don't anticipate CA but not fixed outputs for now
2020-06-03 18:50:45 +00:00
John Ericson
2500403059
Use enum and predicates rather than bitfile for derivation type
2020-06-03 17:38:54 +00:00
John Ericson
6b7f4ec4ab
Merge remote-tracking branch 'upstream/master' into ca-drv
2020-06-03 16:36:06 +00:00
Eelco Dolstra
81cafda306
Fix GitHub test
2020-06-03 16:29:04 +02:00
Eelco Dolstra
c20591ddc3
Merge remote-tracking branch 'origin/master' into flakes
2020-06-03 16:15:22 +02:00
zimbatm
6ee03b8444
libutils/hash: remove default encoding
...
This will make it easier to reason about the hash encoding and switch to
SRI everywhere where possible.
2020-06-03 13:49:51 +02:00
John Ericson
01572c2198
Missing #include <cassert> in lru-cache.hh ( #3654 )
...
This was a latent bug that just appeared because of the tests that were
added. Remember to wait for CI! :)
2020-06-03 10:15:22 +00:00
John Ericson
3c78ac348c
Merge remote-tracking branch 'obsidian/no-hash-type-unknown' into validPathInfo-ca-proper-datatype
2020-06-03 04:44:24 +00:00
John Ericson
fecff16a6e
Merge remote-tracking branch 'obsidian/missing-include-0' into validPathInfo-ca-proper-datatype
2020-06-02 23:23:30 +00:00
John Ericson
39ba87be9b
Missing #include <cassert> in lru-cache.hh
...
This was a latent bug that just appeared because of the tests that were
added. Remember to wait for CI! :)
2020-06-02 21:36:53 +00:00
John Ericson
406dbb7fce
outputHashAlgo can be blank so parse accordingly
...
It is blank for SRI hashes.
2020-06-02 21:09:15 +00:00
John Ericson
1fcd3afc38
Fix hashes
2020-06-02 20:35:17 +00:00
Carlo Nucera
75d2581390
Typo
2020-06-02 16:21:18 -04:00
Carlo Nucera
78f137e931
Validate text version instead, throw Errors
2020-06-02 16:20:22 -04:00
Carlo Nucera
a5cdf1867e
Add assertions for SHA256 in fixed case
2020-06-02 16:13:08 -04:00
Carlo Nucera
fd2eb41e64
Move file-hash to content-address
2020-06-02 15:44:58 -04:00
Carlo Nucera
343c20a404
WIP Completed implementation
2020-06-02 15:23:21 -04:00
John Ericson
c664e68b87
Fix to-base --type handler to correctly set std::optional flag
...
Now that we have a separate flag function, also describe why it is
optional.
2020-06-02 18:25:32 +00:00
Carlo Nucera
390bf64858
WIP
2020-06-02 14:15:58 -04:00
John Ericson
c502119fd3
to-base supports parsing SRI hashes, so make type flag optional
2020-06-02 18:05:26 +00:00
John Ericson
a33270ce1d
Clean up ValidPathInfo::isContentAddressed with std::visit
2020-06-02 17:04:21 +00:00
John Ericson and Matthew Bauer
25e61812f3
Apply suggestions from code review
...
Co-authored-by: Matthew Bauer <mjbauer95@gmail.com >
2020-06-02 12:47:18 -04:00
John Ericson
d73dbc8e4c
Remove hashingWithUnknownAlgoExits
...
A valid hash type must be provided now. The hash itself can still be
invalid, but that doesn't cause an `abort()`.
2020-06-02 16:28:54 +00:00
John Ericson
64cffb804a
Merge remote-tracking branch 'upstream/master' into no-hash-type-unknown
2020-06-02 16:07:25 +00:00
John Ericson
450dcf2c1b
Remove HashType::Unknown
...
Instead, `Hash` uses `std::optional<HashType>`. In the future, we may
also make `Hash` itself require a known hash type, encoraging people to
use `std::optional<Hash>` instead.
2020-06-02 15:52:13 +00:00
Carlo Nucera
a5d820a0a3
Change parseCa(Opt) to parseContentAddress(Opt)
2020-06-02 11:00:10 -04:00
Ben Burdette
156d4f8bc8
remove extra space in SysErrors
2020-06-02 08:45:37 -06:00
John Ericson
1b6461f671
Merge remote-tracking branch 'upstream/master' into validPathInfo-ca-proper-datatype
2020-06-02 14:31:18 +00:00
Ben Burdette
d82d230b40
elide the 'ErrorInfo' in logError and logWarning calls
2020-06-02 08:22:24 -06:00
Eelco Dolstra
bfa1acd85c
Merge pull request #3639 from obsidiansystems/do-fixme-store-removes
...
Remove `addToStore` variant as requested by `FIXME`
2020-06-02 15:39:07 +02:00
Eelco Dolstra
c16fdda3a6
Merge branch 'lru-tests' of https://github.com/gilligan/nix
2020-06-02 12:07:48 +02:00
Eelco Dolstra and James Lee
e9fee8e6a7
src/libutil/tests/lru-cache.cc: Check erase()
...
Co-authored-by: James Lee <jbit@jbit.net >
2020-06-02 12:06:59 +02:00
Eelco Dolstra
0748a72a20
Merge pull request #3642 from knl/improve-ref-validity-checking-in-fetchgit
...
Improve ref validity checking in fetchgit
2020-06-02 12:00:24 +02:00
Eelco Dolstra
7dbba0a94e
Merge pull request #3645 from mkenigs/fetchOrSubstituteTree-improvements
...
Cache tree in fetchOrSubstituteTree
2020-06-02 11:58:20 +02:00
John Ericson
efcd30da89
WIP
2020-06-02 00:37:43 +00:00
John Ericson
754c910953
WIP more progress
2020-06-01 19:26:40 -04:00
Carlo Nucera
da39092a39
WIP
2020-06-01 18:53:31 -04:00
Carlo Nucera
0e9438b6d3
Create new file-hash files
2020-06-01 17:32:40 -04:00
Carlo Nucera
0cb67ecbd3
Merge branch 'derivation-header-include-order' of github.com:Ericson2314/nix into validPathInfo-ca-proper-datatype
2020-06-01 17:13:11 -04:00
Carlo Nucera
f4b89e11a4
Merge branch 'no-stringly-typed-derivation-output' of github.com:Ericson2314/nix into validPathInfo-ca-proper-datatype
2020-06-01 17:12:50 -04:00
Matthew Kenigsberg
c254254a80
use Tree ctor
2020-06-01 12:32:17 -06:00
Matthew Kenigsberg
7680993506
Tree ctors
2020-06-01 09:01:37 -06:00
Matthew Kenigsberg
ff1320b850
fetchOrSubstituteTree improvements
...
Caches tree in addition to lockedRef, and explicitly writes out the logic for different combinations of cached/uncached flakes and indirect/resolved/locked flakes. This eliminates uneccessary calls to lookupInFlakeCache, fetchTree, maybeLookupFlake, and flakeCache.push_back
2020-06-01 02:57:22 -06:00
Tobias Pflug
eca1ff7a9f
Add tests for lru-cache.hh
2020-05-31 01:05:05 +02:00
Nikola Knezevic
fb38459d6e
Ensure we restrict refspec interpretation while fetching
...
As `git fetch` may chose to interpret refspec to it's liking, ensure that we
only pass refs that begin with `refs/` as is, otherwise, prepend them with
`refs/heads`. Otherwise, branches named `heads/foo` (I know it's bad, but it's
allowed), would be fetched as `foo`, instead of `heads/foo`.
2020-05-30 12:33:38 +02:00
Nikola Knezevic
77007d4eab
Improve ref validity checking in fetchGit
...
The previous regex was too strict and did not match what git was allowing. It
could lead to `fetchGit` not accepting valid branch names, even though they
exist in a repository (for example, branch names containing `/`, which are
pretty standard, like `release/1.0` branches).
The new regex defines what a branch name should **NOT** contain. It takes the
definitions from `refs.c` in https://github.com/git/git and `git help
check-ref-format` pages.
This change also introduces a test for ref name validity checking, which
compares the result from Nix with the result of `git check-ref-format --branch`.
2020-05-30 12:29:35 +02:00
Eelco Dolstra
89e0b3e2d6
Move substitution into Input::fetch()
...
Closes #3520 .
2020-05-30 01:16:53 +02:00
Eelco Dolstra
0e7f77a59a
Check revCount / lastModified input attributes if specified
2020-05-30 00:59:13 +02:00
Eelco Dolstra
950b46821f
Remove TreeInfo
...
The attributes previously stored in TreeInfo (narHash, revCount,
lastModified) are now stored in Input. This makes it less arbitrary
what attributes are stored where.
As a result, the lock file format has changed. An entry like
"info": {
"lastModified": 1585405475,
"narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE="
},
"locked": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be",
"type": "github"
},
is now stored as
"locked": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b88ff468e9850410070d4e0ccd68c7011f15b2be",
"type": "github",
"lastModified": 1585405475,
"narHash": "sha256-bESW0n4KgPmZ0luxvwJ+UyATrC6iIltVCsGdLiphVeE="
},
The 'Input' class is now a dumb set of attributes. All the fetcher
implementations subclass InputScheme, not Input. This simplifies the
API.
Also, fix substitution of flake inputs. This was broken since lazy
flake fetching started using fetchTree internally.
2020-05-30 00:44:11 +02:00
John Ericson
fac0c2d54a
Remove addToStore variant as requested by FIXME
...
The idea is it's always more flexible to consumer a `Source` than a
plain string, and it might even reduce memory consumption.
I also looked at `addToStoreFromDump` with its `// FIXME: remove?`, but
the worked needed for that is far more up for interpretation, so I
punted for now.
2020-05-29 17:02:32 -04:00
Ben Burdette
734283d636
Merge remote-tracking branch 'upstream/master' into errors-phase-2
2020-05-29 09:51:37 -06:00
Eelco Dolstra
5633c0975b
Factor out GitHub / GitLab commonality
2020-05-29 14:23:32 +02:00
Eelco Dolstra
56f9abffbe
Merge branch 'gitlab' of https://github.com/Kloenk/nixos-nix into flakes
2020-05-29 13:55:21 +02:00
Finn Behrens
5256bc77ca
add gitlab libfetcher
2020-05-28 23:00:08 +02:00
Carlo Nucera
6dd471ebf6
Fixing the result of merge
2020-05-28 12:14:36 -04:00
Carlo Nucera
4f597fb901
Merge branch 'master' of github.com:NixOS/nix into enum-class
2020-05-28 10:58:22 -04:00
John Ericson
5b4cd84bc2
Merge remote-tracking branch 'me/more-rust-ffi' into no-stringly-typed-derivation-output
2020-05-28 10:35:53 -04:00
John Ericson
ef71caba29
Merge remote-tracking branch 'upstream/master' into more-rust-ffi
2020-05-28 10:31:46 -04:00
Eelco Dolstra
f60ce4fa20
Merge pull request #3631 from andir/libutil-config-tests
...
Add unit tests for config.cc
2020-05-28 13:51:37 +02:00
Eelco Dolstra
de141fcb79
Merge pull request #3455 from Ericson2314/enum-FileIngestionMethod
...
Replace some `bool recursive` with a new `FileIngestionMethod` enum
2020-05-28 13:50:06 +02:00
Eelco Dolstra
17ca997fc6
Merge remote-tracking branch 'origin/master' into flakes
2020-05-28 12:55:24 +02:00
Eelco Dolstra
c3eff22f46
Merge branch 'store-visited' of https://github.com/mkenigs/nix into flakes
2020-05-28 12:15:39 +02:00
Eelco Dolstra
6286272371
nixpkgsFlakeRef(): Use locked nixpkgs
2020-05-28 12:13:13 +02:00
Eelco Dolstra
04fb4e8a0f
Merge branch 'nixpkgs#bashInteractive' of https://github.com/mkenigs/nix into flakes
2020-05-28 11:59:54 +02:00
Eelco Dolstra
d2a537568a
Merge pull request #3632 from LnL7/darwin-xz
...
installer: don't require xz on darwin
2020-05-28 11:19:17 +02:00
John Ericson
0f96f45061
Use FileIngestionMethod for nix hash
...
There was an enum there that matched in perfectly.
2020-05-27 23:50:11 -04:00
Daiderd Jordan
4e6d7cb55a
installer: don't require xz on darwin
...
On macOS the system tar has builtin support for lzma while xz isn't
available as a separate binary. There's no builtin package manager
there available either so having to install lzma (without nix) would be
rather painful.
2020-05-27 20:58:42 +02:00
Matthew Bauer
c66441a646
Rename some variables named “recursive” to “method”
...
This is much less confusing since recursive is no longer a boolean.
2020-05-27 13:21:26 -05:00
Matthew Bauer
7873fd175d
Don’t use FileIngestionMethod for StorePathsCommand
...
This is a different recursive than used in makeFixedOutputPath.
2020-05-27 13:21:11 -05:00
Andreas Rammhold
fc137d2f00
config.hh: Add documentation
...
Provides some general overview on the mechanics of Config/Setting and
comments for the public methods of Config.
2020-05-27 17:47:18 +02:00
Andreas Rammhold
9df3d8ccd7
tests/config.cc: add tests for Config::applyConfig
2020-05-27 17:47:18 +02:00
Andreas Rammhold
e1b8c64c04
config.cc: extract parts of applyConfigFile into applyConfig
...
This moves the actual parsing of configuration contents into applyConfig
which applyConfigFile is then going to call. By changing this we can now
test the configuration file parsing without actually create a file on
disk.
2020-05-27 17:47:18 +02:00
Andreas Rammhold
93129cf1dd
Add unit tests for config.cc
2020-05-27 17:47:17 +02:00
Eelco Dolstra
228857efc6
Merge pull request #3608 from surajbarkale/patch-1
...
Use /etc/zshenv instead of /etc/zshrc for profile
2020-05-27 11:10:08 +02:00
Eelco Dolstra
66d3ac94c9
Merge pull request #3621 from gilligan/add-json-tests
...
Add unit tests for "json.hh"
2020-05-27 11:08:12 +02:00
Eelco Dolstra
dae6a267a8
Merge pull request #3625 from gilligan/xml-writer-tests
...
Add unit tests for xml-writer
2020-05-27 11:07:53 +02:00
Eelco Dolstra
a4701e2b9e
Merge pull request #3620 from gilligan/hash-tests
...
Add unit tests for hashing functions
2020-05-27 11:07:20 +02:00
Carlo Nucera
f3f520c14c
Change syntax for CI
2020-05-26 12:51:28 -04:00
Carlo Nucera
89a5ac9d3b
Merge remote-tracking branch 'john-ericson/more-rust-ffi' into no-stringly-typed-derivation-output
2020-05-26 12:31:26 -04:00
Carlo Nucera
d49e65ba9d
Merge remote-tracking branch 'john-ericson/enum-FileIngestionMethod' into no-stringly-typed-derivation-output
2020-05-26 12:30:48 -04:00
Carlo Nucera
0f3f901071
Merge remote-tracking branch 'origin/master' into more-rust-ffi
2020-05-26 11:46:42 -04:00
Carlo Nucera and Cole Helbling
c2f33edd1f
Update src/libutil/rust-ffi.hh
...
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com >
2020-05-26 11:43:18 -04:00
Carlo Nucera
b90241ceb1
Change remaining bools with FileIngestionMethod
2020-05-26 11:32:41 -04:00
Carlo Nucera
6d73c10041
Merge remote-tracking branch 'origin/master' into enum-FileIngestionMethod
2020-05-26 11:14:08 -04:00
Domen Kožar
3d3c219d91
installer: fix unused variable
2020-05-26 16:23:03 +02:00
Domen Kožar
1a5ac894e9
Fix installer script bugs
...
- --no-channel-add didn't have effect on multi-user installation
- some new flags didn't work at all
- document all installer flags
2020-05-26 15:49:26 +02:00
Lucas Franceschino
b2748c6e99
Make functionArgs primitive accept primops
2020-05-25 19:07:38 +02:00
Tobias Pflug
4b388e8431
Add unit tests for xml-writer
2020-05-25 18:34:55 +02:00
Domen Kožar
909bdfb4b4
Merge pull request #3375 from domenkozar/multi-user-count
...
install-multi-user: allow overriding user count
2020-05-25 17:53:24 +02:00
Domen Kožar
fcf85203cf
Merge pull request #3623 from domenkozar/installer-pass-nix-conf
...
Allow passing extra nix.conf to installer
2020-05-25 17:52:58 +02:00
Domen Kožar
573ff8dfca
Allow passing extra nix.conf to installer
2020-05-25 17:31:46 +02:00
Domen Kožar
90b0c630a0
install-multi-user: allow overriding user count
2020-05-25 17:16:38 +02:00
Tobias Pflug
c284700867
Add unit tests for "json.hh"
2020-05-25 11:57:45 +02:00
Tobias Pflug
ecc5c90dfc
Add unit tests for hashing functions
2020-05-25 11:50:41 +02:00
Domen Kožar
81a0731e05
Merge pull request #3611 from nomeata/joachim/nix-env-man
...
Manpages: Do not refer to nixpkgs-channels
2020-05-23 16:40:57 +02:00
Domen Kožar
8351d36b21
Merge pull request #3610 from LnL7/hydra-build-products
...
fix hydra build products
2020-05-23 16:39:35 +02:00
Joachim Breitner
e2af11ce07
Manpages: Do not refer to nixpkgs-channels
...
Unless I am misinformed, using the `nixpkgs` repository directly is now
preferred?
2020-05-23 15:26:59 +02:00
Daiderd Jordan
6f6bdd63a0
fix hydra build products
...
Since the binary tarball was replaced none of the hydra builds include
the manual. The dist phase isn't enabled by default the manual build
products where not written.
2020-05-23 12:43:54 +02:00
Domen Kožar
c129e7c8f4
Merge pull request #3212 from LnL7/darwin-10.15-install
...
install: configure and bootstrap synthetic.conf on darwin
2020-05-23 11:15:31 +02:00
Domen Kožar
2a7ea2eb6c
scripts/create-darwin-volume.sh: remove unused variable
2020-05-23 11:12:05 +02:00
Eelco Dolstra
604c5208c5
Merge pull request #3606 from tweag/unquoted-urls
...
documentation: avoid unquoted URLs
2020-05-22 09:49:22 +02:00
Suraj Barkale
909d8cb293
Use /etc/zshenv instead of /etc/zshrc for profile
...
As noted in https://github.com/NixOS/nix/issues/3456 the `/etc/zshenv` file provides a better place for sourcing the nix environment.
2020-05-22 11:05:25 +10:00
Matthew Kenigsberg
934cc802f3
circular test
2020-05-21 17:06:19 -06:00
Matthew Kenigsberg
8d67794da1
handle circular flake dependencies in list-inputs
2020-05-21 17:06:11 -06:00
Ben Burdette
b7057fa627
remove error-demo from make; clean up comment
2020-05-21 16:04:18 -06:00
Ben Burdette
0e49de6a2b
position for stdin, string; (string) for trace; fix tests
2020-05-21 14:28:45 -06:00
Eelco Dolstra
00b562c87e
Fix GitHub test
2020-05-21 22:02:34 +02:00
Daiderd Jordan
d3df1889a1
installer: don't clobber synthetic.conf
2020-05-21 20:03:09 +02:00
Travis A. Everett
2b0a81d92d
focus on golden-path covering most scenarios
...
This should handle installation scenarios we can handle with
anything resembling confidence. Goal is approximating the existing
setup--not enforcing a best-practice...
Approaches (+ installer-handled, - manual) and configs each covers:
+ no change needed; /nix OK on boot volume:
All pre-Catalina (regardless of T2 or FileVault use)
+ create new unencrypted volume:
Catalina, pre-T2, no FileVault
+ create new encrypted-at-rest volume:
Catalina, pre-T2, FileVault
Catalina, T2, no FileVault
- require user to pre-create encrypted volume
Catalina, T2, FileVault
2020-05-21 19:58:11 +02:00
Daiderd Jordan
477d7c2d07
installer: refuse apfs volume creation when FileVault is enabled
2020-05-21 19:58:11 +02:00
Daiderd Jordan
3386575296
manual: clarify volume creation section
2020-05-21 19:58:11 +02:00
Daiderd Jordan
bc24c09968
install: make synthetic.conf and fstab checks stricter
2020-05-21 19:58:11 +02:00
Daiderd Jordan
04f597c3f4
install: improve output and error handling
2020-05-21 19:58:11 +02:00
Daiderd Jordan
caface1980
install: hide the store volume on darwin
2020-05-21 19:58:11 +02:00
Daiderd Jordan
ee89b7797d
manual: add apfs volume section
2020-05-21 19:58:11 +02:00
Daiderd Jordan
083bb3bbfc
install: show macOS 10.15 message with --daemon
2020-05-21 19:58:10 +02:00
Daiderd Jordan
10202628b9
install: also configure ~/.zshenv
...
The default login shell for users on macOS 10.15 changed from bash to
zsh. So while generally nonstandard we need to configure it to make nix
function out of the box on macOS.
2020-05-21 19:58:10 +02:00
Daiderd Jordan
0726ad5825
install: configure and bootstrap synthetic.conf on darwin
...
Starting macOS 10.15 /nix can't be creasted directly anymore due to the
readonly filesystem, but synthetic.conf was introduced to enable
creating mountpoints or symlinks for special usecases like package
managers.
2020-05-21 19:58:10 +02:00
Krzysztof Gogolewski
c8cb558849
documentation: avoid unquoted URLs
2020-05-21 19:29:13 +02:00
Ben Burdette
6a420d672c
print LOC for stdin, string args
2020-05-20 22:18:26 -06:00
Ben Burdette
85ce455b85
get code lines from the nix file
2020-05-20 17:25:02 -06:00
Eelco Dolstra
5d2d0a7b7f
Merge pull request #3603 from gilligan/url-tests
...
Add unit testes for url.cc
2020-05-20 22:07:51 +02:00
Tobias Pflug
a73a820a5d
Add unit testes for url.cc
...
This adds tests for
- parseURL
- percentDecode
- decodeQuery
2020-05-20 16:37:35 +02:00
Eelco Dolstra
5ef64f05e6
Cleanup
2020-05-18 15:50:29 +02:00
Eelco Dolstra
0ed946aa61
Merge branch 'wait-for-builders' of https://github.com/serokell/nix
2020-05-18 13:48:45 +02:00
Eelco Dolstra
2e16186a99
Merge pull request #3592 from Mic92/doc-fixes
...
Remove -j option from simple-build-testing
2020-05-18 09:31:22 +02:00
Matthew Kenigsberg
c4beded32e
rm includes
2020-05-16 11:19:41 -06:00
Matthew Kenigsberg
ba7d7ed2e3
Create bashInteractive InstallableFlake
2020-05-16 11:03:06 -06:00
Matthew Kenigsberg
0858793604
Call lockFlake once and store in _lockedFlake
2020-05-16 11:03:06 -06:00
Matthew Kenigsberg
04821bc171
use flake's nixpkgs to find bashInteractive
2020-05-16 11:03:06 -06:00
Matthew Kenigsberg
8fbc8540d3
use nixpkgs#bashInteractive for dev-shell
2020-05-16 11:03:06 -06:00
Jörg Thalheim
e223eeac09
Remove -j option from simple-build-testing
...
By default Nix/NixOS already set a reasonable default `max-jobs = auto`
so we don't need to mention it in this tutorial.
The option is still documented in other parts of the documentation
if users ever stumble over this.
Fixes https://github.com/NixOS/nix/issues/2531
2020-05-16 08:45:19 +01:00
Ben Burdette
92123c6c79
Merge remote-tracking branch 'upstream/master' into errors-phase-2
2020-05-15 07:00:36 -06:00
Eelco Dolstra
5f64655ff4
Move registry-related commands from 'nix flake' to 'nix registry'
...
This makes 'nix flake' less cluttered and more consistent (it's only
subcommands that operator on a flake). Also, the registry is not
inherently flake-related (e.g. fetchTree could also use it to remap
inputs).
2020-05-15 14:38:10 +02:00
Domen Kožar
546b179d0a
actions: use latest OS
2020-05-15 10:06:26 +02:00
Ben Burdette
19694aa213
fix compile errors
2020-05-14 12:28:18 -06:00
Ben Burdette
4daccb279c
formatting
2020-05-14 10:28:17 -06:00
Alexander Bantyev
183dd28266
Don't lock a user while doing remote builds
2020-05-14 17:00:54 +03:00
Ben Burdette
ef9dd9f9bc
formatting and a few minor changes
2020-05-13 15:56:39 -06:00
Ben Burdette
d44bac1d92
remove error-demo from Makefile again
2020-05-13 12:39:45 -06:00
Ben Burdette
c79d4addab
consistent capitalization
2020-05-13 10:02:18 -06:00
Ben Burdette
bfca5fc395
change status messages to info level
2020-05-13 09:52:36 -06:00
Eelco Dolstra
ecd4e52a58
Merge pull request #3588 from prusnak/nix-skip-channel-add
...
Introduce NIX_INSTALLER_NO_CHANNEL_ADD which skips nix-channel --add
2020-05-13 10:43:39 +02:00
Eelco Dolstra and Jörg Thalheim
849d3968db
Update src/libfetchers/git.cc
...
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com >
2020-05-13 10:41:21 +02:00
Ben Burdette
ecbb8e9c0a
no blank line if no LOC
2020-05-12 14:41:30 -06:00
Ben Burdette
960d4362ed
hint only
2020-05-12 13:54:18 -06:00
Ben Burdette
72ecccee57
convert to logWarning format
2020-05-12 12:19:34 -06:00
Ben Burdette
d608793e4f
remove uncrustify cfg
2020-05-12 12:09:57 -06:00
Ben Burdette
19cffc29c9
remove unused extra json fields
2020-05-12 12:09:12 -06:00
Ben Burdette
2a19bf8619
move pos to the first arg, to indicate its not used in a fmt template
2020-05-12 11:27:37 -06:00
Pavol Rusnak
9e12b2f5b8
Expose installer configuration environment variables via command line flags
2020-05-12 19:00:45 +02:00
Ben Burdette
ec870b9c85
new pos format for more errors
2020-05-12 10:52:26 -06:00
Eelco Dolstra
215f09d765
Merge pull request #3587 from NixOS/bash-completion
...
Generic shell completion support for the 'nix' command
2020-05-12 18:26:13 +02:00
Eelco Dolstra
fbade0b7cc
Merge pull request #3583 from mkenigs/InstallablesRefactor
...
Installables refactor
2020-05-12 17:51:34 +02:00
Eelco Dolstra
ebc024df22
Show hint how to enable experimental features
2020-05-12 15:47:09 +02:00
Eelco Dolstra
268ecf5b3f
nix: Don't require --experimental-features=nix-command for some subcommands
2020-05-12 15:47:09 +02:00
Eelco Dolstra
5722f9690c
tests/binary-cache.sh: Improve incomplete closure test
...
Issue #3373 .
2020-05-12 13:56:00 +02:00
Pavol Rusnak
46be11b762
Introduce NIX_INSTALLER_NO_CHANNEL_ADD which skips nix-channel --add
2020-05-12 12:13:40 +02:00
Ben Burdette
7c3138844c
more pos reporting
2020-05-11 17:34:57 -06:00
Ben Burdette
631642c5b4
new format for pos
2020-05-11 16:58:08 -06:00
Ben Burdette
b93c1bf3d6
fixes to merged code
2020-05-11 15:52:15 -06:00
Ben Burdette
59b1f5c701
Merge branch 'master' into errors-phase-2
2020-05-11 14:35:30 -06:00
Ben Burdette
536bbf53e1
comments and cleanup
2020-05-11 13:58:38 -06:00
Ben Burdette
958e81987b
switch from printError warnings to logWarnings
2020-05-11 13:02:16 -06:00
Domen Kožar
5bdb67c843
Merge pull request #3568 from kolloch/outputHashModeError
...
libstore/build.cc: more explicit error about form of output
2020-05-11 18:14:32 +02:00
Domen Kožar
1d8144e36b
Update src/libstore/build.cc
2020-05-11 18:14:23 +02:00
Domen Kožar
23e5b48ca4
Merge pull request #3581 from TerrorJack/patch-1
...
Update "Upgrading Nix" documentation
2020-05-11 18:12:35 +02:00
Domen Kožar
612d57c5de
Merge pull request #3582 from bhipple/doc/fixed-output
...
doc: consistently refer to 'fixed-output' with a dash
2020-05-11 18:10:19 +02:00
Matthew Kenigsberg
73ee1afffe
Reorder to build
...
This reverts commit 883948d7a0add742ccae58e9845d769a8064371c.
2020-05-09 14:42:32 -06:00
Matthew Kenigsberg
9f4cfbb2e7
Refactor installables
...
InstallableValue has children InstallableFlake and InstallableAttrPath, but InstallableFlake was overriding toDerivations, and usage was changed so that InstallableFlake didn't need cmd. So these changes were made:
InstallableValue::toDerivations() -> InstalllableAttrPath::toDerivations()
InstallableValue::cmd -> InstallableAttrPath::cmd
InstallableValue uses state instead of cmd
toBuildables() and toDerivations() were made abstract
2020-05-09 14:42:32 -06:00
Domen Kožar
b92f58f6d9
Merge pull request #3580 from dmedinag/patch-1
...
Fix typo
2020-05-09 22:02:32 +02:00
Matthew Kenigsberg
bf81dd40e9
InstallableExpr unused
2020-05-09 10:16:00 -06:00
Benjamin Hipple
146f9c114f
doc: consistently refer to 'fixed-output' with a dash
...
General cleanup that makes it easier to search for the term.
2020-05-09 10:58:43 -04:00
Shao Cheng
446649e540
Update "Upgrading Nix" documentation
...
This PR proposes two changes to the "Upgrading Nix" documentation:
* Besides updating `nixpkgs.nix`, we also update `nixpkgs.cacert`, so that the certificates are up-to-date as well.
* Add the instructions for multi-user mode on Linux.
2020-05-09 15:59:39 +02:00
Dani
52cffafd24
Fix typo
2020-05-09 13:48:31 +02:00
Ben Burdette
55eb717148
add pos to errorinfo, remove from hints
2020-05-08 18:18:28 -06:00
Eelco Dolstra
d3d8186c9c
Merge pull request #3571 from gilligan/nix-unit-testing
...
Add unit tests
2020-05-08 17:02:25 +02:00
Tobias Pflug
181a47d884
Enable toLower umlauts test
...
Update comment and enable the test
2020-05-08 15:13:55 +02:00
Tobias Pflug
2191141274
Enable baseNameOf test
...
Add note about removal of trailing slashes in the doc comment of
baseNameOf and enabled the test.
2020-05-08 15:07:40 +02:00
Tobias Pflug
e3df9c2a6e
Enable dirOf test
...
Adjusted the doc comment for `dirOf` to reflect the implementation
behavior.
2020-05-08 15:03:44 +02:00
Eelco Dolstra
5b8883faac
configure: Look for gtest
2020-05-08 12:09:37 +02:00
Eelco Dolstra
ca657525b8
Don't install unit tests
2020-05-08 12:03:27 +02:00
Eelco Dolstra
7898cdb75a
make check: Run unit tests
2020-05-08 11:49:40 +02:00
Eelco Dolstra
72b9d971bc
Fix warning
2020-05-08 11:35:57 +02:00
Eelco Dolstra
7cc7cef950
Move unit tests to sr/libutil/tests, use mk make rules
2020-05-08 11:34:09 +02:00
Alexander Bantyev
772e5db828
Mention build users in the 'waiting for' message
2020-05-08 12:29:00 +03:00
Alexander Bantyev
14073fb76b
Don't block while waiting for build users
2020-05-08 12:22:39 +03:00
Ben Burdette
1b801cec40
pretending to be const
2020-05-07 16:43:36 -06:00
Tobias Pflug
73d0b5d807
Drop unnecessary std::string
2020-05-07 19:29:10 +02:00
Tobias Pflug
1f3602a2c9
Remove replaceInSet
...
The function isn't being used anywhere so it seems safe to remove
2020-05-07 18:15:13 +02:00
Tobias Pflug
987b3d6469
Use ASSERT_EQ instead of ASSERT_STREQ
...
No need to use `c_str()` in combination with `ASSERT_STREQ`.
It's possible to just use ASSERT_EQ on std::string
2020-05-07 18:10:07 +02:00
Eelco Dolstra
41caaaad36
Manual: Typo
2020-05-07 16:37:33 +02:00
Eelco Dolstra
479e8bf00b
Manual: Fix typo
2020-05-07 16:08:15 +02:00
Ben Burdette
e3901638b5
todo removal
2020-05-06 15:01:13 -06:00
Ben Burdette
e76ad2e48a
implement SysError errno handling
2020-05-06 14:07:20 -06:00
Tobias Pflug
58ed1e6d68
WIP: add unit tests for libutil
...
This is a proof on concept to evaluate writing unit tests for Nix using
google test (https://github.com/google/googletest ).
In order to execute tests:
$ make unit-tests
$ ./unit-tests
The Makefile rules for `unit-tests` is a complete hack.
2020-05-06 15:57:05 +02:00
Peter Kolloch
9be46859a9
libstore/build.cc: more explicit about form of output
...
Be more explicit about why we expect a regular file as output
when outputHashMode=flat for a fixed output derivation.
2020-05-06 11:21:12 +02:00
Alexander Bantyev
04967dee9d
Wait for build users when none are available
2020-05-05 13:04:36 +03:00
Ben Burdette
7ffb5efdbc
appending to hints; remove _printError
2020-05-04 16:19:57 -06:00
Ben Burdette
f30de61578
add normaltxt, yellowify->yellowtxt
2020-05-04 16:19:20 -06:00
Ben Burdette
8c8f2b74ec
log as warning
2020-05-04 14:44:42 -06:00
Ben Burdette
afaa541013
affinity operator<<
2020-05-04 14:44:00 -06:00
Ben Burdette
9c5ece44a7
separate msgs instead of appending to what()
2020-05-04 13:46:15 -06:00
Ben Burdette
c05f0e3093
closer but still lambda indent problems
2020-05-04 12:28:28 -06:00
Ben Burdette
ab6f0b9641
convert some printError calls to logError
2020-05-03 08:01:25 -06:00
Ben Burdette
4b99c09f5c
convert some errors
2020-05-01 14:32:06 -06:00
Ben Burdette
a3030e3c31
fix error calls
2020-04-30 17:56:26 -06:00
Ben Burdette
f5d3215c87
logError
2020-04-30 16:31:47 -06:00
Ben Burdette
171b4ce85c
typo
2020-04-30 09:57:01 -06:00
Ben Burdette
39ff80d031
errorinfo constructor test
2020-04-29 18:57:05 -06:00
Ben Burdette
2d0f766a77
more style tweaks
2020-04-29 11:52:35 -06:00
Ben Burdette
e2f61263eb
uncrustify formatting
2020-04-29 10:14:32 -06:00
Ben Burdette
22e6490311
Error classname as name
2020-04-28 21:06:08 -06:00
Ben Burdette
e51a757720
astyle format
2020-04-27 15:15:08 -06:00
Ben Burdette
1ff42722ce
error.hh
2020-04-26 14:47:41 -06:00
Ben Burdette
d4fd7b543e
print dashes instead of empty name string
2020-04-25 12:05:26 -06:00
Ben Burdette
cdac083dc5
don't print blank lines for blank description
2020-04-24 21:40:13 -06:00
Ben Burdette
d8d4844b88
all things error to error.hh
2020-04-24 14:57:51 -06:00
Ben Burdette
d9632765a8
add has_value check; remove obslete friend class
2020-04-24 12:44:23 -06:00
Ben Burdette
833501f6f1
'what' string
2020-04-23 15:55:34 -06:00
Ben Burdette
3bc9155dfc
a few more 'format's rremoved
2020-04-22 15:00:11 -06:00
Ben Burdette
e4fb9a3849
remove 'format' from Error constructor calls
2020-04-21 17:07:07 -06:00
Ben Burdette
d3052197fe
add ErrorInfo to BaseError
2020-04-21 13:25:41 -06:00
Ben Burdette
15e9564fd1
logEI for tunnelLogger and progressbar
2020-04-19 17:16:51 -06:00
Ben Burdette
4697552948
demoing other error levels than warn/error; rename line and file fields in errPos
2020-04-17 15:50:46 -06:00
Ben Burdette
3d5b1032a1
logError, logWarning; Logger functions; switch to Verbosity enum
2020-04-17 15:07:44 -06:00
John Ericson
8aa46cd340
Get rid of FileIngestionMethod casts in perl bindings, too
2020-03-30 22:40:41 +00:00
John Ericson
7e9a2718f0
s/outputHashRecursive/ingestionMethod/c
2020-03-30 22:36:15 +00:00
John Ericson
51afea3af2
Never cast FileIngestionMethod to or from boolean
2020-03-30 22:31:51 +00:00
John Ericson
c251b011cd
Merge remote-tracking branch 'upstream/master' into enum-FileIngestionMethod
2020-03-30 18:16:44 -04:00
John Ericson
bbbb7c1bc7
Use auto with some FileIngestionMethod local variables
2020-03-30 18:15:55 -04:00
John Ericson
832bd534dc
Store parsed hashes in DerivationOutput
...
It's best to detect invalid data as soon as possible, with data types
that make storing it impossible.
2020-03-30 11:33:35 -04:00
John Ericson
f5494d9442
Merge remote-tracking branch 'me/enum-FileIngestionMethod' into HEAD
2020-03-30 11:08:13 -04:00
John Ericson
225e62a56a
Replace some bool recursive with a new FileIngestionMethod enum
2020-03-29 15:16:20 -04:00
John Ericson
87b32bab05
Use enum struct and drop prefixes
...
This does a few enums; the rest will be gotten in subsequent commits.
2020-03-29 11:23:15 -04:00
John Ericson
e433d4af4c
Extend Rust FFI
...
Do idiomatic C++ copy and move constructors for a few things, so
wrapping structs' defaults can work.
2020-03-25 16:12:14 -04:00
John Ericson
bcde5456cc
Flip dependency so store-api.hh includes derivations.hh
...
I think it makes more sense to define the data model (derivations),
before the operations (store api).
2020-03-24 20:39:45 +00:00
John Ericson
e317324236
Apply suggestions from code review
2020-03-19 23:38:51 -04:00
John Ericson and Cole Helbling
d5b3328dd1
Apply suggestions from code review
...
Co-Authored-By: Cole Helbling <cole.e.helbling@outlook.com >
2020-03-19 23:37:52 -04:00
John Ericson
f1cf3ab870
hashDerivationModulo: Generalize for multiple fixed ouputs per drv
...
See documentattion in header and comments in implementation for details.
This is actually done in preparation for floating ca derivations, not
multi-output fixed ca derivations, but the distinction doesn't yet
mattter.
Thanks @cole-h for finding and fixing a bunch of typos.
2020-03-19 10:30:49 -04:00
John Ericson and asymmetric
049179ba07
Fix typos
...
Thanks @asymmetric
I failed to do them all in one batch
Co-Authored-By: asymmetric <lorenzo@mailbox.org >
2020-03-18 19:07:05 -04:00
John Ericson and asymmetric
e5178fd22d
Fix typos
...
Thanks @asymmetric!
Co-Authored-By: asymmetric <lorenzo@mailbox.org >
2020-03-16 16:40:13 -04:00
John Ericson
2be64efb02
Generalize isFixedOutput in preparation for CA drvs
...
Today's fixed output derivations and regular derivations differ in a few
ways which are largely orthogonal. This replaces `isFixedOutput` with a
`type` that returns an enum of possible combinations.
2020-03-15 11:05:37 -04:00