2015-05-28 17:39:29 +02:00
|
|
|
#pragma once
|
|
|
|
|
2015-05-29 01:31:12 +02:00
|
|
|
#include <memory>
|
|
|
|
|
2015-05-28 17:39:29 +02:00
|
|
|
#include "hash.hh"
|
|
|
|
#include "derivations.hh"
|
2016-02-26 14:45:03 +01:00
|
|
|
#include "store-api.hh"
|
2020-07-27 20:38:59 +02:00
|
|
|
#include "nar-extractor.hh"
|
2015-05-28 17:39:29 +02:00
|
|
|
|
|
|
|
struct BuildProduct
|
|
|
|
{
|
|
|
|
nix::Path path, defaultPath;
|
|
|
|
std::string type, subtype, name;
|
|
|
|
bool isRegular = false;
|
2020-08-04 11:33:29 +02:00
|
|
|
std::optional<nix::Hash> sha256hash;
|
|
|
|
std::optional<off_t> fileSize;
|
2015-05-28 17:39:29 +02:00
|
|
|
BuildProduct() { }
|
|
|
|
};
|
|
|
|
|
2015-07-31 00:57:30 +02:00
|
|
|
struct BuildMetric
|
|
|
|
{
|
|
|
|
std::string name, unit;
|
|
|
|
double value;
|
|
|
|
};
|
|
|
|
|
2015-07-21 01:45:00 +02:00
|
|
|
struct BuildOutput
|
2015-05-28 17:39:29 +02:00
|
|
|
{
|
2015-06-17 17:11:42 +02:00
|
|
|
/* Whether this build has failed with output, i.e., the build
|
|
|
|
finished with exit code 0 but produced a file
|
|
|
|
$out/nix-support/failed. */
|
|
|
|
bool failed = false;
|
|
|
|
|
2015-05-28 17:39:29 +02:00
|
|
|
std::string releaseName;
|
|
|
|
|
2020-08-04 11:34:05 +02:00
|
|
|
uint64_t closureSize = 0, size = 0;
|
2015-05-28 17:39:29 +02:00
|
|
|
|
|
|
|
std::list<BuildProduct> products;
|
2015-07-31 00:57:30 +02:00
|
|
|
|
|
|
|
std::map<std::string, BuildMetric> metrics;
|
2015-05-28 17:39:29 +02:00
|
|
|
};
|
|
|
|
|
2020-07-27 20:38:59 +02:00
|
|
|
BuildOutput getBuildOutput(
|
|
|
|
nix::ref<nix::Store> store,
|
|
|
|
NarMemberDatas & narMembers,
|
|
|
|
const nix::Derivation & drv);
|