diff options
author | Florian Klink <flokli@flokli.de> | 2024-01-05T13·53+0200 |
---|---|---|
committer | flokli <flokli@flokli.de> | 2024-01-06T15·33+0000 |
commit | 986e9b73c3c1e694fa0cbc4d29440ad8b8938269 (patch) | |
tree | 52be68fb5beb2aea347207d5e03f84f42f982d61 /tvix/glue/src/tvix_build.rs | |
parent | c9c95f4ef3b2d4a99723a2779744f5f4def65660 (diff) |
feat(tvix/build): add BuildRequest validation r/7356
Change-Id: I8182e4c4a7e5694c1e6f1f56ce092751c22adf4c Reviewed-on: https://cl.tvl.fyi/c/depot/+/10538 Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/glue/src/tvix_build.rs')
-rw-r--r-- | tvix/glue/src/tvix_build.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tvix/glue/src/tvix_build.rs b/tvix/glue/src/tvix_build.rs index b75191fe3980..7ac351e9b648 100644 --- a/tvix/glue/src/tvix_build.rs +++ b/tvix/glue/src/tvix_build.rs @@ -141,7 +141,7 @@ where provide_bin_sh: true, }); - Ok(BuildRequest { + let build_request = BuildRequest { command_args, outputs: output_paths, @@ -161,7 +161,15 @@ where .into_iter() .map(|(path, contents)| AdditionalFile { path, contents }), ), - }) + }; + + debug_assert!( + build_request.validate().is_ok(), + "invalid BuildRequest: {}", + build_request.validate().unwrap_err() + ); + + Ok(build_request) } /// handle passAsFile, if set. |