lix/src/nix/build.cc
Eelco Dolstra 6438ba22af
StorePathsCommand: Don't build installables
On second though this was annoying. E.g. "nix log nixpkgs.hello" would
build/download Hello first, even though the log can be fetched
directly from the binary cache.

May need to revisit this.
2017-07-14 18:29:07 +02:00

33 lines
605 B
C++

#include "command.hh"
#include "common-args.hh"
#include "shared.hh"
#include "store-api.hh"
using namespace nix;
struct CmdBuild : MixDryRun, InstallablesCommand
{
CmdBuild()
{
}
std::string name() override
{
return "build";
}
std::string description() override
{
return "build a derivation or fetch a store path";
}
void run(ref<Store> store) override
{
auto paths = toStorePaths(store, dryRun ? DryRun : Build);
printInfo("build result: %s", showPaths(paths));
}
};
static RegisterCommand r1(make_ref<CmdBuild>());