about summary refs log tree commit diff
path: root/tvix/glue/src/builtins/mod.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-01-18 r/7407 refactor(tvix/eval): generalize EvalIO containerFlorian Klink1-2/+2
Don't restrict to a Box<dyn EvalIO>. There's still one or two places where we do restrict, this will be solved by b/262. Change-Id: Ic8d927d6ea81fa12d90b1e4352f35ffaafbd1adf Reviewed-on: https://cl.tvl.fyi/c/depot/+/10639 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-12 r/7377 feat(tvix/glue): input derivation context testsRyan Lahfa1-0/+32
`args` was not propagating context, here's a regression test for it. Change-Id: I8b6a3148508d40df0077128f0bafe68c098a03bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/10610 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-01-12 r/7376 feat(tvix/glue/derivationStrict): support __structuredAttrsFlorian Klink1-0/+24
This adds support to handle the __structuredAttrs argument, which can be passed to builtins.derivationStrict. If __structuredAttrs is passed, and set to true, most of the arguments passed to builtins.derivationStrict are not simply coerced to a string and passed down to "environments", but instead kept in a more structured fashion. Inside ATerm, which is what's relevant as far as path calculation is concerned, a virtual `__json` environment variable is present, containing these structured values. Inside Builds, these structured values are not made available as an environment variable, but a JSON file (and source-able bash script). This will need to be respected once we start emitting BuildRequests, and for that we can probably just parse the `__json` key in Derivation.environment again - or keep this additionally in non-serialized form around during Evaluation. No matter what, this is left for a followup CL. The existing handle_derivation_parameters and populate_outputs helper function were removed, as __structuredAttrs causes quite a change in behaviour, and so handling both in the same place makes it more readable. There's some open questions w.r.t. string contexts for structured attrs itself. A TODO is left for this, but at least path calculation for individual structured attrs derivations are correct now. Part of b/366. Change-Id: Ic293822266ced6f8c4826d8ef0d2e098a4adccaa Reviewed-on: https://cl.tvl.fyi/c/depot/+/10604 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-12 r/7374 docs(tvix/glue): misc reflowing of commentsRyan Lahfa1-7/+5
My OCD could not be stopped. Change-Id: I2bf504fe0865a5084ad02aee18e6180a8a3e19d7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10609 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-01-08 r/7357 feat(tvix/glue): add test for output path calculationFlorian Klink1-0/+36
This test serves as a minimal reproducer for output path calculation. Derivations with the same name and output hash, but different build recipe should end up with the same outPath. However derivations with different name should end up with a different outPath. Change-Id: I555be59dd87ea675a0816188ed973f96c311e4e1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10416 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2024-01-03 r/7339 feat(tvix/eval): impl `unsafeDiscardStringContext`Ryan Lahfa1-0/+45
Change-Id: I7f0cc42cbebfe5cd27bf6d4f58a4af927b83646a Reviewed-on: https://cl.tvl.fyi/c/depot/+/10423 Autosubmit: raitobezarius <tvl@lahfa.xyz> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2024-01-03 r/7313 test(tvix/glue): add test with passAsFileFlorian Klink1-0/+1
This already succeeds, as the output path calculation path does not need to be aware of any builder-specific custom handling for passAsFile. Change-Id: I9cc9e4e4351cdeaa3ec33ba58ee1569e7a368150 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10520 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-01-03 r/7311 feat(tvix/glue): emit a warning in case of bad SRI hashesFlorian Klink1-0/+20
And include a test to ensure we show the warning. Change-Id: Ib6a436dbba2592b398b54e44f15a48d1aa345099 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10470 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-12-31 r/7289 refactor(tvix/eval): remove code and location from structFlorian Klink1-2/+2
Instead, it's passed in the evaluate/compile_only functions, which feels more naturally. It lets us set up the Evaluation struct long before we actually feed it with data to evaluate. Now that Evaluation::new() would be accepting an empty list of arguments, we can simply implement Default, making things a bit more idiomatic. Change-Id: I4369658634909a0c504fdffa18242a130daa0239 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10475 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de>
2023-11-04 r/6939 refactor(tvix/glue): move builtins into separate directoryFlorian Klink1-0/+157
Change-Id: I25b7197458dbfbde8623545dc0a0286eb2744f10 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9911 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz>