aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.hh
AgeCommit message (Collapse)Author
2024-03-29Fix various clang-tidy lintsJade Lovelace
* some things that can throw are marked noexcept yet the linter seems to think not. Maybe they can't throw in practice. I would rather not have the UB possibility in pretty obvious cold paths. * various default-case-missing complaints * a fair pile of casts from integer to character, which are in fact deliberate. * an instance of <https://clang.llvm.org/extra/clang-tidy/checks/bugprone/move-forwarding-reference.html> * bugprone-not-null-terminated-result on handing a string to curl in chunks of bytes. our usage is fine. * reassigning a unique_ptr by CRIMES instead of using release(), then using release() and ignoring the result. wild. let's use release() for its intended purpose. Change-Id: Ic3e7affef12383576213a8a7c8145c27e662513d
2023-08-18Fixing #7479John Ericson
Types converted: - `NixStringContextElem` - `OutputsSpec` - `ExtendedOutputsSpec` - `DerivationOutput` - `DerivationType` Existing ones mostly conforming the pattern cleaned up: - `ContentAddressMethod` - `ContentAddressWithReferences` The `DerivationGoal::derivationType` field had a bogus initialization, now caught, so I made it `std::optional`. I think #8829 can make it non-optional again because it will ensure we always have the derivation when we construct a `DerivationGoal`. See that issue (#7479) for details on the general goal. `git grep 'Raw::Raw'` indicates the two types I didn't yet convert `DerivedPath` and `BuiltPath` (and their `Single` variants) . This is because @roberth and I (can't find issue right now...) plan on reworking them somewhat, so I didn't want to churn them more just yet. Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2023-07-07Simplify `ContentAddress`John Ericson
Whereas `ContentAddressWithReferences` is a sum type complex because different varieties support different notions of reference, and `ContentAddressMethod` is a nested enum to support that, `ContentAddress` can be a simple pair of a method and hash. `ContentAddress` does not need to be a sum type on the outside because the choice of method doesn't effect what type of hashes we can use. Co-Authored-By: Cale Gibbard <cgibbard@gmail.com>
2023-05-09Improve error message for self reference with text hashingJohn Ericson
The `ContentAddressWithReferences` method is made total, with error handling now squarely the caller's job. This is better.
2023-05-09Cleanups to content address typesJohn Ericson
2023-05-09Apply suggestions from code review John Ericson
Thanks! Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-04-21Add more docs to `TextIngestionMethod` John Ericson
Thanks so much! Co-authored-by: Adam Joseph <54836058+amjoseph-nixpkgs@users.noreply.github.com>
2023-04-19Remove references from fixed output derivation ab syntaxJohn Ericson
In other words, use a plain `ContentAddress` not `ContentAddressWithReferences` for `DerivationOutput::CAFixed`. Supporting fixed output derivations with (fixed) references would be a cool feature, but it is out of scope at this moment.
2023-04-19Add a few more content addressing methodsJohn Ericson
Good to round out the library interface.
2023-04-17`TextHashMethod` -> `TextIngestionMethod`, gate with XP featureJohn Ericson
I suppose we can use `dynamic-derivations` for the few things we neeed.
2023-04-17Merge remote-tracking branch 'upstream/master' into ca-drv-exoticJohn Ericson
2023-04-07Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
2023-04-07Create `Derivation::fromJSON`John Ericson
And test, of course
2023-04-01Add comparison methods for content addressesJohn Ericson
2023-04-01Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-04-01Merge commit 'aa99005004bccc9be506a2a2f162f78bad4bcb41' into ca-drv-exoticJohn Ericson
2023-03-31Ensure all headers have `#pragma once` and are in API docsJohn Ericson
`///@file` makes them show up in the internal API dos. A tiny few were missing `#pragma once`.
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-03-30Merge remote-tracking branch 'upstream/master' into path-infoJohn Ericson
Also improve content-address.hh API docs.
2023-03-29Convert a bunch of comments in headers to Doxygen documentationJohn Ericson
The internal API docs now contain more useful information. Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2023-02-28Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-02-28No inheritance for `TextInfo` and `FixedOutputInfo`John Ericson
2023-01-23Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-23Don't add `StorePathDescriptor` for nowJohn Ericson
We don't need it yet, we can add it back later.
2023-01-14Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-14Make `ValidPathInfo` have plain `StorePathSet` references like beforeJohn Ericson
This change can wait for another PR.
2023-01-06Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2023-01-06Do big rename to clean up codeJohn Ericson
- `PathReferences` -> `References` - `PathReferences<StorePath>` -> `StoreReference` - `references` -> `others` - `hasSelfReference` -> `self` And get rid of silly subclassing
2023-01-06Make formatting consistentJohn Ericson
2022-04-19Slight cleanupsJohn Ericson
2022-04-19Merge branch 'path-info' into ca-drv-exoticJohn Ericson
2022-03-25Fill in missing comparison operators for content addressesJohn Ericson
2020-10-13Merge remote-tracking branch 'obsidian/path-info' into ca-drv-exoticJohn Ericson
2020-10-13Organize content-address.hh a bit betterJohn Ericson
2020-10-13Derivations can output "text-hashed" dataJohn Ericson
In particular, this means that derivations can output derivations. But that ramification isn't (yet!) useful as we would want, since there is no way to have a dependent derivation that is itself a dependent derivation.
2020-10-07Use PathReferences more widelyJohn Ericson
2020-09-17Add ContentAddressMethod and parse/render itRobert Hensing
2020-07-10Factor out commonality between nix-prefetch-url and nix-store --add-fixedEelco Dolstra
2020-06-19Merge remote-tracking branch 'me/no-stringly-typed-derivation-output' into ↵John Ericson
validPathInfo-ca-proper-datatype
2020-06-02Move file-hash to content-addressCarlo Nucera