1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

Get rid of filterDrvOutputs

We don't need it any more, because we only used it in the
single-wanted-output `DerivationGoal`.
This commit is contained in:
John Ericson 2025-08-14 00:09:08 -04:00
parent 766a52ce87
commit 7707d0acad
3 changed files with 2 additions and 22 deletions

View file

@ -359,9 +359,8 @@ Goal::Done DerivationGoal::done(BuildResult::Status status, SingleDrvOutputs bui
mcExpectedBuilds.reset(); mcExpectedBuilds.reset();
if (buildResult.success()) { if (buildResult.success()) {
auto wantedBuiltOutputs = filterDrvOutputs(OutputsSpec::Names{wantedOutput}, std::move(builtOutputs)); assert(!builtOutputs.empty());
assert(!wantedBuiltOutputs.empty()); buildResult.builtOutputs = std::move(builtOutputs);
buildResult.builtOutputs = std::move(wantedBuiltOutputs);
if (status == BuildResult::Built) if (status == BuildResult::Built)
worker.doneBuilds++; worker.doneBuilds++;
} else { } else {

View file

@ -102,13 +102,6 @@ typedef std::map<OutputName, Realisation> SingleDrvOutputs;
*/ */
typedef std::map<DrvOutput, Realisation> DrvOutputs; typedef std::map<DrvOutput, Realisation> DrvOutputs;
/**
* Filter a SingleDrvOutputs to include only specific output names
*
* Moves the `outputs` input.
*/
SingleDrvOutputs filterDrvOutputs(const OutputsSpec &, SingleDrvOutputs &&);
struct OpaquePath struct OpaquePath
{ {
StorePath path; StorePath path;

View file

@ -135,18 +135,6 @@ size_t Realisation::checkSignatures(const PublicKeys & publicKeys) const
return good; return good;
} }
SingleDrvOutputs filterDrvOutputs(const OutputsSpec & wanted, SingleDrvOutputs && outputs)
{
SingleDrvOutputs ret = std::move(outputs);
for (auto it = ret.begin(); it != ret.end();) {
if (!wanted.contains(it->first))
it = ret.erase(it);
else
++it;
}
return ret;
}
StorePath RealisedPath::path() const StorePath RealisedPath::path() const
{ {
return std::visit([](auto && arg) { return arg.getPath(); }, raw); return std::visit([](auto && arg) { return arg.getPath(); }, raw);