aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
AgeCommit message (Collapse)Author
2021-10-12CleanupEelco Dolstra
2021-10-12Merge branch 'nix-repl-download-interruption' of https://github.com/Ma27/nixEelco Dolstra
2021-10-12Add compression level for NARsTom Bereknyei
Based off on @dtzWill's #2276
2021-10-11(partially) Revert "Don't copy in rethrow"regnat
This reverts some parts of commit 8430a8f0866e4463a891ccce62779ea9ac0f3b38 which was trying to rethrow some exceptions while we weren’t in the context of a `catch` block, causing some weird “terminate called without an active exception” errors. Fix #5368
2021-10-08libstore-tests: add libutil dependency (fix static link failure)Sergei Trofimovich
In https://github.com/NixOS/nix/pull/5350 we noticed link failures pkgsStatic.nixUnstable. Adding explicit dependency on libutil fixes libstore-tests linking.
2021-10-07nix repl: properly deal with interruptionsMaximilian Bosch
When I stop a download with Ctrl-C in a `nix repl` of a flake, the REPL refuses to do any other downloads: nix-repl> builtins.getFlake "nix-serve" [0.0 MiB DL] downloading 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca41 error: download of 'https://api.github.com/repos/edolstra/nix-serve/tarball/e9828a9e01a14297d15ca416e5a9415d4972b0f0' was interrupted [0.0 MiB DL] nix-repl> builtins.getFlake "nix-serve" error: interrupted by the user [0.0 MiB DL] To fix this issue, two changes were necessary: * Reset the global `_isInterrupted` variable: only because a single operation was aborted, it should still be possible to continue the session. * Recreate a `fileTransfer`-instance if the current one was shut down by an abort.
2021-10-07TypoEelco Dolstra
2021-10-06Don't reset the logger in a vforkEelco Dolstra
9c766a40cbbd3a350a9582d0fd8201e3361a63b2 broke logging from the daemon, because commonChildInit is called when starting the build hook in a vfork, so it ends up resetting the parent's logger. So don't vfork. It might be best to get rid of vfork altogether, but that may cause problems, e.g. when we call an external program like git from the evaluator.
2021-10-05Merge pull request #5335 from edolstra/socket-pathsEelco Dolstra
Support arbitrary-length socket paths
2021-10-05Add FIXME about ptsnameEelco Dolstra
2021-10-05Connect/bind Unix domain sockets in a child processEelco Dolstra
In the child process, we can do a chdir() and avoid the problem of the path not fitting into sockaddr_un.
2021-10-04Add a test for RefScanSink and clean up the codeEelco Dolstra
Issue #5322.
2021-10-04scanForReferences(): Use a StorePathSetEelco Dolstra
2021-10-01local-derivation-goal.cc: downgrade "warning: rewriting hashes in..." down ↵Sergei Trofimovich
to debug Before the changes when building the whole system with `contentAddressedByDefault = true;` we get many noninformative messages: $ nix build -f nixos system --keep-going ... warning: rewriting hashes in '/nix/store/...-clang-11.1.0.drv.chroot/nix/store/...-11.1.0'; cross fingers warning: rewriting hashes in '/nix/store/...-clang-11.1.0.drv.chroot/nix/store/...-11.1.0-dev'; cross fingers warning: rewriting hashes in '/nix/store/...-clang-11.1.0.drv.chroot/nix/store/...-11.1.0-python'; cross fingers error: 2 dependencies of derivation '/nix/store/...-hub-2.14.2.drv' failed to build warning: rewriting hashes in '/nix/store/...-subversion-1.14.1.drv.chroot/nix/store/...-subversion-1.14.1-dev'; cross fingers warning: rewriting hashes in '/nix/store/...-subversion-1.14.1.drv.chroot/nix/store/...-subversion-1.14.1-man'; cross fingers ... Let's downgrade these messages down to debug().
2021-10-01Merge pull request #5167 from Ma27/keep-failed-on-ssh-remote-buildEelco Dolstra
nix-store --serve: pass on `settings.keepFailed` from SSH store
2021-09-30`std::visit` by referenceJohn Ericson
I had started the trend of doing `std::visit` by value (because a type error once mislead me into thinking that was the only form that existed). While the optomizer in principle should be able to deal with extra coppying or extra indirection once the lambdas inlined, sticking with by reference is the conventional default. I hope this might even improve performance.
2021-09-29Merge pull request #5295 from Ma27/bmcheck-fod-mismatchEelco Dolstra
build: also throw hash-mismatch errors if `buildMode == bmCheck`
2021-09-27build: also throw hash-mismatch errors if `buildMode == bmCheck`Maximilian Bosch
This actually bit me quite recently in `nixpkgs` because I assumed that `nix-build --check` would also error out if hashes don't match anymore[1] and so I wrongly assumed that I couldn't reproduce the mismatch error. The fix is rather simple, during the output registration a so-called `delayedException` is instantiated e.g. if a FOD hash-mismatch occurs. However, in case of `nix-build --check` (or `--rebuild` in case of `nix build`), the code-path where this exception is thrown will never be reached. By adding that check to the if-clause that causes an early exit in case of `bmCheck`, the issue is gone. Also added a (previously failing) test-case to demonstrate the problem. [1] https://github.com/NixOS/nixpkgs/pull/139238, the underlying issue was that `nix-prefetch-git` returns different hashes than `fetchgit` because the latter one fetches submodules by default.
2021-09-27Don't copy in rethrowEelco Dolstra
2021-09-24Merge pull request #5253 from edolstra/flake-ifdEelco Dolstra
Don't allow IFD in flakes by default
2021-09-23Shut down write side before draining the read sideEelco Dolstra
This is important if the remote side *does* execute nix-store/nix-daemon successfully, but stdout is polluted (e.g. because the remote user's bashrc script prints something to stdout). In that case we have to shutdown the write side to force the remote nix process to exit.
2021-09-23SSHStore / LegacySSHStore: Show a better error message if the remote is ↵Eelco Dolstra
"nologin" Instead of error: serialised integer 7161674624452356180 is too large for type 'j' we now get error: 'nix-store --serve' protocol mismatch from 'sshtest@localhost', got 'This account is currently not available.' Fixes https://github.com/NixOS/nixpkgs/issues/37287.
2021-09-23Remove risky char *Eelco Dolstra
2021-09-23Add some more instrumentationEelco Dolstra
2021-09-22Make setDefault() typedEelco Dolstra
2021-09-22Add missing #includeEelco Dolstra
Fixes #5282.
2021-09-17Fix scheme argument to s3 cacheGregor Kleen
2021-09-15sandbox: allow Rosetta 2 on DarwinEmily
This allows sandboxed x86_64-darwin builds on aarch64-darwin.
2021-09-14Add 'nix profile wipe-history' commandEelco Dolstra
2021-09-14Generations -> profile versionsEelco Dolstra
2021-09-14Add "nix profile rollback" commandEelco Dolstra
2021-09-14Merge pull request #5247 from edolstra/stablize-ca-referencesEelco Dolstra
Remove the 'ca-references' feature check
2021-09-14Advise using --extra-experimental-features instead of --experimental-featuresEelco Dolstra
Fixes #3737.
2021-09-14Remove the 'ca-references' feature checkEelco Dolstra
Fixes #3422. Fixes #4425.
2021-09-14Fix macOS buildEelco Dolstra
2021-09-13RunOptions: Use designated initializersEelco Dolstra
Also get rid of _killStderr because it wasn't actually checked anywhere.
2021-09-10Remove tabsEelco Dolstra
2021-09-09Merge pull request #5224 from baloo/baloo/5089/force-nss_dns-loadEelco Dolstra
preloadNSS: fixup nss_dns load
2021-09-08preloadNSS: load NSS before threads are startedArthur Gautier
preloadNSS is not thread-safe, this commit moves it before we start the first thread. Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-09-06preloadNSS: fixup nss_dns loadArthur Gautier
Before this commit, the dns lookup in preloadNSS would still go through nscd. This did not have the effect of loading the nss_dns.so as expected (nss_dns.so being out of reach from within the sandbox). Should LOCALDOMAIN environment variable be defined, nss will completely avoid nscd and will do its dns resolution on its own. By temporarly setting LOCALDOMAIN variable before calling in NSS, we can force NSS to load the shared libraries as expected. Fixes #5089 Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
2021-09-02Don’t create lockfiles with an invalid path nameregnat
Store paths are only allowed to contain a limited subset of the alphabet, which doesn’t include `!`. So don’t create lockfiles that contain this `!` character as that would otherwise confuse (and break) the gc. Fix #5176
2021-09-01StyleEelco Dolstra
2021-09-01Merge branch 'short-circuit-subst' of https://github.com/Kha/nixEelco Dolstra
2021-08-31nix-store --serve: pass on `settings.keepFailed` from SSH storeMaximilian Bosch
When doing e.g. nix-build -A package --keep-failed --option \ builders \ 'ssh://mfhydra?remote-store=/home/bosch/store x86_64-linux - 10 4 big-parallel' this doesn't work properly because this build-setting is ignored. I changed this behavior by passing the `settings.keepFailed` through the serve-protocol to remote machines to make sure that I can introspect the build-directory (which is particularly helpful when I have to look at a `config.log` from a failed build for instance).
2021-08-31Merge pull request #5071 from NixOS/dont-send-xp-features-to-the-daemonEelco Dolstra
Don’t send the experimental-features to the daemon
2021-08-30Merge pull request #5175 from Pamplemousse/makeEelco Dolstra
Don't overwrite user provided `lib*_LDFLAGS`
2021-08-30Don’t accept experimental features from the clientregnat
If the client sends an “experimental features” setting, just ignore it
2021-08-25Don't overwrite user provided `lib*_LDFLAGS`Pamplemousse
Signed-off-by: Pamplemousse <xav.maso@gmail.com>
2021-08-13Install pkg-config files in the correct locationPiotr Szubiakowski
Use `$(libdir)` while installing .pc files looks like a more generic solution. For example, it will work for distributions like RHEL or Fedora where .pc files are installed in `/usr/lib64/pkgconfig`.
2021-08-1015f4d4f follow upPamplemousse
* libstore: `bz2` should not be linked * libutil: `zlib.h` should not be included Signed-off-by: Pamplemousse <xav.maso@gmail.com>