Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e89ad3047b03
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cef088c66ce7
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Nov 27, 2020

  1. nix build: Add outro message

    edolstra committed Nov 27, 2020
    Copy the full SHA
    cef088c View commit details
Showing with 15 additions and 3 deletions.
  1. +15 −3 src/nix/build.cc
18 changes: 15 additions & 3 deletions src/nix/build.cc
Original file line number Diff line number Diff line change
@@ -67,29 +67,41 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile

if (dryRun) return;

PathSet symlinks;

if (outLink != "")
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
for (size_t i = 0; i < buildables.size(); ++i)
std::visit(overloaded {
[&](BuildableOpaque bo) {
std::string symlink = outLink;
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) {
auto builtOutputs = store->queryDerivationOutputMap(bfd.drvPath);
for (auto & output : builtOutputs) {
std::string symlink = outLink;
if (i) symlink += fmt("-%d", i);
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]);

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));
}
};