mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Reserve the __contentAddressed
derivation parameter
Not implementing anything here, just throwing an error if a derivation sets `__contentAddressed = true` without `--experimental-features content-addressed-paths` (and also with it as there's nothing implemented yet)
This commit is contained in:
parent
ccbea8255c
commit
56d75bf4fc
3 changed files with 18 additions and 0 deletions
|
@ -809,6 +809,9 @@ private:
|
|||
/* Whether this is a fixed-output derivation. */
|
||||
bool fixedOutput;
|
||||
|
||||
/* Whether this is a content adressed derivation */
|
||||
bool contentAddressed = false;
|
||||
|
||||
/* Whether to run the build in a private network namespace. */
|
||||
bool privateNetwork = false;
|
||||
|
||||
|
@ -1195,6 +1198,14 @@ void DerivationGoal::haveDerivation()
|
|||
|
||||
parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *drv);
|
||||
|
||||
contentAddressed = parsedDrv->contentAddressed();
|
||||
|
||||
if (this->contentAddressed) {
|
||||
settings.requireExperimentalFeature("content-addressed-paths");
|
||||
throw Error("content-addressed-paths isn't implemented yet");
|
||||
}
|
||||
|
||||
|
||||
/* We are first going to try to create the invalid output paths
|
||||
through substitutes. If that doesn't work, we'll build
|
||||
them. */
|
||||
|
|
|
@ -117,4 +117,9 @@ bool ParsedDerivation::substitutesAllowed() const
|
|||
return getBoolAttr("allowSubstitutes", true);
|
||||
}
|
||||
|
||||
bool ParsedDerivation::contentAddressed() const
|
||||
{
|
||||
return getBoolAttr("__contentAddressed", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ public:
|
|||
bool willBuildLocally() const;
|
||||
|
||||
bool substitutesAllowed() const;
|
||||
|
||||
bool contentAddressed() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue