mirror of
https://github.com/NixOS/nix.git
synced 2025-11-21 09:49:36 +01:00
nix build: Add outro message
This commit is contained in:
parent
491ba8d1c4
commit
1af0a165d4
1 changed files with 15 additions and 3 deletions
|
|
@ -56,6 +56,8 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
|
||||||
|
|
||||||
if (dryRun) return;
|
if (dryRun) return;
|
||||||
|
|
||||||
|
PathSet symlinks;
|
||||||
|
|
||||||
if (outLink != "")
|
if (outLink != "")
|
||||||
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
|
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
|
||||||
for (size_t i = 0; i < buildables.size(); ++i)
|
for (size_t i = 0; i < buildables.size(); ++i)
|
||||||
|
|
@ -63,7 +65,9 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
|
||||||
[&](BuildableOpaque bo) {
|
[&](BuildableOpaque bo) {
|
||||||
std::string symlink = outLink;
|
std::string symlink = outLink;
|
||||||
if (i) symlink += fmt("-%d", i);
|
if (i) symlink += fmt("-%d", i);
|
||||||
store2->addPermRoot(bo.path, absPath(symlink));
|
symlink = absPath(symlink);
|
||||||
|
store2->addPermRoot(bo.path, symlink);
|
||||||
|
symlinks.insert(symlink);
|
||||||
},
|
},
|
||||||
[&](BuildableFromDrv bfd) {
|
[&](BuildableFromDrv bfd) {
|
||||||
auto builtOutputs = store->queryDerivationOutputMap(bfd.drvPath);
|
auto builtOutputs = store->queryDerivationOutputMap(bfd.drvPath);
|
||||||
|
|
@ -71,14 +75,22 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
|
||||||
std::string symlink = outLink;
|
std::string symlink = outLink;
|
||||||
if (i) symlink += fmt("-%d", i);
|
if (i) symlink += fmt("-%d", i);
|
||||||
if (output.first != "out") symlink += fmt("-%s", output.first);
|
if (output.first != "out") symlink += fmt("-%s", output.first);
|
||||||
store2->addPermRoot(output.second, absPath(symlink));
|
symlink = absPath(symlink);
|
||||||
|
store2->addPermRoot(output.second, symlink);
|
||||||
|
symlinks.insert(symlink);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}, buildables[i]);
|
}, buildables[i]);
|
||||||
|
|
||||||
updateProfile(buildables);
|
updateProfile(buildables);
|
||||||
|
|
||||||
if (json) logger->cout("%s", buildablesToJSON(buildables, store).dump());
|
if (json)
|
||||||
|
logger->cout("%s", buildablesToJSON(buildables, store).dump());
|
||||||
|
else
|
||||||
|
notice(
|
||||||
|
ANSI_GREEN "Build succeeded." ANSI_NORMAL
|
||||||
|
" The result is available through the symlink " ANSI_BOLD "%s" ANSI_NORMAL ".",
|
||||||
|
showPaths(symlinks));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue