about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-08-16 nix-store: fix out of sync protocolzimbatm1-2/+10
If a NAR is already in the store, addToStore doesn't read the source which makes the protocol go out of sync. This happens for example when two client try to nix-copy-closure the same derivation at the same time.
2019-03-14 nix-store --gc --print-roots: Sort outputEelco Dolstra1-1/+5
2019-03-14 findRoots(): Add 'censor' parameterEelco Dolstra1-2/+2
This is less brittle than filtering paths after the fact in nix-daemon.
2019-03-10 unify naming of roots as links & targetsGuillaume Maudoux1-6/+6
2019-03-10 Also print rooted path in `nix-store -q --roots`Guillaume Maudoux1-1/+1
2019-03-10 fixup! Make roots a map of store paths to pinning linksGuillaume Maudoux1-3/+3
2019-03-10 Make roots a map of store paths to pinning linksGuillaume Maudoux1-5/+7
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-01-23 nix-store: make --dump-db take a list of paths to dumpSpencer Baugh1-5/+10
Inside a derivation, exportReferencesGraph already provides a way to dump the Nix database for a specific closure. On the command line, --dump-db gave us the same information, but only for the entire Nix database at once. With this change, one can now pass a list of paths to --dump-db to get the Nix database dumped for just those paths. (The user is responsible for ensuring this is a closure, like for --export). Among other things, this is useful for deploying a closure to a new host without using --import/--export; one can use tar to transfer the store paths, and --dump-db/--load-db to transfer the validity information. This is useful if the new host doesn't actually have Nix yet, and the closure that is being deployed itself contains Nix.
2018-12-15 nix-store: remove debugging printWill Dietz1-3/+0
2018-12-13 Support SRI hashesEelco Dolstra1-0/+3
SRI hashes (https://www.w3.org/TR/SRI/) combine the hash algorithm and a base-64 hash. This allows more concise and standard hash specifications. For example, instead of import <nix/fetchurl.nl> { url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz; sha256 = "5d22dad058d5c800d65a115f919da22938c50dd6ba98c5e3a183172d149840a4"; }; you can write import <nix/fetchurl.nl> { url = https://nixos.org/releases/nix/nix-2.1.3/nix-2.1.3.tar.xz; hash = "sha256-XSLa0FjVyADWWhFfkZ2iKTjFDda6mMXjoYMXLRSYQKQ="; }; In fixed-output derivations, the outputHashAlgo is no longer mandatory if outputHash specifies the hash (either as an SRI or in the old "<type>:<hash>" format). 'nix hash-{file,path}' now print hashes in SRI format by default. I also reverted them to use SHA-256 by default because that's what we're using most of the time in Nixpkgs. Suggested by @zimbatm.
2018-10-26 Merge all nix-* binaries into nixEelco Dolstra1-5/+8
These are all symlinks to 'nix' now, reducing the installed size by about ~1.7 MiB.
2018-10-20 Remove the `--xml` query command optionAntoine Eiche1-13/+1
The `--graphml` option can be used instead.
2018-10-20 Add --graphml option to the nix-store --query commandAntoine Eiche1-1/+13
This prints the references graph of the store paths in the graphML format [1]. The graphML format is supported by several graph tools such as the Python Networkx library or the Apache Thinkerpop project. [1] http://graphml.graphdrawing.org
2018-08-03 Make adding paths via nix-store --serve run in constant memoryEelco Dolstra1-0/+22
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 cmdDumpStorePath: Support chroot storesEelco Dolstra1-1/+1
2018-03-02 Merge branch 'write-failure-fixes' of git://github.com/lheckemann/nixShea Levy1-0/+2
2018-02-13 Fix #1762Linus Heckemann1-0/+2
nix-store --export, nix-store --dump, and nix dump-path would previously fail silently if writing the data out failed, because a) FdSink::write ignored exceptions, and b) the commands relied on FdSink's destructor, which ignores exceptions, to flush the data out. This could cause rather opaque issues with installing nixos, because nix-store --export would happily proceed even if it couldn't write its data out (e.g. if nix-store --import on the other side of the pipe failed). This commit adds tests that expose these issues in the nix-store commands, and fixes them for all three.
2018-02-08 Add plugins to make Nix more extensible.Shea Levy1-0/+2
All plugins in plugin-files will be dlopened, allowing them to statically construct instances of the various Register* types Nix supports.
2018-02-03 Remove nix-build --hashEelco Dolstra1-1/+0
Instead, if a fixed-output derivation produces has an incorrect output hash, we now unconditionally move the outputs to the path corresponding with the actual hash and register it as valid. Thus, after correcting the hash in the Nix expression (e.g. in a fetchurl call), the fixed-output derivation doesn't have to be built again. It would still be good to have a command for reporting the actual hash of a fixed-output derivation (instead of throwing an error), but "nix-build --hash" didn't do that.
2017-10-25 Pass lists/attrsets to bash as (associative) arraysEelco Dolstra1-10/+1
2017-09-08 LegacySSHStore: Include signatures etc.Eelco Dolstra1-0/+2
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-24/+24
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-04 Support base-64 hashesEelco Dolstra1-4/+4
Also simplify the Hash API. Fixes #1437.
2017-07-03 Replace a few bool flags with enumsEelco Dolstra1-4/+4
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-04-26 DohEelco Dolstra1-1/+1
2017-04-13 Convert Settings to the new config systemEelco Dolstra1-4/+4
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13 Merge branch 'rework-options' of https://github.com/copumpkin/nixEelco Dolstra1-1/+1
2017-03-31 Merge branch 'remove-perl' of https://github.com/shlevy/nixEelco Dolstra1-1/+1
2017-03-15 Store: Add a method for getting build logsEelco Dolstra1-52/+5
This allows various Store implementations to provide different ways to get build logs. For example, BinaryCacheStore can get the build logs from the binary cache. Also, remove the log-servers option since we can use substituters for this.
2017-03-01 nix-store --import: Fix importing unsigned pathsEelco Dolstra1-1/+1
2017-03-01 Fix assertion failure in nix-store --exportEelco Dolstra1-0/+3
Fixes #1173.
2017-03-01 Handle importing NARs containing files greater than 4 GiBEelco Dolstra1-1/+1
Also templatize readInt() to work for various integer types.
2017-02-22 Explicitly model all settings and fail on unrecognized onesDan Peebles1-1/+1
Previously, the Settings class allowed other code to query for string properties, which led to a proliferation of code all over the place making up new options without any sort of central registry of valid options. This commit pulls all those options back into the central Settings class and removes the public get() methods, to discourage future abuses like that. Furthermore, because we know the full set of options ahead of time, we now fail loudly if someone enters an unrecognized option, thus preventing subtle typos. With some template fun, we could probably also dump the full set of options (with documentation, defaults, etc.) to the command line, but I'm not doing that yet here.
2017-02-07 Remove perl dependency.Shea Levy1-1/+1
Fixes #341
2017-02-07 Remove unnecessary call to topoSortPaths()Eelco Dolstra1-3/+1
exportPaths() already does this.
2016-12-07 Add a hook to run diffoscope when non-determinism is detectedEelco Dolstra1-0/+1
2016-12-07 Keep track of the exact build start/stop timesEelco Dolstra1-1/+1
2016-12-07 Expose enforce-determinism and the result to HydraEelco Dolstra1-1/+6
2016-12-06 nix-store --serve: Suppress log output on stderr when repeating a buildEelco Dolstra1-0/+1
2016-12-06 nix-store --serve: Support setting build-repeatEelco Dolstra1-0/+2
This allows Hydra to test whether builds are reproducible.
2016-11-26 Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra1-25/+25
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25 Get rid of unicode quotes (#1140)Guillaume Maudoux1-25/+25
2016-11-10 Store::computeFSClosure(): Support a set of pathsEelco Dolstra1-7/+5
This way, callers can exploits the parallelism of computeFSClosure() when they have multiple paths that they need the (combined) closure of.
2016-09-21 printMsg(lvlError, ...) -> printError(...) etc.Eelco Dolstra1-3/+3
2016-08-10 Add a "root" parameter to local storesEelco Dolstra1-2/+6
This makes it easier to create a diverted store, i.e. NIX_REMOTE="local?root=/tmp/root" instead of NIX_REMOTE="local?real=/tmp/root/nix/store&state=/tmp/root/nix/var/nix" NIX_LOG_DIR=/tmp/root/nix/var/log
2016-07-26 makeFixedOutputPath(): Drop superfluous HashType argumentEelco Dolstra1-2/+1
2016-06-02 Allow setting the state directory as a store parameterEelco Dolstra1-14/+20
E.g. "local?store=/tmp/store&state=/tmp/var".
2016-06-01 Make the store directory a member variable of StoreEelco Dolstra1-25/+25
2016-05-31 nix-copy-closure / build-remote.pl: Disable signature checkingEelco Dolstra1-1/+1
This restores the Nix 1.11 behaviour.
2016-05-04 Cleanup: Remove singleton()Eelco Dolstra1-4/+4