about summary refs log tree commit diff
path: root/tvix/cli/src/derivation.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-01-27 r/5772 fix(tvix/cli): handle SRI hashes in outputHashFlorian Klink1-17/+109
Instead of being called with `md5`, `sha1`, `sha256` or `sha512`, `fetchurl.nix` (from corepkgs / `<nix`) can also be called with a `hash` attribute, being an SRI hash. In that case, `builtin.derivation` is called with `outputHashAlgo` being an empty string, and `outputHash` being an SRI hash string. In other cases, an SRI hash is passed as outputHash, but outputHashAlgo is set too. Nix does modify these values in (single, fixed) output specification it serializes to ATerm, but keeps it unharmed in `env`. Move this into a construct_output_hash helper function, that can be tested better in isolation. Change-Id: Id9d716a119664c44ea7747540399966752e20187 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7933 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-27 r/5770 feat(tvix/cli): faux implementation of builtins.toFileVincent Ambo1-0/+31
This adds an implementation of this builtin which correctly calculates paths, but does not actually write anything to the store or verify references. Change-Id: Ie9764cbc1d13a73d8dc9350910304e2b7cad3fe8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7910 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-01-27 r/5768 feat(tvix/cli): implement builtins.derivationStrictVincent Ambo1-2/+150
Implements the logic for converting an evaluator value supplied as arguments to builtins.derivationStrict into an actual, fully-functional derivation struct. This skips the implementation of structuredAttrs, which are left for a subsequent commit. Note: We will need to port some eval tests over to CLI to test this correct, which will be done in a separate commit later on. Change-Id: I0db69dcf12716180de0eb0b126e3da4683712966 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7756 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-27 r/5767 feat(tvix/cli): add helper for handling special drv parametersVincent Ambo1-0/+106
Adds a helper function which handles special parameters to `builtins.derivation` that are not just blindly passed through to the builder environment, but populate other specific fields of the derivation (outside of the ones handled by other, more complex helpers from previous commits). Change-Id: I82d1edf9af714fc4591e9071c0b83ece83be7eee Reviewed-on: https://cl.tvl.fyi/c/depot/+/7901 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2023-01-27 r/5766 feat(tvix/cli): add helper for populating drv output configurationVincent Ambo1-2/+119
This threads through the fields that control whether a derivation is a fixed-output derivation or not. Change-Id: I49739de178fed9f258291174ca1a2c15a7cf5c2a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7900 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-01-27 r/5765 feat(tvix/cli): add helper for populating derivation inputsVincent Ambo1-0/+89
This adds a helper function which takes the output of the reference scanner used on derivation inputs and populates the `input_sources` and `input_derivations` field of the derivation accordingly. Note that we have a divergence from C++ Nix here, as we do not populate the entire FS closure of a literally referred derivation (and our standing theory is that this is unnecessary for nixpkgs). Change-Id: Id0f605dd8c0a82973c56605c2b8f478fc17777d6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7899 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2023-01-27 r/5764 feat(tvix/cli): add helper for populating derivation outputsVincent Ambo1-0/+88
Adds a small helper function which uses a Nix value supplied to `builtins.derivation{Strict}` to populate the `outputs` field of the `Derivation` struct. Change-Id: Iccc7a4f293b3d913140aed576a573a8992241e46 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7898 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI