forked from lix-project/lix
move unsafeDiscardReferences
out of outputChecks
It's not a check.
This commit is contained in:
parent
15f7fa59be
commit
3c968191f1
|
@ -26,7 +26,7 @@
|
||||||
to disable scanning a given output for runtime dependencies:
|
to disable scanning a given output for runtime dependencies:
|
||||||
```nix
|
```nix
|
||||||
__structuredAttrs = true;
|
__structuredAttrs = true;
|
||||||
outputChecks.out.unsafeDiscardReferences = true;
|
unsafeDiscardReferences.out = true;
|
||||||
```
|
```
|
||||||
This is useful e.g. when generating self-contained filesystem images with
|
This is useful e.g. when generating self-contained filesystem images with
|
||||||
their own embedded Nix store: hashes found inside such an image refer
|
their own embedded Nix store: hashes found inside such an image refer
|
||||||
|
|
|
@ -2321,14 +2321,12 @@ DrvOutputs LocalDerivationGoal::registerOutputs()
|
||||||
|
|
||||||
bool discardReferences = false;
|
bool discardReferences = false;
|
||||||
if (auto structuredAttrs = parsedDrv->getStructuredAttrs()) {
|
if (auto structuredAttrs = parsedDrv->getStructuredAttrs()) {
|
||||||
if (auto outputChecks = get(*structuredAttrs, "outputChecks")) {
|
if (auto udr = get(*structuredAttrs, "unsafeDiscardReferences")) {
|
||||||
if (auto output = get(*outputChecks, outputName)) {
|
|
||||||
if (auto unsafeDiscardReferences = get(*output, "unsafeDiscardReferences")) {
|
|
||||||
settings.requireExperimentalFeature(Xp::DiscardReferences);
|
settings.requireExperimentalFeature(Xp::DiscardReferences);
|
||||||
if (!unsafeDiscardReferences->is_boolean())
|
if (auto output = get(*udr, outputName)) {
|
||||||
throw Error("attribute 'outputChecks.\"%s\".unsafeDiscardReferences' of derivation '%s' must be a Boolean", outputName, drvPath.to_string());
|
if (!output->is_boolean())
|
||||||
discardReferences = unsafeDiscardReferences->get<bool>();
|
throw Error("attribute 'unsafeDiscardReferences.\"%s\"' of derivation '%s' must be a Boolean", outputName, drvPath.to_string());
|
||||||
}
|
discardReferences = output->get<bool>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,10 +69,8 @@ rec {
|
||||||
|
|
||||||
test11 = makeTest 11 {
|
test11 = makeTest 11 {
|
||||||
__structuredAttrs = true;
|
__structuredAttrs = true;
|
||||||
outputChecks.out = {
|
unsafeDiscardReferences.out = true;
|
||||||
unsafeDiscardReferences = true;
|
outputChecks.out.allowedReferences = [];
|
||||||
allowedReferences = [];
|
|
||||||
};
|
|
||||||
buildCommand = ''echo ${dep} > "''${outputs[out]}"'';
|
buildCommand = ''echo ${dep} > "''${outputs[out]}"'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue