aboutsummaryrefslogtreecommitdiff
path: root/perl/lib
AgeCommit message (Collapse)Author
2020-07-27Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-07-16Merge branch 'master' of github.com:NixOS/nix into ↵Carlo Nucera
optional-derivation-output-storepath
2020-07-15Merge branch 'master' of github.com:NixOS/nix into hash-always-has-typeCarlo Nucera
2020-07-13Remove 'accessor' from addToStore()Eelco Dolstra
This is only used by hydra-queue-runner and it's better to implement it there.
2020-07-12Try to fix perl bindingsJohn Ericson
2020-07-08Only store hash of fixed derivation outputMatthew Bauer
we don’t need a full storepath for a fixedoutput derivation. So just putting the ingestion method + the hash is sufficient.
2020-06-19WIP: Make Hash always store a valid hash typeJohn Ericson
2020-06-03libutils/hash: remove default encodingzimbatm
This will make it easier to reason about the hash encoding and switch to SRI everywhere where possible.
2020-03-30Get rid of FileIngestionMethod casts in perl bindings, tooJohn Ericson
2020-03-29Replace some `bool recursive` with a new `FileIngestionMethod` enumJohn Ericson
2020-03-10nix-perl: Fix segfault in queryPathInfo)Eelco Dolstra
2019-12-10Make the Store API more type-safeEelco Dolstra
Most functions now take a StorePath argument rather than a Path (which is just an alias for std::string). The StorePath constructor ensures that the path is syntactically correct (i.e. it looks like <store-dir>/<base32-hash>-<name>). Similarly, functions like buildPaths() now take a StorePathWithOutputs, rather than abusing Path by adding a '!<outputs>' suffix. Note that the StorePath type is implemented in Rust. This involves some hackery to allow Rust values to be used directly in C++, via a helper type whose destructor calls the Rust type's drop() function. The main issue is the dynamic nature of C++ move semantics: after we have moved a Rust value, we should not call the drop function on the original value. So when we move a value, we set the original value to bitwise zero, and the destructor only calls drop() if the value is not bitwise zero. This should be sufficient for most types. Also lots of minor cleanups to the C++ API to make it more modern (e.g. using std::optional and std::string_view in some places).
2019-11-26Clean up the configure scriptEelco Dolstra
2018-05-30Modularize config settingsEelco Dolstra
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.
2017-07-30Replace Unicode quotes in user-facing strings by ASCIIJörg Thalheim
Relevant RFC: NixOS/rfcs#4 $ ag -l | xargs sed -i -e "/\"/s/’/'/g;/\"/s/‘/'/g"
2017-07-04Support base-64 hashesEelco Dolstra
Also simplify the Hash API. Fixes #1437.
2017-04-26Simplify building nix-perl in nix-shellEelco Dolstra
2017-04-14Fix Perl bindingsEelco Dolstra
2017-04-13Convert Settings to the new config systemEelco Dolstra
This makes all config options self-documenting. Unknown or unparseable config settings and --option flags now cause a warning.
2017-04-13Initialise loggerEelco Dolstra
2017-03-31Merge branch 'remove-perl' of https://github.com/shlevy/nixEelco Dolstra
2017-03-21Restore cache.nixos.org as the default substituterEelco Dolstra
Fixes #1283.
2017-02-16Move netrcFile to SettingsEelco Dolstra
Also get rid of Settings::processEnvironment(), it appears to be useless.
2017-02-07Add nix-perl package for the perl bindingsShea Levy
2016-11-26Revert "Get rid of unicode quotes (#1140)"Eelco Dolstra
This reverts commit f78126bfd6b6c8477fcdbc09b2f98772dbe9a1e7. There really is no need for such a massive change...
2016-11-25Get rid of unicode quotes (#1140)Guillaume Maudoux
2016-07-26makeFixedOutputPath(): Drop superfluous HashType argumentEelco Dolstra
2016-06-01Make the store directory a member variable of StoreEelco Dolstra
2016-05-31nix-copy-closure / build-remote.pl: Disable signature checkingEelco Dolstra
This restores the Nix 1.11 behaviour.
2016-05-31nix-copy-closure: Drop Nix <= 1.7 compatEelco Dolstra
2016-05-04Fix segfault in nix-copy-closureEelco Dolstra
2016-05-04Remove OpenSSL-based signingEelco Dolstra
2016-04-19Move path info caching from BinaryCacheStore to StoreEelco Dolstra
Caching path info is generally useful. For instance, it speeds up "nix path-info -rS /run/current-system" (i.e. showing the closure sizes of all paths in the closure of the current system) from 5.6s to 0.15s. This also eliminates some APIs like Store::queryDeriver() and Store::queryReferences().
2016-04-11Remove manifest supportEelco Dolstra
Manifests have been superseded by binary caches for years. This also gets rid of nix-pull, nix-generate-patches and bsdiff/bspatch.
2016-02-26importPaths(): Optionally add NARs to binary cache accessorEelco Dolstra
This enables an optimisation in hydra-queue-runner, preventing a download of a NAR it just uploaded to the cache when reading files like hydra-build-products.
2016-02-16Add C++ functions for .narinfo processing / signingEelco Dolstra
This is currently only used by the Hydra queue runner rework, but like eff5021eaa6dc69f65ea1a8abe8f3ab11ef5eb0a it presumably will be useful for the C++ rewrite of nix-push and download-from-binary-cache. (@shlevy)
2016-02-16Rename ValidPathInfo::hash -> narHash for consistencyEelco Dolstra
2016-02-15Fix nix-copy-closureEelco Dolstra
http://hydra.nixos.org/build/32005971
2016-02-04StoreAPI -> StoreEelco Dolstra
Calling a class an API is a bit redundant...
2016-02-04Eliminate the "store" global variableEelco Dolstra
Also, move a few free-standing functions into StoreAPI and Derivation. Also, introduce a non-nullable smart pointer, ref<T>, which is just a wrapper around std::shared_ptr ensuring that the pointer is never null. (For reference-counted values, this is better than passing a "T&", because the latter doesn't maintain the refcount. Usually, the caller will have a shared_ptr keeping the value alive, but that's not always the case, e.g., when passing a reference to a std::thread via std::bind.)
2016-01-07Fix bad use of croak()Eelco Dolstra
Detected by -Werror=format-security. http://hydra.nixos.org/build/29973207
2015-10-09Provide addTempRoot in the Perl APIEelco Dolstra
Needed by Hydra.
2015-06-03Handle base-16 NarHash fields in signed .narinfo filesEelco Dolstra
2015-06-03Be more robust wrt broken .narinfo filesEelco Dolstra
2015-06-01Include the cache.nixos.org signing key by defaultEelco Dolstra
2015-03-25addToStore(): Take explicit name argumentEelco Dolstra
2015-03-04Reduce verbosity in build-remote.plEelco Dolstra
2015-02-17Include NAR size in fingerprint computationEelco Dolstra
This is not strictly needed for integrity (since we already include the NAR hash in the fingerprint) but it helps against endless data attacks [1]. (However, this will also require download-from-binary-cache.pl to bail out if it receives more than the specified number of bytes.) [1] https://isis.poly.edu/~jcappos/papers/cappos_mirror_ccs_08.pdf
2015-02-10Make libsodium an optional dependencyEelco Dolstra
2015-02-04Sign a subset of the .narinfoEelco Dolstra
We only need to sign the store path, NAR hash and references (the "fingerprint"). Everything else is irrelevant to security. For instance, the compression algorithm or the hash of the compressed NAR don't matter as long as the contents of the uncompressed NAR are correct. (Maybe we should include derivers in the fingerprint, but they're broken and nobody cares about them. Also, it might be nice in the future if .narinfos contained signatures from multiple independent signers. But that's impossible if the deriver is included in the fingerprint, since everybody will tend to have a different deriver for the same store path.) Also renamed the "Signature" field to "Sig" since the format changed in an incompatible way.