aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2022-12-09Merge pull request #7409 from tweag/fix-6383Théophane Hufschmitt
check the store for input before failing (hopefully fix #6383)
2022-12-07Trivial changes from the lazy-trees branchEelco Dolstra
2022-12-07Remove repeat and enforce-determinism optionsLinus Heckemann
These only functioned if a very narrow combination of conditions held: - The result path does not yet exist (--check did not result in repeated builds), AND - The result path is not available from any configured substituters, AND - No remote builders that can build the path are available. If any of these do not hold, a derivation would be built 0 or 1 times regardless of the repeat option. Thus, remove it to avoid confusion.
2022-12-06improve styleTaeer Bar-Yam
2022-12-06Merge pull request #7382 from fricklerhandwerk/doc-automatic-uidEelco Dolstra
move documentation on `auto-allocate-uids` to options docs
2022-12-06Tweak option descriptionsEelco Dolstra
2022-12-05check the store for input before failing (hopefully fix #6383)Taeer Bar-Yam
2022-12-05Merge pull request #7390 from Radvendii/fix-6383Théophane Hufschmitt
check the store for input before failing (hopefully fix #6700)
2022-12-05check the store for input before failing (hopefully fix #6700)Taeer Bar-Yam
2022-12-05Consistent capitalisationEelco Dolstra
2022-12-04getMaxCPU: fix cgroup pathJörg Thalheim
Given this typo I am not sure if it has been tested.
2022-12-02Merge pull request #7394 from edolstra/fix-7268Eelco Dolstra
Lower verbosity of exceptions in getMaxCPU()
2022-12-02Merge pull request #7395 from obsidiansystems/evaluating-to-callingEelco Dolstra
Change "while evaluating <fun>" to "while *calling*" in trace
2022-12-02Change "while evaluating <fun>" to "while *calling*" in traceJohn Ericson
The old way was not correct. Here is an example: ``` $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x 1' --show-trace error: asdf … while evaluating 'x' at «string»:1:9: 1| let x = a: throw "asdf"; in x 1 | ^ … from call site at «string»:1:29: 1| let x = a: throw "asdf"; in x 1 | ^ ``` and yet also: ``` $ nix-instantiate --eval --expr 'let x = a: throw "asdf"; in x' --show-trace <LAMBDA> ``` Here is the thing: in both cases we are evaluating `x`! Nix is a higher-order languages, and functions are a sort of value. When we write `x = a: ...`, `a: ...` is the expression that `x` is being defined to be, and that is already a value. Therefore, we should *never* get an trace that says "while evaluating `x`", because evaluating `a: ...` is *trival* and nothing happens during it! What is actually happening here is we are applying `x` and evaluating its *body* with arguments substituted for parameters. I think the simplest way to say is just "while *calling* `x`", and so that is what I changed it to.
2022-12-02getMaxCPU(): Lower verbosity level for ignored exceptionsEelco Dolstra
Fixes #7268.
2022-12-02Merge pull request #7381 from aakropotkin/doc-ltoa-conflictsValentin Gagarin
doc: listToAttrs: document repeated keys
2022-12-02Clean up cgroup handling in getMaxCPU()Eelco Dolstra
Also, don't assume in LocalDerivationGoal that cgroups are mounted on /sys/fs/cgroup.
2022-12-02Move cgroup.{cc,hh} to libutilEelco Dolstra
2022-12-01doc: listToAttrs: add extra whitespaceAlex Ameen
2022-12-01Really fix 'nix store make-content-addressed --json'Eelco Dolstra
https://hydra.nixos.org/log/mcgypcf9vj4n8vdmw7lj3l05c899v73w-nix-2.12.0pre20221201_16b03f0-x86_64-unknown-linux-musl.drv
2022-11-30doc: listToAttrs: fix line wrappingAlex Ameen
2022-11-30doc: listToAttrs: document repeated keysAlex Ameen
2022-12-01move documentation on `auto-allocate-uids` to options docsValentin Gagarin
this is where it belongs and can be found together with the other options.
2022-11-30nix store make-content-addressed: Fix JSON constructionEelco Dolstra
Fixes error: [json.exception.type_error.301] cannot create object from initializer list in tests/fetchClosure.sh.
2022-11-29Merge pull request #3600 from NixOS/auto-uid-allocationEelco Dolstra
Automatic UID allocation
2022-11-29Restore ownership of / for non-uid-range buildsEelco Dolstra
2022-11-29Merge pull request #7358 from ncfavier/repl-exit-newlineEelco Dolstra
repl: print a newline on ctrl-D
2022-11-28Add a setting for enabling cgroupsEelco Dolstra
2022-11-28Check that auto-allocated UIDs don't clash with existing accountsEelco Dolstra
2022-11-28Merge pull request #7313 from yorickvP/nlohmann-everywhereEelco Dolstra
Replace src/libutil/json.cc with nlohmann
2022-11-28use logger->cout Naïm Favier
in order to avoid potential problems with the progress bar Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2022-11-28repl: print a newline on ctrl-DNaïm Favier
2022-11-27Fix random client failures during GC server shutdownEelco Dolstra
We need to close the GC server socket before shutting down the active GC client connections, otherwise a client may (re)connect and get ECONNRESET. But also handle ECONNRESET for resilience. Fixes random failures like GC socket disconnected connecting to '/tmp/nix-shell.y07M0H/nix-test/default/var/nix/gc-socket/socket' sending GC root '/tmp/nix-shell.y07M0H/nix-test/default/store/kb5yzija0f1x5xkqkgclrdzldxj6nnc6-non-blocking' reading GC root from client: error: unexpected EOF reading a line 1 store paths deleted, 0.00 MiB freed error: reading from file: Connection reset by peer in gc-non-blocking.sh.
2022-11-25Don't use GC_STRNDUPEelco Dolstra
It calls strlen() on the input (rather than simply copying at most `size` bytes), which can fail if the input is not zero-terminated and is inefficient in any case. Fixes #7347.
2022-11-25Merge branch 'master' into indexed-store-path-outputsJohn Ericson
2022-11-23Merge pull request #7337 from Radvendii/why-depends-caThéophane Hufschmitt
Fix why-depends for CA derivations
2022-11-23add explanation and testTaeer Bar-Yam
2022-11-23Fix why-depends for CA derivationsTaeer Bar-Yam
why-depends assumed that we knew the output path of the second argument. For CA derivations, we might not know until it's built. One way to solve this would be to build the second installable to get the output path. In this case we don't need to, though. If the first installable (A) depends on the second (B), then getting the store path of A will necessitate having the store path B. The contrapositive is, if the store path of B is not known (i.e. it's a CA derivation which hasn't been built), then A does not depend on B.
2022-11-23Merge remote-tracking branch 'origin/master' into auto-uid-allocationEelco Dolstra
2022-11-22Merge pull request #7328 from edolstra/nix-build-statsEelco Dolstra
nix build --json: Include build statistics
2022-11-22SimpleUserLock::getSupplementaryGIDs(): Filter out main gidEelco Dolstra
This avoids having the user's gid in the supplementary group list as well.
2022-11-22Always call setgroups()Eelco Dolstra
We shouldn't skip this if the supplementary group list is empty, because then the sandbox won't drop the supplementary groups of the parent (like "root").
2022-11-21Merge pull request #6456 from amjoseph-nixpkgs/seccomp-mipsEelco Dolstra
local-derivation-goal.cc: enable seccomp filters for mips{32,64}
2022-11-21Use hex for startIdEelco Dolstra
Co-authored-by: Linus Heckemann <git@sphalerite.org>
2022-11-21AutoUserLock: If sandboxing is disabled, use the build users groupEelco Dolstra
We have to use a gid that has write access to the Nix store.
2022-11-21nix build --json: Include build statisticsEelco Dolstra
Example: # nix build -L --extra-experimental-features cgroups --impure --expr 'with import <nixpkgs> {}; runCommand "foo" {} "dd if=/dev/urandom bs=1M count=1024 | md5sum; mkdir $out"' --json [ { "cpuSystem": 1.911431, "cpuUser": 1.214249, "drvPath": "/nix/store/xzdqz67xba18hljhycp0hwfigzrs2z69-foo.drv", "outputs": { "out": "/nix/store/rh9mc9l2gkpq8kn2sgzndr6ll7ffjh6l-foo" }, "startTime": 1669024076, "stopTime": 1669024079 } ]
2022-11-21Rename derivedPathsWithHintsToJSON -> builtPathsToJSONEelco Dolstra
2022-11-21Fix macOS buildEelco Dolstra
2022-11-21Merge remote-tracking branch 'origin/master' into auto-uid-allocationEelco Dolstra
2022-11-21Fix indentationEelco Dolstra