1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 13:06:01 +01:00

external-derivation-builder: args must always be specified

I don't want to figure out how to make nlohmann treat std::optional<>
the same way Rust's serde_json treats Option<> (i.e. skip it if it's
not there).
This commit is contained in:
Cole Helbling 2025-06-30 10:18:10 -07:00
parent b64a310eb2
commit 1521a819b7
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -1241,7 +1241,7 @@ public:
{ {
std::vector<std::string> systems; std::vector<std::string> systems;
Path program; Path program;
std::optional<std::vector<std::string>> args; std::vector<std::string> args;
}; };
using ExternalBuilders = std::vector<ExternalBuilder>; using ExternalBuilders = std::vector<ExternalBuilder>;

View file

@ -94,8 +94,8 @@ struct ExternalDerivationBuilder : DerivationBuilderImpl
Strings args = {externalBuilder.program}; Strings args = {externalBuilder.program};
if (externalBuilder.args) { if (!externalBuilder.args.empty()) {
args.insert(args.end(), externalBuilder.args->begin(), externalBuilder.args->end()); args.insert(args.end(), externalBuilder.args.begin(), externalBuilder.args.end());
} }
args.insert(args.end(), jsonFile); args.insert(args.end(), jsonFile);