nix build: Create result symlinks

This commit is contained in:
Eelco Dolstra 2017-09-06 16:03:22 +02:00
parent 1277aab219
commit df4342bc17
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 104 additions and 41 deletions

View file

@ -44,18 +44,25 @@ private:
std::shared_ptr<Store> _store;
};
struct Whence { std::string outputName; Path drvPath; };
typedef std::map<Path, Whence> Buildables;
struct Buildable
{
Path drvPath; // may be empty
std::map<std::string, Path> outputs;
};
typedef std::vector<Buildable> Buildables;
struct Installable
{
virtual std::string what() = 0;
virtual Buildables toBuildable(bool singular = false)
virtual Buildables toBuildables()
{
throw Error("argument '%s' cannot be built", what());
}
Buildable toBuildable();
virtual Value * toValue(EvalState & state)
{
throw Error("argument '%s' cannot be evaluated", what());
@ -97,9 +104,11 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
expectArgs("installables", &_installables);
}
enum ToStorePathsMode { Build, NoBuild, DryRun };
enum RealiseMode { Build, NoBuild, DryRun };
PathSet toStorePaths(ref<Store> store, ToStorePathsMode mode);
Buildables toBuildables(ref<Store> store, RealiseMode mode);
PathSet toStorePaths(ref<Store> store, RealiseMode mode);
void prepare() override;