aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 18:30:02 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 18:40:30 -0400
commitd5cef6c33a051dfc672cb1e5f4739948b167315b (patch)
tree256fb271fa069106186c5c89214db03acf81a673 /src/nix
parente12308dd63f0ad27b22dcdb3da89c411eebcad2b (diff)
parent9dfb97c987d8b9d6a3d15f016e40f22f91deb764 (diff)
Merge commit '9dfb97c987d8b9d6a3d15f016e40f22f91deb764' into path-info
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/bundle.cc4
-rw-r--r--src/nix/develop.cc3
-rw-r--r--src/nix/flake.cc5
-rw-r--r--src/nix/profile.cc15
-rw-r--r--src/nix/run.cc2
5 files changed, 17 insertions, 12 deletions
diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc
index 48f4eb6e3..e86fbb3f7 100644
--- a/src/nix/bundle.cc
+++ b/src/nix/bundle.cc
@@ -70,7 +70,7 @@ struct CmdBundle : InstallableCommand
auto evalState = getEvalState();
auto app = installable->toApp(*evalState);
- store->buildPaths(app.context);
+ store->buildPaths(toBuildableReqs(app.context));
auto [bundlerFlakeRef, bundlerName] = parseFlakeRefWithFragment(bundler, absPath("."));
const flake::LockFlags lockFlags{ .writeLockFile = false };
@@ -110,7 +110,7 @@ struct CmdBundle : InstallableCommand
StorePath outPath = store->parseStorePath(evalState->coerceToPath(*attr2->pos, *attr2->value, context2));
- store->buildPaths({{drvPath}});
+ store->buildPaths({ BuildableReqFromDrv { drvPath } });
auto outPathS = store->printStorePath(outPath);
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index d0b140570..616e2073e 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -3,6 +3,7 @@
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
+#include "path-with-outputs.hh"
#include "derivations.hh"
#include "affinity.hh"
#include "progress-bar.hh"
@@ -159,7 +160,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
auto shellDrvPath = writeDerivation(*store, drv);
/* Build the derivation. */
- store->buildPaths({{shellDrvPath}});
+ store->buildPaths({BuildableReqFromDrv{shellDrvPath}});
for (auto & [_0, outputAndOptPath] : drv.outputsAndOptPaths(*store)) {
auto & [_1, optPath] = outputAndOptPath;
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index a2b6c0303..9d6d22a43 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -7,6 +7,7 @@
#include "get-drvs.hh"
#include "store-api.hh"
#include "derivations.hh"
+#include "path-with-outputs.hh"
#include "attr-path.hh"
#include "fetchers.hh"
#include "registry.hh"
@@ -292,7 +293,7 @@ struct CmdFlakeCheck : FlakeCommand
}
};
- std::vector<StorePathWithOutputs> drvPaths;
+ std::vector<BuildableReq> drvPaths;
auto checkApp = [&](const std::string & attrPath, Value & v, const Pos & pos) {
try {
@@ -461,7 +462,7 @@ struct CmdFlakeCheck : FlakeCommand
fmt("%s.%s.%s", name, attr.name, attr2.name),
*attr2.value, *attr2.pos);
if ((std::string) attr.name == settings.thisSystem.get())
- drvPaths.push_back({drvPath});
+ drvPaths.push_back(BuildableReqFromDrv{drvPath});
}
}
}
diff --git a/src/nix/profile.cc b/src/nix/profile.cc
index bd1be44e6..502a6b2a3 100644
--- a/src/nix/profile.cc
+++ b/src/nix/profile.cc
@@ -242,7 +242,7 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
{
ProfileManifest manifest(*getEvalState(), *profile);
- std::vector<StorePathWithOutputs> pathsToBuild;
+ std::vector<BuildableReq> pathsToBuild;
for (auto & installable : installables) {
if (auto installable2 = std::dynamic_pointer_cast<InstallableFlake>(installable)) {
@@ -258,7 +258,7 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
attrPath,
};
- pathsToBuild.push_back({drv.drvPath, StringSet{drv.outputName}});
+ pathsToBuild.push_back(BuildableReqFromDrv{drv.drvPath, StringSet{drv.outputName}});
manifest.elements.emplace_back(std::move(element));
} else {
@@ -269,12 +269,15 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
std::visit(overloaded {
[&](BuildableOpaque bo) {
- pathsToBuild.push_back({bo.path, {}});
+ pathsToBuild.push_back(bo);
element.storePaths.insert(bo.path);
},
[&](BuildableFromDrv bfd) {
+ // TODO: Why are we querying if we know the output
+ // names already? Is it just to figure out what the
+ // default one is?
for (auto & output : store->queryDerivationOutputMap(bfd.drvPath)) {
- pathsToBuild.push_back({bfd.drvPath, {output.first}});
+ pathsToBuild.push_back(BuildableReqFromDrv{bfd.drvPath, {output.first}});
element.storePaths.insert(output.second);
}
},
@@ -397,7 +400,7 @@ struct CmdProfileUpgrade : virtual SourceExprCommand, MixDefaultProfile, MixProf
auto matchers = getMatchers(store);
// FIXME: code duplication
- std::vector<StorePathWithOutputs> pathsToBuild;
+ std::vector<BuildableReq> pathsToBuild;
for (size_t i = 0; i < manifest.elements.size(); ++i) {
auto & element(manifest.elements[i]);
@@ -432,7 +435,7 @@ struct CmdProfileUpgrade : virtual SourceExprCommand, MixDefaultProfile, MixProf
attrPath,
};
- pathsToBuild.push_back({drv.drvPath, StringSet{"out"}}); // FIXME
+ pathsToBuild.push_back(BuildableReqFromDrv{drv.drvPath, {"out"}}); // FIXME
}
}
diff --git a/src/nix/run.cc b/src/nix/run.cc
index ec9388234..2e9bb41cc 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -182,7 +182,7 @@ struct CmdRun : InstallableCommand, RunCommon
auto app = installable->toApp(*state);
- state->store->buildPaths(app.context);
+ state->store->buildPaths(toBuildableReqs(app.context));
Strings allArgs{app.program};
for (auto & i : args) allArgs.push_back(i);