about summary refs log tree commit diff
path: root/src/libstore
AgeCommit message (Collapse)AuthorFilesLines
2018-09-28 Check requiredSystemFeatures for local buildsEelco Dolstra5-15/+49
For example, this prevents a "kvm" build on machines that don't have KVM. Fixes #2012.
2018-09-28 Move structured attrs handling into a separate classEelco Dolstra5-116/+145
This is primarily because Derivation::{can,will}BuildLocally() depends on attributes like preferLocalBuild and requiredSystemFeatures, but it can't handle them properly because it doesn't have access to the structured attributes.
2018-09-28 Remove obsolete check on system featuresEelco Dolstra1-1/+0
2018-09-28 Support special attributes in structured attributes derivationsEelco Dolstra1-94/+175
E.g. __noChroot and allowedReferences now work correctly. We also now check that the attribute type is correct. For instance, instead of allowedReferences = "out"; you have to write allowedReferences = [ "out" ]; Fixes #2453.
2018-09-27 S3BinaryCacheStore: Don't create bucketsEelco Dolstra1-28/+0
This meant that making a typo in an s3:// URI would cause a bucket to be created. Also it didn't handle eventual consistency very well. Now it's up to the user to create the bucket.
2018-09-26 Ensure download thread livenessEelco Dolstra1-19/+26
* Don't wait forever for the client to remove data from the buffer. This does mean that the buffer can grow without bounds (e.g. when downloading is faster than writing to disk), but meh. * Don't hold the state lock while calling the sink. The sink could take any amount of time to process the data (in particular when it's actually a coroutine), so we don't want to block the download thread.
2018-09-26 UntabifyEelco Dolstra1-1/+1
2018-09-07 If fallback is enabled, temporarily disable substituters after a failureEelco Dolstra4-1/+48
Otherwise, we just keep asking the substituter for other .narinfo files, which can take a very long time due to retries/timeouts.
2018-09-07 Handle queryPathInfo() failure from substituters when fallback is enabledEelco Dolstra2-0/+12
Fixes #1990.
2018-09-05 fetchurl: Respect unpackEelco Dolstra1-2/+3
Fixes #2393.
2018-09-03 download: fix size reported to progress barWill Dietz1-1/+1
2018-08-31 Add localhost alias for ::1 to the sandboxEelco Dolstra1-1/+1
2018-08-30 fix `error: unknown serve command 9`Michael Bishop1-1/+1
2018-08-21 Improve 'coroutine has finished' error messageEelco Dolstra1-0/+2
2018-08-21 Fix another 'coroutine has finished' during decompressionEelco Dolstra1-1/+1
https://hydra.nixos.org/build/79867739
2018-08-13 ignore when listxattr fails with ENODATASymphorien Gibol1-1/+1
This happens on CIFS and means the remote filesystem has no extended attributes.
2018-08-09 S3BinaryCacheStore: Share TransferManagerEelco Dolstra1-18/+24
TransferManager allocates a lot of memory (50 MiB by default), and it might leak but I'm not sure about that. In any case it was causing OOMs in hydra-queue-runner. So allocate only one TransferManager per S3BinaryCacheStore. Hopefully fixes https://github.com/NixOS/hydra/issues/586.
2018-08-08 S3BinaryCacheStore: Don't use the transfer status callbackEelco Dolstra1-24/+13
This callback is executed on a different thread, so exceptions thrown from the callback are not caught: Aug 08 16:25:48 chef hydra-queue-runner[11967]: terminate called after throwing an instance of 'nix::Error' Aug 08 16:25:48 chef hydra-queue-runner[11967]: what(): AWS error: failed to upload 's3://nix-cache/19dbddlfb0vp68g68y19p9fswrgl0bg7.ls' Therefore, just check the transfer status after it completes. Also include the S3 error message in the exception.
2018-08-06 DohEelco Dolstra1-1/+1
2018-08-06 Fix setting Content-Encoding in S3 uploadsEelco Dolstra1-6/+4
Fixes https://github.com/NixOS/nix/issues/2333 and https://github.com/NixOS/nixpkgs/issues/44337.
2018-08-06 Fix Brotli decompression in 'nix log'Eelco Dolstra5-56/+65
This didn't work anymore since decompression was only done in the non-coroutine case. Decompressors are now sinks, just like compressors. Also fixed a bug in bzip2 API handling (we have to handle BZ_RUN_OK rather than BZ_OK), which we didn't notice because there was a missing 'throw': if (ret != BZ_OK) CompressionError("error while compressing bzip2 file");
2018-08-06 Fix reporting of HTTP body size when a result callback is usedEelco Dolstra2-1/+5
2018-08-03 Make adding paths via nix-store --serve run in constant memoryEelco Dolstra2-15/+47
It adds a new operation, cmdAddToStoreNar, that does the same thing as the corresponding nix-daemon operation, i.e. call addToStore(). This replaces cmdImportPaths, which has the major issue that it sends the NAR first and the store path second, thus requiring us to store the incoming NAR either in memory or on disk until we decide what to do with it. For example, this reduces the memory usage of $ nix copy --to 'ssh://localhost?remote-store=/tmp/nix' /nix/store/95cwv4q54dc6giaqv6q6p4r02ia2km35-blender-2.79 from 267 MiB to 12 MiB. Probably fixes #1988.
2018-08-03 Support escaping in store URIsEelco Dolstra1-2/+18
2018-08-03 SSHMaster: Bypass SSH when connecting to localhostEelco Dolstra2-7/+16
This is primarily useful for testing since it removes the need to have SSH working.
2018-08-03 LegacySSHStore: Add remote-store optionEelco Dolstra1-1/+4
This is primarily useful for testing, e.g. $ nix copy --to 'ssh://localhost?remote-store=/tmp/nix' ...
2018-08-02 s3 binary cache: support specifying an endpointGraham Christensen3-8/+12
Works for uploading and not downloading.
2018-07-31 Fix race downloading into a sinkEelco Dolstra1-6/+8
This fixes 'error 10 while decompressing xz file'. https://hydra.nixos.org/build/78308551
2018-07-24 copyPathsToStore: honour keep-goingLinus Heckemann1-2/+12
2018-06-18 Detect redirect loopsEelco Dolstra1-0/+2
Fixes #2225.
2018-06-18 Merge pull request #2234 from symphorien/esrch2Eelco Dolstra1-1/+1
libstore/gc.cc: ignore ESRCH when reading symlinks in /proc
2018-06-16 libstore/gc.cc: ignore ESRCH when reading symlinks in /procSymphorien Gibol1-1/+1
readlink is also affected by the problem fixed for regular files in c567afe355df
2018-06-14 Fix optimise-store.cc to skip more paths on macOSMatthew Justin Bauer1-2/+1
I hate to make this such a large check but the lack of documentation means we really have no idea what's allowed. All of them reported so far have been within ".app/Contents" directories. That appears to be a safe starting point. However, I would not be surprised to also find more paths that are disallowed for instance in .framework or .bundle directories. Fixes #2031 Fixes #2229
2018-06-13 hashDerivationModulo(): Handle chroot storesEelco Dolstra1-1/+1
This makes 'nix copy --to /mnt /nix/store/bla.drv' work.
2018-06-13 std::random_shuffle -> std::shuffleEelco Dolstra1-1/+3
The former is removed in C++17.
2018-06-12 Fix #2162: use getaddrinfo instead of curl to preload NSSYorick van Pelt1-4/+8
2018-06-11 libstore/gc.cc: ignore ESRCH when reading /procSymphorien Gibol1-10/+13
If a process disappears between the time /proc/[pid]/maps is opened and the time it is read, the read() syscall will return ESRCH. This should be ignored.
2018-06-08 use debug instead of printTalkative to avoid spamming hydra queueAmineChikhaoui1-1/+1
runner logs.
2018-06-05 Don't require --fallback to recover from disappeared binary cache NARsEelco Dolstra3-12/+27
2018-06-05 Handle HTTP 410 Gone errorsEelco Dolstra1-1/+1
2018-06-05 Improve binary cache fallback testEelco Dolstra1-0/+5
2018-06-05 Further improve upload messagesEelco Dolstra2-8/+11
2018-06-01 download.cc: fix readCallback return type (int -> size_t)Will Dietz1-2/+2
I'm not sure if curl ever asks for enough data at once for truncation to occur but better safe than sorry.
2018-06-01 Improve binary cache upload messagesEelco Dolstra2-5/+15
Don't say "download" when we mean "upload".
2018-05-31 Merge pull request #767 from mogorman/garbage_collect_keep_last_fewPeter Simons2-0/+25
Implement --delete-generations + flag for keeping last N number of gens
2018-05-30 RemoteStore::addToStore(): Ensure capacity is decreased on exceptionsEelco Dolstra1-2/+5
2018-05-30 Fix deadlock in RemoteStore::queryPathInfoUncached()Eelco Dolstra1-25/+28
2018-05-30 Make <nix/fetchurl.nix> run in constant memoryEelco Dolstra1-35/+43
E.g. nix-build --store ~/my-nix/ -E 'import <nix/fetchurl.nix> { url = https://cache.nixos.org/nar/0nwi996rgq4b914qyx0mv2wq4k80hjac7xilikavagw7kxmn2iiv.nar.xz; sha256 = "0nwi996rgq4b914qyx0mv2wq4k80hjac7xilikavagw7kxmn2iiv"; }' now runs in 17 MiB (was 70 MiB), while nix-build --store ~/my-nix/ -E 'import <nix/fetchurl.nix> { url = https://cache.nixos.org/nar/0nwi996rgq4b914qyx0mv2wq4k80hjac7xilikavagw7kxmn2iiv.nar.xz; sha256 = "0d2fxljdih3nc5dqx41hjzic3141ajil94m8kdbpryq569dpsbvb"; unpack = true; }' runs in 17 MiB (was 346 MiB).
2018-05-30 getDownloader(): SimplifyEelco Dolstra1-4/+2
2018-05-30 Make HttpBinaryCacheStore::narFromPath() run in constant memoryEelco Dolstra3-3/+116
This reduces memory consumption of nix copy --from https://cache.nixos.org --to ~/my-nix /nix/store/95cwv4q54dc6giaqv6q6p4r02ia2km35-blender-2.79 from 176 MiB to 82 MiB. (The remaining memory is probably due to xz decompression overhead.) Issue https://github.com/NixOS/nix/issues/1681. Issue https://github.com/NixOS/nix/issues/1969.