Age | Commit message (Collapse) | Author | Files | Lines |
|
The tmpDirInSandbox is different when in sandboxed vs. non-sandboxed.
Since we don’t know ahead of time here whether sandboxing is enabled,
we need to reset all of the env vars we’ve set previously. This fixes
the issue encountered in https://github.com/NixOS/nixpkgs/issues/70856.
(cherry picked from commit 499b0388759db0f9f385da402a4bba551268aa99)
|
|
Fixes #3138.
(cherry picked from commit 906d56a96b442d4dd8f924c1ce0d1eec0e214af3)
|
|
Fixes #3140.
(cherry picked from commit 389a2cebed7cd72bda524ece0a56af2888cd80b6)
|
|
Fixes #3186
(cherry picked from commit b811bd2172bc9796f42b87996f455d4e5e4382ba)
|
|
The intent of the code was that if the window size cannot be determined,
it would be treated as having the maximum possible size. Because of a
missing assignment, it was actually treated as having a width of 0.
The reason the width could not be determined was because it was obtained
from stdout, not stderr, even though the printing was done to stderr.
This commit addresses both issues.
(cherry picked from commit c935ad3f025d5c3d8026711a1eb50b2917b61d59)
|
|
(cherry picked from commit 8737980e75bf14cae278f596ac26577bec94b3f9)
|
|
The FunctionCallTrace object consumes a few hundred bytes of stack
space, even when tracing is disabled. This was causing stack overflows:
$ nix-instantiate '<nixpkgs> -A texlive.combined.scheme-full --dry-run
error: stack overflow (possible infinite recursion)
This is with the default stack size of 8 MiB.
Putting the object on the heap reduces stack usage to < 5 MiB.
(cherry picked from commit 98ef11677c43db9aa669768d9f0cbec704e8831c)
|
|
(cherry picked from commit 95cf23ee7c5b0fd69b21811989a5668f4261fd51)
|
|
https://hydra.nixos.org/build/102803093
(cherry picked from commit c3aaf3b8da1a925c569389f13a861816a781a3c8)
|
|
https://hydra.nixos.org/build/102803044
(cherry picked from commit bda64a2b0f79346012332ed18f5a76388e6d9bae)
|
|
(cherry picked from commit c9159f86cc9a2fc07e2ab1217c2d8a8824123df4)
|
|
(cherry picked from commit 9348f9291e5d9e4ba3c4347ea1b235640f54fd79)
|
|
(cherry picked from commit 20eec802ff11dd2b152715cd5c81b756d318219d)
|
|
700 is pointless since the store is world-readable anyway. And
per-user/root/channels must be world-readable.
(cherry picked from commit d7bae5680fc26303acb9a9ee1a202f537841a624)
|
|
'nix-daemon' now creates subdirectories for users when they first
connect.
Fixes #509 (CVE-2019-17365).
Should also fix #3127.
(cherry picked from commit 5a303093dcae1e5ce9212616ef18f2ca51020b0d)
|
|
Otherwise, builds like NixOS VM tests may leave the terminal in a
weird state and do resets.
(cherry picked from commit 4331eeb13d241dfe2d2e6a01c53915c556cac94f)
|
|
(cherry picked from commit a56b51a0ba7b0d6fdff7fd0127a118185b146f4f)
|
|
(cherry picked from commit e63c9e73e3e5d1f31fa5065c9ff59f442dd07d0e)
|
|
(cherry picked from commit 893be6f5e36abb58bbaa9c49055a5218114dd514)
(cherry picked from commit bd79c1f6f6391786772a8a79962abe22f374cca4)
|
|
(cherry picked from commit 99e8e58f2de9941353b47ed14fbe4ed76d635519)
(cherry picked from commit 3a022d45993b6fa8c7bf03517a3a3d1a2ab15f4a)
|
|
Fixes #2405.
(cherry picked from commit 168a8879165dd0deab1a93d343a6003146f37031)
|
|
(cherry picked from commit 6f6cb5e3880d0c7a1dd2bc13c2e0be8ce0ae9fa1)
|
|
Previously, SANDBOX_SHELL was set to empty when unavailable. This
caused issues when actually generating the sandbox. Instead, just set
SANDBOX_SHELL when --with-sandbox-shell= is non-empty. Alternative
implementation to https://github.com/NixOS/nix/pull/3038.
(cherry picked from commit 199e888785bd23073e44e56f6c74b95dc7c10ffa)
|
|
(cherry picked from commit 7c74f075f4a7274ad38c90085cc269a19a977438)
|
|
Fixes #1892.
Fixes #1865.
Fixes #3119.
(cherry picked from commit e6e61f0a54dac0174df996e93fcfedcac7769ab4)
|
|
Hopefully fixes #3081 (didn't test).
|
|
This is to assert that callback functions should never throw (since
the context in which they're called may not be able to handle the
exception).
|
|
Also, make Callback movable but uncopyable.
|
|
|
|
Set maximum name length in Nix
|
|
It doesn't seem very reliable on ZFS.
|
|
|
|
Handle SIGWINCH in main thread
|
|
Previously we allowed any length of name for Nix derivations. This is
bad because different file systems have different max lengths. To make
things predictable, I have picked a max. This was done by trying to
build this derivation:
derivation {
name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
builder = "/no-such-path";
system = "x86_64-linux";
}
Take off one a and it will not lead to file name too long. That ends
up being 212 a’s. An even smaller max could be picked if we want to
support more file systems.
Working backwards, this is why:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-${name}.drv.chroot
> 255 - 32 - 1 - 4 - 7 = 211
|
|
These are already handled separately. This fixes warnings like
warning: ignoring the user-specified setting 'max-jobs', because it is a restricted setting and you are not a trusted user
when using the -j flag.
|
|
|
|
|
|
If a NAR is already in the store, addToStore doesn't read the source
which makes the protocol go out of sync. This happens for example when
two client try to nix-copy-closure the same derivation at the same time.
|
|
Introduce the SizeSource which allows to bound how much data is being
read from a source. It also contains a drainAll() function to discard
the rest of the source, useful to keep the nix protocol in sync.
|
|
Track function start and end
|
|
With this patch, and this file I called `log.py`:
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3 --pure
import sys
from pprint import pprint
stack = []
timestack = []
for line in open(sys.argv[1]):
components = line.strip().split(" ", 2)
if components[0] != "function-trace":
continue
direction = components[1]
components = components[2].rsplit(" ", 2)
loc = components[0]
_at = components[1]
time = int(components[2])
if direction == "entered":
stack.append(loc)
timestack.append(time)
elif direction == "exited":
dur = time - timestack.pop()
vst = ";".join(stack)
print(f"{vst} {dur}")
stack.pop()
and:
nix-instantiate --trace-function-calls -vvvv ../nixpkgs/pkgs/top-level/release.nix -A unstable > log.matthewbauer 2>&1
./log.py ./log.matthewbauer > log.matthewbauer.folded
flamegraph.pl --title matthewbauer-post-pr log.matthewbauer.folded > log.matthewbauer.folded.svg
I can make flame graphs like: http://gsc.io/log.matthewbauer.folded.svg
---
Includes test cases around function call failures and tryEval. Uses
RAII so the finish is always called at the end of the function.
|
|
conf: stalled-download-timeout: make tunable
|
|
Make curl's low speed limit configurable via stalled-download-timeout.
Before, this limit was five minutes without receiving a single byte.
This is much too long as if the remote end may not have even
acknowledged the HTTP request.
|
|
pathlocks: add include to fcntl.h for O_CLOEXEC
|
|
Add a post build hook
|
|
|
|
|
|
With BSD locks we don't have to guard against reading our own
temproots.
|
|
POSIX file locks are essentially incompatible with multithreading. BSD
locks have much saner semantics. We need this now that there can be
multiple concurrent LocalStore::buildPaths() invocations.
|
|
This currently fails because we're using POSIX file locks. So when the
garbage collector opens and closes its own temproots file, it causes
the lock to be released and then deleted by another GC instance.
|