aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-17 18:28:26 +0200
committerGitHub <noreply@github.com>2020-06-17 18:28:26 +0200
commit2f51cd8dc95231b2e2f5b3bd75ac6d8d2dece361 (patch)
treee54d8aebc89cfb0cd1f9c9e1728884d1c7d96587 /src
parent4d5169bdd507b12d8fe0a1cab89b5d81a43e6de5 (diff)
parent480b54e1c6a200a2d4a39c1fa24fa195db12953f (diff)
Merge pull request #3710 from tweag/reserve_ca_derivations
Reserve the `__contentAddressed` derivation parameter
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc6
-rw-r--r--src/libstore/parsed-derivations.cc5
-rw-r--r--src/libstore/parsed-derivations.hh2
3 files changed, 13 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 53a0958aa..e1d812b09 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1195,6 +1195,12 @@ void DerivationGoal::haveDerivation()
parsedDrv = std::make_unique<ParsedDerivation>(drvPath, *drv);
+ if (parsedDrv->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. */
diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc
index 24f848e46..c7797b730 100644
--- a/src/libstore/parsed-derivations.cc
+++ b/src/libstore/parsed-derivations.cc
@@ -117,4 +117,9 @@ bool ParsedDerivation::substitutesAllowed() const
return getBoolAttr("allowSubstitutes", true);
}
+bool ParsedDerivation::contentAddressed() const
+{
+ return getBoolAttr("__contentAddressed", false);
+}
+
}
diff --git a/src/libstore/parsed-derivations.hh b/src/libstore/parsed-derivations.hh
index 7621342d7..d24d1eb4f 100644
--- a/src/libstore/parsed-derivations.hh
+++ b/src/libstore/parsed-derivations.hh
@@ -34,6 +34,8 @@ public:
bool willBuildLocally() const;
bool substitutesAllowed() const;
+
+ bool contentAddressed() const;
};
}