aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
AgeCommit message (Collapse)Author
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-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-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-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
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-18Use cgroup.kill to quickly kill cgroupsEelco Dolstra
2022-11-18Get CPU stats from the cgroupEelco Dolstra
2022-11-18Separate cgroup support from auto-uid-allocationEelco Dolstra
The new experimental feature 'cgroups' enables the use of cgroups for all builds. This allows better containment and enables setting resource limits and getting some build stats.
2022-11-17Fix segfault in unprivileged modeEelco Dolstra
2022-11-16Replace src/libutil/json.cc with nlohmann json generationYorick van Pelt
2022-11-15Merge pull request #7294 from tobim/support-aws-sdk-1.10Théophane Hufschmitt
libstore: link to aws-crt-cpp
2022-11-15Merge pull request #7283 from hercules-ci/issue-6572Théophane Hufschmitt
Fix #6572 `requires non-existent output`
2022-11-14derivation-goal: Fix `requires non-existing output` errorRobert Hensing
It occurred when a output of the dependency was already available, so it didn't need rebuilding and didn't get added to the inputDrvOutputs. This process-related info wasn't suitable for the purpose of finding the actual input paths for the builder. It is better to do this in absolute terms by querying the store.
2022-11-14Merge remote-tracking branch 'nixos/master' into readFile-scan-referencesThéophane Hufschmitt
2022-11-12libstore: link to aws-crt-cppTobias Mayer
This change is needed to support aws-sdk-cpp 1.10 and newer. I opted not to make this dependent on the sdk version because the crt dependency has been in the interface of the older sdk as well, and it was only coincidence that libstore didn't make use of any privately defined symbols directly.
2022-11-11Restrict `readFile` context to references that appear in the stringNaïm Favier
When calling `builtins.readFile` on a store path, the references of that path are currently added to the resulting string's context. This change makes those references the *possible* context of the string, but filters them to keep only the references whose hash actually appears in the string, similarly to what is done for determining the runtime references of a path.
2022-11-10Remove the SystemdCgroup featureEelco Dolstra
2022-11-08Fix build on macOSEelco Dolstra
2022-11-08Split auto UID allocation from cgroupsEelco Dolstra
Cgroups are now only used for derivations that require the uid-range range feature. This allows auto UID allocation even on systems that don't have cgroups (like macOS). Also, make things work on modern systems that use cgroups v2 (where there is a single hierarchy and no "systemd" controller).
2022-11-03Merge remote-tracking branch 'origin/master' into auto-uid-allocationEelco Dolstra
2022-10-27Pass the right argv when calling the build hookThéophane Hufschmitt
Call it as `['nix', '__build-remote', ... ]` rather than the previous `["__build-remote", "nix __build-remote", ... ]` which seemed to have been most likely unintended
2022-10-22Defer to SSH config files for ForwardAgent optionAustin Kiekintveld
Currently, Nix passes `-a` when it runs commands on a remote machine via SSH, which disables agent forwarding. This causes issues when the `ForwardAgent` option is set in SSH config files, as the command line operation always overrides those. In particular, this causes issues if the command being run is `sudo` and the remote machine is configured with the equivalent of NixOS's `security.pam.enableSSHAgentAuth` option. Not allowing SSH agent forwarding can cause authentication to fail unexpectedly. This can currently be worked around by setting `NIX_SSHOPTS="-A"`, but we should defer to the options in the SSH config files to be least surprising for users.
2022-10-18Implement BinaryCacheStore::queryPathFromHashPart()Eelco Dolstra
2022-10-14Merge pull request #7168 from NixOS/rosetta-testEelco Dolstra
Improve Rosetta detection
2022-10-14Remove useless debug statementsEelco Dolstra
We haven't parsed the '-v' command line flags yet when this code executes, so we can't actually get debug output here.
2022-10-14Use /usr/bin/trueEelco Dolstra
2022-10-13Fix error display if execve() in the builder failsEelco Dolstra
After we've send "\2\n" to the parent, we can't send a serialized exception anymore. It will show up garbled like $ nix-build --store /tmp/nix --expr 'derivation { name = "foo"; system = "x86_64-linux"; builder = "/foo/bar"; }' this derivation will be built: /nix/store/xmdip0z5x1zqpp6gnxld3vqng7zbpapp-foo.drv building '/nix/store/xmdip0z5x1zqpp6gnxld3vqng7zbpapp-foo.drv'... ErrorErrorEexecuting '/foo/bar': No such file or directory error: builder for '/nix/store/xmdip0z5x1zqpp6gnxld3vqng7zbpapp-foo.drv' failed with exit code 1
2022-10-13Improve Rosetta detectionEelco Dolstra
Turns out that one of those *.plist files can exist even if Rosetta is not installed. So let's just try to run an x86_64-darwin binary directly.
2022-10-12Make warning about chroot store location more accurateSteam Deck User
While trying to use an alternate directory for my Nix installation, I noticed that nix's output didn't reflect the updated state directory. This patch corrects that and now prints the warning before attempting to create the directory (if the directory creation fails, it wouldn't have been obvious why nix was attempting to create the directory in the first place). With this patch, I now get the following warning: warning: '/home/deck/.var/app/org.nixos.nix/var/nix' does not exist, so Nix will use '/home/deck/.local/share/nix/root' as a chroot store
2022-10-05Merge pull request #6870 from ↵Valentin Gagarin
amjoseph-nixpkgs/pr/doc/explain-local-remote-binary-substituter
2022-09-30Merge pull request #7080 from squalus/nar-close-fileEelco Dolstra
archive: check close errors when extracting nars
2022-09-24Merge pull request #7078 from obsidiansystems/trustworthy-signatureThéophane Hufschmitt
"valid signature" -> "signature by a trusted key"
2022-09-24Merge pull request #7079 from matthewbauer/allow-untrusted-settingsThéophane Hufschmitt
Allow pass max-silent-time and build-poll-interval to daemon untrusted
2022-09-24Merge pull request #7059 from NixOS/remove-useless-ca-file-messageEelco Dolstra
Remove a useless debug message in filetransfer.cc
2022-09-23Apply suggestions from code reviewJohn Ericson
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io> Co-authored-by: Rune K. Svendsen <runesvend@gmail.com>