Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
remote-store: don't log raw stderr by default
|
|
The raw stderr output isn't logged anymore so the build logs need to be
printed by the default logger in order for the old commands like
nix-build to still show build output.
|
|
For remote stores the log messages are already forwarded as structured
STDERR_RESULT messages so the old format is duplicate information. But
still included with -vvv since it could be useful for debugging
problems.
$ nix build -L /nix/store/nl71b2niws857ffiaggyrkjwgx9jjzc0-foo.drv --store ssh-ng://localhost
Hello World!
foo> Hello World!
[1/0/1 built] building foo
Fixes #3556
|
|
|
|
(cherry picked from commit f459ca547fda4b0ca477d895413e86b69a580ab0)
|
|
(cherry picked from commit 5d8504b9789ffebabe8226227c4061dd48354177)
|
|
(cherry picked from commit bc5d4843a916dc4f99516e187a63108e8006f81f)
|
|
|
|
Revamp README.md
|
|
|
|
Co-authored-by: worldofpeace <worldofpeace@protonmail.ch>
|
|
Co-authored-by: worldofpeace <worldofpeace@protonmail.ch>
|
|
|
|
|
|
|
|
This avoids inheriting the caller's shellHook, which can happen when
running a dev-shell inside a dev-shell.
|
|
Tested against https://github.com/NixOS/nixpkgs/pull/72074.
Fixes #3540.
|
|
|
|
Fix displaying error-position in `builtins.fetch{Tree,Tarball}`
|
|
Without dereferencing this pointer, you'd get an error like this:
```
error: unsupported argument 'abc' to 'fetchTarball', at 0x13627e8
```
|
|
Only call grantpt on MacOS systems
|
|
The commit 3cc1125595d97b4ab7369e37e4ad22f4cfecb8b2 adds a `grantpt`
call on the builder pseudo terminal fd. This call is actually only
required for MacOS, but it however requires a RW access to /dev/pts
which is only RO bindmounted in the Bazel Linux sandbox. So, Nix can
not be actually run in the Bazel Linux sandbox for unneeded reasons.
|
|
Set GCROOT to store path to prevent garbage collection
|
|
|
|
|
|
|
|
Fix long paths permanently breaking GC
|
|
Suppose I have a path /nix/store/[hash]-[name]/a/a/a/a/a/[...]/a,
long enough that everything after "/nix/store/" is longer than 4096
(MAX_PATH) bytes.
Nix will happily allow such a path to be inserted into the store,
because it doesn't look at all the nested structure. It just cares
about the /nix/store/[hash]-[name] part. But, when the path is deleted,
we encounter a problem. Nix will move the path to /nix/store/trash, but
then when it's trying to recursively delete the trash directory, it will
at some point try to unlink
/nix/store/trash/[hash]-[name]/a/a/a/a/a/[...]/a. This will fail,
because the path is too long. After this has failed, any store deletion
operation will never work again, because Nix needs to delete the trash
directory before recreating it to move new things to it. (I assume this
is because otherwise a path being deleted could already exist in the
trash, and then moving it would fail.)
This means that if I can trick somebody into just fetching a tarball
containing a path of the right length, they won't be able to delete
store paths or garbage collect ever again, until the offending path is
manually removed from /nix/store/trash. (And even fixing this manually
is quite difficult if you don't understand the issue, because the
absolute path that Nix says it failed to remove is also too long for
rm(1).)
This patch fixes the issue by making Nix's recursive delete operation
use unlinkat(2). This function takes a relative path and a directory
file descriptor. We ensure that the relative path is always just the
name of the directory entry, and therefore its length will never exceed
255 bytes. This means that it will never even come close to AX_PATH,
and Nix will therefore be able to handle removing arbitrarily deep
directory hierachies.
Since the directory file descriptor is used for recursion after being
used in readDirectory, I made a variant of readDirectory that takes an
already open directory stream, to avoid the directory being opened
multiple times. As we have seen from this issue, the less we have to
interact with paths, the better, and so it's good to reuse file
descriptors where possible.
I left _deletePath as succeeding even if the parent directory doesn't
exist, even though that feels wrong to me, because without that early
return, the linux-sandbox test failed.
Reported-by: Alyssa Ross <hi@alyssa.is>
Thanks-to: Puck Meerburg <puck@puckipedia.com>
Tested-by: Puck Meerburg <puck@puckipedia.com>
Reviewed-by: Puck Meerburg <puck@puckipedia.com>
|
|
|
|
|
|
Reduces the number of store queries it performs. Also prints a warning
if any of the selectors did not match any installed derivations.
UX Caveats:
- Will print a warning that nothing matched if a previous selector
already removed the path
- Will not do anything if no selectors were provided (no change from
before).
Fixes #3531
|
|
|
|
|
|
|
|
(cherry picked from commit c7af247beacd418e6f2c4d33dffc35299101cd12)
|
|
Replace select() with poll()
|
|
|
|
pass Pos to forceValue to improve infinite recursion error
|
|
|
|
(cherry picked from commit 8f41847394524fcac40d3b5620139ca7e94a18e3)
|
|
Usually this just writes to stdout, but for ProgressBar, we need to
clear the current line, write the line to stdout, and then redraw the
progress bar.
(cherry picked from commit 696c026006a6ac46adc990ed5cb0f31535bac076)
|
|
|
|
|
|
More #3377.
|
|
We want to *trace* the 'Value *' arrays, not garbage-collect them!
Otherwise the vectors/maps can end up pointing to nowhere.
Fixes #3377. Closes #3384.
|
|
|