New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly store the outputs of CA derivations − take 2 #4330
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,9 @@ private: | |
|
||
protected: | ||
|
||
// The prefix under which realisation infos will be stored | ||
const std::string realisationsPrefix = "/realisations"; | ||
|
||
BinaryCacheStore(const Params & params); | ||
|
||
public: | ||
|
@@ -99,6 +102,10 @@ public: | |
StorePath addTextToStore(const string & name, const string & s, | ||
const StorePathSet & references, RepairFlag repair) override; | ||
|
||
void registerDrvOutput(const Realisation & info) override; | ||
|
||
std::optional<const Realisation> queryRealisation(const DrvOutput &) override; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you're okay with it, I'll rather just change the daemon protocol to allow passing a list as it's the only place in which we can't break backwards compat for free, and it makes more sense to me to make it clear that we can only return one realisation for the time being as long as there's nothing preventing us from changing that in the future |
||
|
||
void narFromPath(const StorePath & path, Sink & sink) override; | ||
|
||
BuildResult buildDerivation(const StorePath & drvPath, const BasicDerivation & drv, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Extension of the sql schema for content-addressed derivations. | ||
-- Won't be loaded unless the experimental feature `ca-derivations` | ||
-- is enabled | ||
|
||
create table if not exists Realisations ( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The word "realisations" seems a bit confusing. What does it realise? In Nix, "realise" is already a vague and overloaded term for "substituting or building a derivation". There is also a terminology mismatch between How about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's indeed a terminology mismatch and we need to settle on one thing. I really like I tend to use (also, they aren't really TL;DR, I'm fine changing the naming, but for my own sanity (and other's too) I think we need to find clear and distinct names for
|
||
drvPath text not null, | ||
outputName text not null, -- symbolic output id, usually "out" | ||
outputPath integer not null, | ||
primary key (drvPath, outputName), | ||
foreign key (outputPath) references ValidPaths(id) on delete cascade | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does
doi
mean?BTW this URL format means that there can be only one mapping per realisation, which is probably fine for a binary cache, but it does mean you can't take the union of two binary caches (e.g. a mirror of multiple upstream binary caches) - or at least not of their
/realisations
directory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doi
stands for “derivation output info” (it's indeed quite obscure).Yes, I agree on the uniqueness constraint that might be somehow too strong. But I think we'll have time to rework this schema − it's experimental anyways, so nothing is set in any way, and it's not really clear to me atm how we could have a sensible implementation if we drop it.