aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
AgeCommit message (Collapse)Author
2019-04-08Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-04-01primeCache(): Barf if builds are needed but not allowedEelco Dolstra
Fixes #2753.
2019-04-01getMachines(): Cache resultEelco Dolstra
2019-03-26Merge remote-tracking branch 'origin/master' into flakesEelco Dolstra
2019-03-25store-api.hh: add missing include for unordered_mapWill Dietz
2019-03-15Add a 5 seconds of timeouts to connect to S3.Chaker Benhamed
The default is 1000ms, but we can hit it a lot of we don't have direct link to AWS (e.g. using VPN).
2019-03-14pkg-config files: Use c++17Eelco Dolstra
2019-03-14experimental/optional -> optionalEelco Dolstra
2019-03-14findRoots(): Add 'censor' parameterEelco Dolstra
This is less brittle than filtering paths after the fact in nix-daemon.
2019-03-14findRuntimeRoots: Simplify/fix handling of /proc filesEelco Dolstra
Scanning of /proc/<pid>/{exe,cwd} was broken because '{memory:' was prepended twice. Also, get rid of the whole '{memory:...}' thing because it's unnecessary, we can just list the file in /proc directly.
2019-03-10Unify internal findRootsXxx() apiGuillaume Maudoux
2019-03-10Make roots a map of store paths to pinning linksGuillaume Maudoux
This new structure makes more sense as there may be many sources rooting the same store path. Many profiles can reference the same path but this is even more true with /proc/<pid>/maps where distinct pids can and often do map the same store path. This implementation is also more efficient as the `Roots` map contains only one entry per rooted store path.
2019-03-10Obfuscate memory roots for non-root usersGuillaume Maudoux
2019-03-10detail memory rootsGuillaume Maudoux
2019-02-26fix indentationDzmitry Zaitsau
2019-02-25Apply param values on S3Helper initializationDzmitry Zaitsau
2019-02-25Extend S3 URL parsing with parameters extractionDzmitry Zaitsau
2019-02-25Extract and expose splitUriAndParams functionDzmitry Zaitsau
which splits a URL into localtor and parameter parts
2019-02-25downloadCached: Return ETagEelco Dolstra
This allows fetchFlake() to return the Git revision of a GitHub archive.
2019-02-12pkg-config files: Use c++17Eelco Dolstra
2019-02-12experimental/optional -> optionalEelco Dolstra
2019-02-05Revert "Restore parent mount namespace before executing a child process"Eelco Dolstra
This reverts commit a0ef21262f4d5652bfb65cfacaec01d89c475a93. This doesn't work in 'nix run' and nix-shell because setns() fails in multithreaded programs, and Boehm GC mark threads are uncancellable. Fixes #2646.
2019-01-18unsupported(): Show the name of the unsupported operationEelco Dolstra
2019-01-05Remove mentions of `libformat`, it no longer existsJohn Ericson
2018-12-12libstore: improve hash mismatch error messageszimbatm
Use the same output ordering and format everywhere. This is such a common issue that we trade the single-line error message for more readability. Old message: ``` fixed-output derivation produced path '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com' with sha256 hash '08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm' instead of the expected hash '1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m' ``` New message: ``` hash mismatch in fixed-output derivation '/nix/store/d4nw9x2sy9q3r32f3g5l5h1k833c01vq-example.com': wanted: sha256:1xzwnipjd54wl8g93vpw6hxnpmdabq0wqywriiwmh7x8k0lvpq5m got: sha256:08y4734bm2zahw75b16bcmcg587vvyvh0n11gwiyir70divwp1rm ```
2018-12-12Fix assertion failure in NarInfoDiskCacheEelco Dolstra
https://hydra.nixos.org/build/85827920
2018-12-12nar-info-disk-cache: include ca in the cache entriesDaiderd Jordan
Without this information the content addressable state and hashes are lost after the first request, this causes signatures to be required for everything even tho the path could be verified without signing.
2018-12-07s3: make scheme configurableDaiderd Jordan
This enables using for http for S3 request for debugging or implementations that don't have https configured. This is not a problem for binary caches since they should not contain sensitive information. Both package signatures and AWS auth already protect against tampering.
2018-11-20Merge pull request #2216 from dtzWill/fix/curl-760-timeoutEelco Dolstra
download: if there are active requests, never sleep for 10s
2018-11-15Fix 'Read-only file system' when building a derivationEelco Dolstra
2018-11-13Restore parent mount namespace before executing a child processEelco Dolstra
This ensures that they can't write to /nix/store. Fixes #2535.
2018-11-07Enable sandboxing by defaultEelco Dolstra
Closes #179.
2018-11-01Disable the S3 content-encoding patchEelco Dolstra
Since we're not using multi-part uploads at the moment, we can drop this patch.
2018-10-31Merge pull request #2501 from mayflower/xdg_config_dirsEelco Dolstra
config: use all of XDG_CONFIG_DIRS
2018-10-31config: use all of XDG_CONFIG_DIRSLinus Heckemann
Previously, config would only be read from XDG_CONFIG_HOME. This change allows reading config from additional directories, which enables e.g. per-project binary caches or chroot stores with the help of direnv.
2018-10-30Remove redundant messageEelco Dolstra
2018-10-30S3BinaryCacheStore: Allow disabling multipart uploadsEelco Dolstra
The use of TransferManager has several issues, including that it doesn't allow setting a Content-Encoding without a patch, and it doesn't handle exceptions in worker threads (causing termination on memory allocation failure). Fixes #2493.
2018-10-30Fix broken uploadProgressCallback closureEelco Dolstra
Since the callback is global we can't refer to 'path' in it. This could cause a segfault or printing of arbitrary data.
2018-10-29copyStorePath: Fix hash errors when copying from older storeFalco Peijnenburg
This commit partially reverts 48662d151bdf4a38670897beacea9d1bd750376a. When copying from an older store (in my case a store running Nix 1.11.7), nix would throw errors about there being no hash. This is fixed by recalculating the hash.
2018-10-27Restore old (dis)allowedRequisites behaviour for self-referencesEelco Dolstra
stdenv relies on this. So ignore self-references (but only in legacy non-structured attributes mode).
2018-10-27Merge branch 'nix-doctor' of https://github.com/LnL7/nixEelco Dolstra
2018-10-26remote-store.hh: ConnectionHandle is struct, minor fix warningWill Dietz
2018-10-23Merge pull request #2483 from mayflower/tail-configEelco Dolstra
Promote verbose-build and log-lines
2018-10-23Promote log-lines to a fully-qualified optionLinus Heckemann
This allows commands like nix build --log-lines 30 nixpkgs.hello in order to obtain more information in case of a failure.
2018-10-23Per-output reference and closure size checksEelco Dolstra
In structured-attributes derivations, you can now specify per-output checks such as: outputChecks."out" = { # The closure of 'out' must not be larger than 256 MiB. maxClosureSize = 256 * 1024 * 1024; # It must not refer to C compiler or to the 'dev' output. disallowedRequisites = [ stdenv.cc "dev" ]; }; outputChecks."dev" = { # The 'dev' output must not be larger than 128 KiB. maxSize = 128 * 1024; }; Also fixed a bug in allowedRequisites that caused it to ignore self-references.
2018-10-16Fix assertion failure in Store::queryPathInfo()Eelco Dolstra
$ nix-store -qR /nix/store/fnord nix-store: src/libstore/store-api.cc:80: std::__cxx11::string nix::storePathToHash(const Path&): Assertion `base.size() >= storePathHashLen' failed. Aborted
2018-10-16RemoteStore: Close connection if an exception occursEelco Dolstra
Fixes #2075.
2018-10-16Get rid of UDSRemoteStore::ConnectionEelco Dolstra
Since its superclass RemoteStore::Connection contains 'to' and 'from' fields that refer to the file descriptor maintained in the subclass, it was possible for the flush() call in Connection::~Connection() to write to a closed file descriptor (or worse, a file descriptor now referencing another file). So make sure that the file descriptor survives 'to' and 'from'.
2018-09-28Check requiredSystemFeatures for local buildsEelco Dolstra
For example, this prevents a "kvm" build on machines that don't have KVM. Fixes #2012.
2018-09-28Move structured attrs handling into a separate classEelco Dolstra
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.