aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/nar-info.cc
AgeCommit message (Collapse)Author
2024-08-08refactor: make HashType and Base enum classes for type safetyJade Lovelace
Change-Id: I9fbd55a9d50464a56fe11cb42a06a206914150d8
2023-04-18Make "NAR info file is corrupt" messages more informativeMichal Sojka
Recently, I encountered the "NAR info file 'xxxx' is corrupt" error with my binary cache. The message is not helpful in determining, which kind of corruption happened. The file, fetched with curl, looked reasonably. This commit adds more information to the error message, which should allow debugging and hopefully fixing the problem.
2023-03-30Use "raw pattern" for content address typesJohn Ericson
We weren't because this ancient PR predated it! This is actually a new version of the pattern which addresses some issues identified in #7479.
2023-01-14Make `ValidPathInfo` have plain `StorePathSet` references like beforeJohn Ericson
This change can wait for another PR.
2023-01-06Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-06-23libstore/nar-info: drop unused system fieldCole Helbling
This was unused everywhere (and even the official NixOS binary cache did not produce .narinfo files containing a "System:" field).
2022-03-10Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2022-02-25Remove std::string alias (for real this time)Eelco Dolstra
Also use std::string_view in a few more places.
2021-02-25Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2021-01-08string2Int(): Return std::optionalEelco Dolstra
2020-09-23Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2020-08-06Minimize the usage of `Hash::dummy`John Ericson
2020-08-05Remove Hash::operator bool ()Carlo Nucera
Since the hash is not optional anymore
2020-08-05Remove optionality in ValidPathInfo::narInfoCarlo Nucera
2020-08-04Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2020-08-01Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2020-07-02Merge branch 'hash-always-has-type' into HEADJohn Ericson
2020-07-02Fix Narinfo corruption detection bugJohn Ericson
The aim of this check was just to ensure each key occurs once.
2020-07-01Rename two hash constructors to proper functionsCarlo Nucera
2020-06-29Fix nar info parsingJohn Ericson
2020-06-25Move ValidPathInfo to its own headerJohn Ericson
2020-06-23Merge remote-tracking branch 'upstream/master' into hash-always-has-typeJohn Ericson
2020-06-19WIP: Make Hash always store a valid hash typeJohn Ericson
2020-06-18Merge branch 'validPathInfo-temp' into validPathInfo-ca-proper-datatypeJohn Ericson
2020-06-16Remove StorePath::clone() and related functionsEelco Dolstra
2020-06-16StorePath: Rewrite in C++Eelco Dolstra
On nix-env -qa -f '<nixpkgs>', this reduces maximum RSS by 20970 KiB and runtime by 0.8%. This is mostly because we're not parsing the hash part as a hash anymore (just validating that it consists of base-32 characters). Also, replace storePathToHash() by StorePath::hashPart().
2020-06-11Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
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-06-02Change parseCa(Opt) to parseContentAddress(Opt)Carlo Nucera
2020-06-02WIPJohn Ericson
2020-06-01Merge branch 'no-stringly-typed-derivation-output' of ↵Carlo Nucera
github.com:Ericson2314/nix into validPathInfo-ca-proper-datatype
2020-04-21remove 'format' from Error constructor callsBen Burdette
2020-03-29Use `enum struct` and drop prefixesJohn Ericson
This does a few enums; the rest will be gotten in subsequent commits.
2020-03-25Extend Rust FFIJohn Ericson
Do idiomatic C++ copy and move constructors for a few things, so wrapping structs' defaults can work.
2020-01-21Fix derivation computation with __structuredAttrs and multiple outputsEelco Dolstra
Fixes error: derivation '/nix/store/klivma7r7h5lndb99f7xxmlh5whyayvg-zlib-1.2.11.drv' has incorrect output '/nix/store/fv98nnx5ykgbq8sqabilkgkbc4169q05-zlib-1.2.11-dev', should be '/nix/store/adm7pilzlj3z5k249s8b4wv3scprhzi1-zlib-1.2.11-dev'
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).
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-03-28Ignore broken "Deriver: unknown-deriver" fields in .narinfoEelco Dolstra
These were generated by a legacy tool.
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-08-10Mark content-addressed paths in the Nix database and in .narinfoEelco Dolstra
This allows such paths to be imported without signatures.
2016-07-21NarInfo::NarInfo(): Ensure that we get a NAR size/hashEelco Dolstra
2016-06-01Make the store directory a member variable of StoreEelco Dolstra
2016-05-31Fix clang build failureEelco Dolstra
Apparently opinion is divided on whether [[noreturn]] is allowed on a lambda: http://stackoverflow.com/questions/26888805/how-to-declare-a-lambdas-operator-as-noreturn http://hydra.nixos.org/build/36462100
2016-04-20Cache path info lookups in SQLiteEelco Dolstra
This re-implements the binary cache database in C++, allowing it to be used by other Store backends, in particular the S3 backend.
2016-03-24Move signature support from NarInfo to ValidPathInfoEelco Dolstra
2016-03-21Move signatures from NarInfo to ValidPathInfoEelco Dolstra
This allows queryPathInfo() to return signatures.
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)