aboutsummaryrefslogtreecommitdiff
path: root/src/nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 19:06:43 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-04-05 19:06:43 -0400
commitd0ed11ca729344fd00251d0bc31f0c2f32d2c6a7 (patch)
tree4f1f16db781f31d4e705e87c70ed485dac3260bb /src/nix
parent386765e3ffc3b3c5721f63696e41a1cf90c1e6ae (diff)
parent1b6cf0d5f56e166a1cbbf38142375b7a92fc88f2 (diff)
Merge commit '1b6cf0d5f56e166a1cbbf38142375b7a92fc88f2' into ca-drv-exotic
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/build.cc8
-rw-r--r--src/nix/bundle.cc4
-rw-r--r--src/nix/develop.cc10
-rw-r--r--src/nix/flake.cc4
-rw-r--r--src/nix/log.cc8
-rw-r--r--src/nix/profile.cc16
-rw-r--r--src/nix/run.cc2
7 files changed, 26 insertions, 26 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 724ce9d79..03159b6cc 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -61,12 +61,12 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
for (const auto & [_i, buildable] : enumerate(buildables)) {
auto i = _i;
std::visit(overloaded {
- [&](BuildableOpaque bo) {
+ [&](DerivedPathWithHints::Opaque bo) {
std::string symlink = outLink;
if (i) symlink += fmt("-%d", i);
store2->addPermRoot(bo.path, absPath(symlink));
},
- [&](BuildableFromDrv bfd) {
+ [&](DerivedPathWithHints::Built bfd) {
auto builtOutputs = store->queryDerivationOutputMap(bfd.drvPath);
for (auto & output : builtOutputs) {
std::string symlink = outLink;
@@ -75,12 +75,12 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
store2->addPermRoot(output.second, absPath(symlink));
}
},
- }, buildable);
+ }, buildable.raw());
}
updateProfile(buildables);
- if (json) logger->cout("%s", buildablesToJSON(buildables, store).dump());
+ if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
}
};
diff --git a/src/nix/bundle.cc b/src/nix/bundle.cc
index e86fbb3f7..53dccc63a 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(toBuildableReqs(app.context));
+ store->buildPaths(toDerivedPaths(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({ BuildableReqFromDrv { drvPath } });
+ store->buildPaths({ DerivedPath::Built { drvPath } });
auto outPathS = store->printStorePath(outPath);
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index 616e2073e..7cc7b85be 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -160,7 +160,7 @@ StorePath getDerivationEnvironment(ref<Store> store, const StorePath & drvPath)
auto shellDrvPath = writeDerivation(*store, drv);
/* Build the derivation. */
- store->buildPaths({BuildableReqFromDrv{shellDrvPath}});
+ store->buildPaths({DerivedPath::Built{shellDrvPath}});
for (auto & [_0, outputAndOptPath] : drv.outputsAndOptPaths(*store)) {
auto & [_1, optPath] = outputAndOptPath;
@@ -265,7 +265,7 @@ struct Common : InstallableCommand, MixProfile
for (auto & [installable_, dir_] : redirects) {
auto dir = absPath(dir_);
auto installable = parseInstallable(store, installable_);
- auto buildable = installable->toBuildable();
+ auto buildable = installable->toDerivedPathWithHints();
auto doRedirect = [&](const StorePath & path)
{
auto from = store->printStorePath(path);
@@ -277,14 +277,14 @@ struct Common : InstallableCommand, MixProfile
}
};
std::visit(overloaded {
- [&](const BuildableOpaque & bo) {
+ [&](const DerivedPathWithHints::Opaque & bo) {
doRedirect(bo.path);
},
- [&](const BuildableFromDrv & bfd) {
+ [&](const DerivedPathWithHints::Built & bfd) {
for (auto & [outputName, path] : bfd.outputs)
if (path) doRedirect(*path);
},
- }, buildable);
+ }, buildable.raw());
}
return rewriteStrings(script, rewrites);
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 9d6d22a43..62a413e27 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -293,7 +293,7 @@ struct CmdFlakeCheck : FlakeCommand
}
};
- std::vector<BuildableReq> drvPaths;
+ std::vector<DerivedPath> drvPaths;
auto checkApp = [&](const std::string & attrPath, Value & v, const Pos & pos) {
try {
@@ -462,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(BuildableReqFromDrv{drvPath});
+ drvPaths.push_back(DerivedPath::Built{drvPath});
}
}
}
diff --git a/src/nix/log.cc b/src/nix/log.cc
index 67d3742d6..638bb5073 100644
--- a/src/nix/log.cc
+++ b/src/nix/log.cc
@@ -30,18 +30,18 @@ struct CmdLog : InstallableCommand
subs.push_front(store);
- auto b = installable->toBuildable();
+ auto b = installable->toDerivedPathWithHints();
RunPager pager;
for (auto & sub : subs) {
auto log = std::visit(overloaded {
- [&](BuildableOpaque bo) {
+ [&](DerivedPathWithHints::Opaque bo) {
return sub->getBuildLog(bo.path);
},
- [&](BuildableFromDrv bfd) {
+ [&](DerivedPathWithHints::Built bfd) {
return sub->getBuildLog(bfd.drvPath);
},
- }, b);
+ }, b.raw());
if (!log) continue;
stopProgressBar();
printInfo("got build log for '%s' from '%s'", installable->what(), sub->getUri());
diff --git a/src/nix/profile.cc b/src/nix/profile.cc
index 502a6b2a3..f254c620c 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<BuildableReq> pathsToBuild;
+ std::vector<DerivedPath> 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(BuildableReqFromDrv{drv.drvPath, StringSet{drv.outputName}});
+ pathsToBuild.push_back(DerivedPath::Built{drv.drvPath, StringSet{drv.outputName}});
manifest.elements.emplace_back(std::move(element));
} else {
@@ -268,20 +268,20 @@ struct CmdProfileInstall : InstallablesCommand, MixDefaultProfile
ProfileElement element;
std::visit(overloaded {
- [&](BuildableOpaque bo) {
+ [&](DerivedPathWithHints::Opaque bo) {
pathsToBuild.push_back(bo);
element.storePaths.insert(bo.path);
},
- [&](BuildableFromDrv bfd) {
+ [&](DerivedPathWithHints::Built 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(BuildableReqFromDrv{bfd.drvPath, {output.first}});
+ pathsToBuild.push_back(DerivedPath::Built{bfd.drvPath, {output.first}});
element.storePaths.insert(output.second);
}
},
- }, buildable);
+ }, buildable.raw());
manifest.elements.emplace_back(std::move(element));
}
@@ -400,7 +400,7 @@ struct CmdProfileUpgrade : virtual SourceExprCommand, MixDefaultProfile, MixProf
auto matchers = getMatchers(store);
// FIXME: code duplication
- std::vector<BuildableReq> pathsToBuild;
+ std::vector<DerivedPath> pathsToBuild;
for (size_t i = 0; i < manifest.elements.size(); ++i) {
auto & element(manifest.elements[i]);
@@ -435,7 +435,7 @@ struct CmdProfileUpgrade : virtual SourceExprCommand, MixDefaultProfile, MixProf
attrPath,
};
- pathsToBuild.push_back(BuildableReqFromDrv{drv.drvPath, {"out"}}); // FIXME
+ pathsToBuild.push_back(DerivedPath::Built{drv.drvPath, {"out"}}); // FIXME
}
}
diff --git a/src/nix/run.cc b/src/nix/run.cc
index 2e9bb41cc..ba60e57d8 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(toBuildableReqs(app.context));
+ state->store->buildPaths(toDerivedPaths(app.context));
Strings allArgs{app.program};
for (auto & i : args) allArgs.push_back(i);