nix build: Only download the requested derivation outputs

Also some refactoring.
This commit is contained in:
Eelco Dolstra 2017-09-10 15:58:30 +02:00
parent 3ed8290e53
commit ad228d84e5
5 changed files with 52 additions and 18 deletions

View file

@ -93,6 +93,8 @@ private:
Value * vSourceExpr = 0;
};
enum RealiseMode { Build, NoBuild, DryRun };
/* A command that operates on a list of "installables", which can be
store paths, attribute paths, Nix expressions, etc. */
struct InstallablesCommand : virtual Args, SourceExprCommand
@ -104,12 +106,6 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
expectArgs("installables", &_installables);
}
enum RealiseMode { Build, NoBuild, DryRun };
Buildables toBuildables(ref<Store> store, RealiseMode mode);
PathSet toStorePaths(ref<Store> store, RealiseMode mode);
void prepare() override;
virtual bool useDefaultInstallables() { return true; }
@ -198,4 +194,17 @@ struct RegisterCommand
}
};
std::shared_ptr<Installable> parseInstallable(
SourceExprCommand & cmd, ref<Store> store, const std::string & installable,
bool useDefaultInstallables);
Buildables toBuildables(ref<Store> store, RealiseMode mode,
std::vector<std::shared_ptr<Installable>> installables);
PathSet toStorePaths(ref<Store> store, RealiseMode mode,
std::vector<std::shared_ptr<Installable>> installables);
Path toStorePath(ref<Store> store, RealiseMode mode,
std::shared_ptr<Installable> installable);
}