fix(tvix/cli): populate output configuration after walking args

Walking the arguments might encounter an `outputs` output, which might
explicitly (for whatever reason) specify the `out` output.

To prevent dropping FOD settings in this case, we have to populate
that part of the configuration after walking the other attributes.

Change-Id: Iee6a7f0a71e9c9699e79d35e6cb19e1ddb49395d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8312
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-03-15 15:24:14 +03:00 committed by tazjin
parent b55d1f97ce
commit 4d465249ef

View file

@ -175,7 +175,6 @@ async fn handle_derivation_parameters(
.to_list()
.context("looking at the `outputs` parameter of the derivation")?;
drv.outputs.clear();
populate_outputs(co, drv, outputs).await?;
}
@ -264,20 +263,7 @@ mod derivation_builtins {
Ok(None)
}
populate_output_configuration(
&mut drv,
select_string(&co, &input, "outputHash")
.await
.context("evaluating the `outputHash` parameter")?,
select_string(&co, &input, "outputHashAlgo")
.await
.context("evaluating the `outputHashAlgo` parameter")?,
select_string(&co, &input, "outputHashMode")
.await
.context("evaluating the `outputHashMode` parameter")?,
)?;
for (name, value) in input.into_iter_sorted() {
for (name, value) in input.clone().into_iter_sorted() {
let value = generators::request_force(&co, value).await;
if ignore_nulls && matches!(value, Value::Null) {
continue;
@ -303,6 +289,19 @@ mod derivation_builtins {
}
}
populate_output_configuration(
&mut drv,
select_string(&co, &input, "outputHash")
.await
.context("evaluating the `outputHash` parameter")?,
select_string(&co, &input, "outputHashAlgo")
.await
.context("evaluating the `outputHashAlgo` parameter")?,
select_string(&co, &input, "outputHashMode")
.await
.context("evaluating the `outputHashMode` parameter")?,
)?;
// Scan references in relevant attributes to detect any build-references.
let references = {
let state = state.borrow();