about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-09-03 Add some noexceptsEelco Dolstra1-4/+5
This is to assert that callback functions should never throw (since the context in which they're called may not be able to handle the exception).
2019-09-03 Ensure that Callback is called only onceEelco Dolstra1-3/+5
Also, make Callback movable but uncopyable.
2019-08-28 Set maximum name length in NixMatthew Bauer1-0/+4
Previously we allowed any length of name for Nix derivations. This is bad because different file systems have different max lengths. To make things predictable, I have picked a max. This was done by trying to build this derivation: derivation { name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; builder = "/no-such-path"; system = "x86_64-linux"; } Take off one a and it will not lead to file name too long. That ends up being 212 a’s. An even smaller max could be picked if we want to support more file systems. Working backwards, this is why: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-${name}.drv.chroot > 255 - 32 - 1 - 4 - 7 = 211
2019-07-10 Revert "Fix 'error 9 while decompressing xz file'"Eelco Dolstra1-49/+45
This reverts commit 78fa47a7f08a4cb6ee7061bf0bd86a40e1d6dc91.
2019-07-02 checkStoreName: give more precise/verbose error informationGraham Christensen1-3/+10
$ sudo ./inst/bin/nix-instantiate -E '"${./.git}"' error: The path name '.git' is invalid: it is illegal to start the name with a period. Path names are alphanumeric and can include the symbols +-._?= and must not begin with a period. Note: If '.git' is a source file and you cannot rename it on disk, builtins.path { name = ... } can be used to give it an alternative name.
2019-06-24 Fix 'error 9 while decompressing xz file'Eelco Dolstra1-45/+49
Once we've started writing data to a Sink, we can't restart a download request, because then we end up writing duplicate data to the Sink. Therefore we shouldn't handle retries in Downloader but at a higher level (in particular, in copyStorePath()). Fixes #2952. (cherry picked from commit a67cf5a3585c41dd9f219a2c7aa9cf67fa69520b)
2019-02-25 Extract and expose splitUriAndParams functionDzmitry Zaitsau1-4/+12
which splits a URL into localtor and parameter parts
2019-01-18 unsupported(): Show the name of the unsupported operationEelco Dolstra1-2/+2
2018-10-29 copyStorePath: Fix hash errors when copying from older storeFalco Peijnenburg1-3/+7
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-16 Fix assertion failure in Store::queryPathInfo()Eelco Dolstra1-0/+2
$ 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-09-26 UntabifyEelco Dolstra1-1/+1
2018-08-21 Improve 'coroutine has finished' error messageEelco Dolstra1-0/+2
2018-08-03 Support escaping in store URIsEelco Dolstra1-2/+18
2018-07-24 copyPathsToStore: honour keep-goingLinus Heckemann1-2/+12
2018-05-30 Simplify the callback mechanismEelco Dolstra1-47/+41
2018-05-30 Modularize config settingsEelco Dolstra1-1/+1
Allow global config settings to be defined in multiple Config classes. For example, this means that libutil can have settings and evaluator settings can be moved out of libstore. The Config classes are registered in a new GlobalConfig class to which config files etc. are applied. Relevant to https://github.com/NixOS/nix/issues/2009 in that it removes the need for ad hoc handling of useCaseHack, which was the underlying cause of that issue.
2018-05-30 Fix assertion failure in storePathToHash()Eelco Dolstra1-0/+2
Fixes https://github.com/NixOS/nix/issues/2015.
2018-03-29 ValidPathInfo::isContentAddressed(): Ensure there are no referencesEelco Dolstra1-1/+2
2018-03-16 Reduce substitution memory consumptionEelco Dolstra1-21/+28
copyStorePath() now pipes the output of srcStore->narFromPath() directly into dstStore->addToStore(). The sink used by the former is converted into a source usable by the latter using boost::coroutine2. This is based on [1]. This reduces the maximum resident size of $ nix build --store ~/my-nix/ /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1 --substituters file:///tmp/binary-cache-xz/ --no-require-sigs from 418592 KiB to 53416 KiB. (The previous commit also reduced the runtime from ~4.2s to ~3.4s, not sure why.) A further improvement will be to download files into a Sink. [1] https://github.com/NixOS/nix/compare/master...Mathnerd314:dump-fix-coroutine#diff-dcbcac55a634031f9cc73707da6e4b18 Issue #1969.
2018-02-13 Allow plugins to define new settings.Shea Levy1-1/+1
2018-02-09 getDefaultSubstituters(): Skip broken substitutersEelco Dolstra1-1/+5
Fixes #1340.
2018-02-06 Add path primop.Shea Levy1-3/+2
builtins.path allows specifying the name of a path (which makes paths with store-illegal names now addable), allows adding paths with flat instead of recursive hashes, allows specifying a filter (so is a generalization of filterSource), and allows specifying an expected hash (enabling safe path adding in pure mode).
2017-11-24 nix path-info: Show URL of NARs in binary cachesEelco Dolstra1-0/+2
2017-11-20 nix copy: Abbreviate "daemon"Eelco Dolstra1-2/+2
2017-10-25 respect SIGINT in nix copy during the paths queries #1629AmineChikhaoui1-0/+1
2017-10-25 attempt to fix #1630: make the queries of store paths run in parallel using ↵AmineChikhaoui1-1/+8
a thread pool
2017-10-24 Allow shorter syntax for chroot storesEelco Dolstra1-3/+7
You can now say '--store /tmp/nix' instead of '--store local?root=/tmp/nix'.
2017-10-24 More progress indicator improvementsEelco Dolstra1-2/+10
Fixes #1599.
2017-10-18 Suppress "copying 0 paths" messageEelco Dolstra1-0/+2
2017-09-08 copyStorePath(): Fill in missing narHash regardless of checkSigsEelco Dolstra1-5/+1
I don't remember what the reasoning was here, but security is provided by the signatures, not by whether the hash is provided by the other store.
2017-08-28 Give activities a verbosity level againEelco Dolstra1-2/+2
And print them (separately from the progress bar) given sufficient -v flags.
2017-08-25 Allow activities to be nestedEelco Dolstra1-1/+3
In particular, this allows more relevant activities ("substituting X") to supersede inferior ones ("downloading X").
2017-08-16 Progress indicator: CleanupEelco Dolstra1-4/+3
2017-08-16 Progress indicator: Show number of active itemsEelco Dolstra1-1/+4
2017-08-16 Progress indicator: Unify "copying" and "substituting"Eelco Dolstra1-8/+3
They're the same thing after all. Example: $ nix build --store local?root=/tmp/nix nixpkgs.firefox-unwrapped [0/1 built, 49/98 copied, 16.3/92.8 MiB DL, 55.8/309.2 MiB copied] downloading 'https://cache.nixos.org/nar/0pl9li1jigcj2dany47hpmn0r3r48wc4nz48v5mqhh426lgz3bz6.nar.xz'
2017-08-16 nix copy: Improve progress indicatorEelco Dolstra1-4/+28
It now shows the amount of data copied: [8/1038 copied, 160.4/1590.9 MiB copied] copying path '...'
2017-08-16 nix copy: Revive progress barEelco Dolstra1-1/+25
2017-07-30 Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim1-13/+13
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-17 Fix accidental printErrorEelco Dolstra1-1/+1
2017-07-14 nix path-info: Show download sizes for binary cache storesEelco Dolstra1-7/+28
E.g. $ nix path-info --json --store https://cache.nixos.org nixpkgs.thunderbird -S ... "downloadHash": "sha256:1jlixpzi225wwa0f4xdrwrqgi47ip1qpj9p06fyxxg07sfmyi4q0", "downloadSize": 43047620, "closureDownloadSize": 84745960 } ]
2017-07-14 nix path-info: Don't barf on invalid pathsEelco Dolstra1-28/+34
Now you get [ { "path": "/nix/store/fzvliz4j5xzvnd0w5zgw2l0ksqh578yk-bla", "valid": false } ]
2017-07-04 Sort substituters by priorityEelco Dolstra1-0/+4
Fixes #1438.
2017-07-04 getDefaultSubstituters(): Simplify initialisationEelco Dolstra1-20/+14
As shlevy pointed out, static variables in C++11 have thread-safe initialisation.
2017-07-04 Support base-64 hashesEelco Dolstra1-9/+8
Also simplify the Hash API. Fixes #1437.
2017-07-03 Replace a few bool flags with enumsEelco Dolstra1-59/+32
Functions like copyClosure() had 3 bool arguments, which creates a severe risk of mixing up arguments. Also, implement copyClosure() using copyPaths().
2017-05-29 Fix nix-copy-closure testEelco Dolstra1-0/+1
Fixes client# error: size mismatch importing path ‘/nix/store/ywf5fihjlxwijm6ygh6s0a353b5yvq4d-libidn2-0.16’; expected 0, got 120264 This is mostly an artifact of the NixOS VM test environment, where the Nix database doesn't contain hashes/sizes. http://hydra.nixos.org/build/53537471
2017-05-16 Improve progress indicatorEelco Dolstra1-4/+5
2017-05-11 Fix typoEelco Dolstra1-1/+1
2017-05-08 Minor cleanupEelco Dolstra1-11/+13
2017-05-01 build-remote: Don't require signaturesEelco Dolstra1-5/+13
This restores the old behaviour.