Compare commits
No commits in common. "main" and "main" have entirely different histories.
44
flake.lock
44
flake.lock
|
@ -23,11 +23,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727826117,
|
||||
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
|
||||
"lastModified": 1717285511,
|
||||
"narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
|
||||
"rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -47,11 +47,11 @@
|
|||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1729696851,
|
||||
"narHash": "sha256-XME7TzBvjK6GEmZqPLK+2+Wk0qnwc7DCwYH434hMcOM=",
|
||||
"rev": "2734a9cf94debc6baef4e7d4d9fa28cc28f5b31d",
|
||||
"lastModified": 1719348166,
|
||||
"narHash": "sha256-GK6PusfbMgkg+qdgChmrw78KTNQkm7SDoJ6+lJKY6vg=",
|
||||
"rev": "f170870ae7b18c8ee13fb42fe19b5aa05ddf56c0",
|
||||
"type": "tarball",
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/2734a9cf94debc6baef4e7d4d9fa28cc28f5b31d.tar.gz?rev=2734a9cf94debc6baef4e7d4d9fa28cc28f5b31d"
|
||||
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/f170870ae7b18c8ee13fb42fe19b5aa05ddf56c0.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
|
@ -65,11 +65,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1729742964,
|
||||
"narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=",
|
||||
"lastModified": 1703863825,
|
||||
"narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-github-actions",
|
||||
"rev": "e04df33f62cdcf93d73e9a04142464753a16db67",
|
||||
"rev": "5163432afc817cf8bd1f031418d1869e4c9d5547",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -81,11 +81,11 @@
|
|||
"nix2container": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1724996935,
|
||||
"narHash": "sha256-njRK9vvZ1JJsP8oV2OgkBrpJhgQezI03S7gzskCcHos=",
|
||||
"lastModified": 1712990762,
|
||||
"narHash": "sha256-hO9W3w7NcnYeX8u8cleHiSpK2YJo7ecarFTUlbybl7k=",
|
||||
"owner": "nlewo",
|
||||
"repo": "nix2container",
|
||||
"rev": "fa6bb0a1159f55d071ba99331355955ae30b3401",
|
||||
"rev": "20aad300c925639d5d6cbe30013c8357ce9f2a2e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -96,11 +96,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1729851744,
|
||||
"narHash": "sha256-c3ZSmkQdcdmNAzHud2b0fANXNa8TcySH0ZAqND5zEi0=",
|
||||
"lastModified": 1718676691,
|
||||
"narHash": "sha256-DWKbARWtRpT1yiLLm+5vMijx65YB7NwGZMV6NXOtrJ8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "45e5197248e59e92e88956c5aa12553a7f62337f",
|
||||
"rev": "d9e18354acbf59c625505b7315c85508e9831bf4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -129,11 +129,11 @@
|
|||
"pre-commit-hooks": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1726745158,
|
||||
"narHash": "sha256-D5AegvGoEjt4rkKedmxlSEmC+nNLMBPWFxvmYnVLhjk=",
|
||||
"lastModified": 1712055707,
|
||||
"narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "4e743a6920eab45e8ba0fbe49dc459f1423a4b74",
|
||||
"rev": "e35aed5fda3cc79f88ed7f1795021e559582093a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -158,11 +158,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1729613947,
|
||||
"narHash": "sha256-XGOvuIPW1XRfPgHtGYXd5MAmJzZtOuwlfKDgxX5KT3s=",
|
||||
"lastModified": 1718139168,
|
||||
"narHash": "sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "aac86347fb5063960eccb19493e0cadcdb4205ca",
|
||||
"rev": "1cb529bffa880746a1d0ec4e0f5076876af931f1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
33
src/drv.cc
33
src/drv.cc
|
@ -23,17 +23,14 @@
|
|||
#include "drv.hh"
|
||||
#include "eval-args.hh"
|
||||
|
||||
static bool
|
||||
queryIsCached(nix::Store &store,
|
||||
std::map<std::string, std::optional<std::string>> &outputs) {
|
||||
static bool queryIsCached(nix::Store &store,
|
||||
std::map<std::string, std::string> &outputs) {
|
||||
uint64_t downloadSize, narSize;
|
||||
nix::StorePathSet willBuild, willSubstitute, unknown;
|
||||
|
||||
std::vector<nix::StorePathWithOutputs> paths;
|
||||
for (auto const &[key, val] : outputs) {
|
||||
if (val) {
|
||||
paths.push_back(followLinksToStorePathWithOutputs(store, *val));
|
||||
}
|
||||
paths.push_back(followLinksToStorePathWithOutputs(store, val));
|
||||
}
|
||||
|
||||
store.queryMissing(toDerivedPaths(paths), willBuild, willSubstitute,
|
||||
|
@ -48,19 +45,9 @@ Drv::Drv(std::string &attrPath, nix::EvalState &state, nix::DrvInfo &drvInfo,
|
|||
auto localStore = state.store.dynamic_pointer_cast<nix::LocalFSStore>();
|
||||
|
||||
try {
|
||||
// CA derivations do not have static output paths, so we have to
|
||||
// defensively not query output paths in case we encounter one.
|
||||
for (auto &[outputName, optOutputPath] :
|
||||
drvInfo.queryOutputs(!nix::experimentalFeatureSettings.isEnabled(
|
||||
nix::Xp::CaDerivations))) {
|
||||
if (optOutputPath) {
|
||||
outputs[outputName] =
|
||||
localStore->printStorePath(*optOutputPath);
|
||||
} else {
|
||||
assert(nix::experimentalFeatureSettings.isEnabled(
|
||||
nix::Xp::CaDerivations));
|
||||
outputs[outputName] = std::nullopt;
|
||||
}
|
||||
for (auto out : drvInfo.queryOutputs(true)) {
|
||||
if (out.second)
|
||||
outputs[out.first] = localStore->printStorePath(*out.second);
|
||||
}
|
||||
} catch (const std::exception &e) {
|
||||
throw nix::EvalError(state,
|
||||
|
@ -111,16 +98,10 @@ Drv::Drv(std::string &attrPath, nix::EvalState &state, nix::DrvInfo &drvInfo,
|
|||
}
|
||||
|
||||
void to_json(nlohmann::json &json, const Drv &drv) {
|
||||
std::map<std::string, nlohmann::json> outputsJson;
|
||||
for (auto &[name, optPath] : drv.outputs) {
|
||||
outputsJson[name] =
|
||||
optPath ? nlohmann::json(*optPath) : nlohmann::json(nullptr);
|
||||
}
|
||||
|
||||
json = nlohmann::json{{"name", drv.name},
|
||||
{"system", drv.system},
|
||||
{"drvPath", drv.drvPath},
|
||||
{"outputs", outputsJson},
|
||||
{"outputs", drv.outputs},
|
||||
{"inputDrvs", drv.inputDrvs}};
|
||||
|
||||
if (drv.meta.has_value()) {
|
||||
|
|
|
@ -24,7 +24,7 @@ struct Drv {
|
|||
std::string drvPath;
|
||||
|
||||
enum class CacheStatus { Cached, Uncached, Unknown } cacheStatus;
|
||||
std::map<std::string, std::optional<std::string>> outputs;
|
||||
std::map<std::string, std::string> outputs;
|
||||
std::map<std::string, std::set<std::string>> inputDrvs;
|
||||
std::optional<nlohmann::json> meta;
|
||||
|
||||
|
|
|
@ -348,12 +348,20 @@ int main(int argc, char **argv) {
|
|||
|
||||
myArgs.parseArgs(argv, argc);
|
||||
|
||||
/* FIXME: The build hook in conjunction with import-from-derivation is
|
||||
* causing "unexpected EOF" during eval */
|
||||
settings.builders = "";
|
||||
|
||||
/* Prevent access to paths outside of the Nix search path and
|
||||
to the environment. */
|
||||
evalSettings.restrictEval = false;
|
||||
|
||||
/* When building a flake, use pure evaluation (no access to
|
||||
'getEnv', 'currentSystem' etc. */
|
||||
if (myArgs.impure) {
|
||||
evalSettings.pureEval.override(false);
|
||||
evalSettings.pureEval = false;
|
||||
} else if (myArgs.flake) {
|
||||
evalSettings.pureEval.override(true);
|
||||
evalSettings.pureEval = true;
|
||||
}
|
||||
|
||||
if (myArgs.releaseExpr == "")
|
||||
|
@ -366,7 +374,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (myArgs.showTrace) {
|
||||
loggerSettings.showTrace.override(true);
|
||||
loggerSettings.showTrace.assign(true);
|
||||
}
|
||||
|
||||
Sync<State> state_;
|
||||
|
|
Loading…
Reference in a new issue