about summary refs log tree commit diff
path: root/tvix/nix-compat/src/derivation/validate.rs
diff options
context:
space:
mode:
authorPeter Kolloch <info@eigenvalue.net>2024-02-21T11·24+0700
committerclbot <clbot@tvl.fyi>2024-02-21T11·34+0000
commitc06fb01b3b7a752e0c04ba21a02cdc3f431055e1 (patch)
treec8fea42621edcaba6222373e2c4d9582f30be25b /tvix/nix-compat/src/derivation/validate.rs
parenta44a8985cc0ae126f86d26493d97d80a09b211f8 (diff)
feat(tvix/nix-compat): input_derivations with StorePaths r/7583
...in `Derivation`.

This is more type-safe and should consume less memory.

This also removes some allocations in the potentially hot path of output hash calculation.

https: //b.tvl.fyi/issues/264
Change-Id: I6ad7d3cb868dc9f750894d449a6065608ef06e8c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10957
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: Peter Kolloch <info@eigenvalue.net>
Reviewed-by: Peter Kolloch <info@eigenvalue.net>
Diffstat (limited to 'tvix/nix-compat/src/derivation/validate.rs')
-rw-r--r--tvix/nix-compat/src/derivation/validate.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/tvix/nix-compat/src/derivation/validate.rs b/tvix/nix-compat/src/derivation/validate.rs
index d711f5ce1de2..757326816c63 100644
--- a/tvix/nix-compat/src/derivation/validate.rs
+++ b/tvix/nix-compat/src/derivation/validate.rs
@@ -53,14 +53,7 @@ impl Derivation {
         // Validate all input_derivations
         for (input_derivation_path, output_names) in &self.input_derivations {
             // Validate input_derivation_path
-            if let Err(e) = StorePathRef::from_absolute_path(input_derivation_path.as_bytes()) {
-                return Err(DerivationError::InvalidInputDerivationPath(
-                    input_derivation_path.to_string(),
-                    e,
-                ));
-            }
-
-            if !input_derivation_path.ends_with(".drv") {
+            if !input_derivation_path.name().ends_with(".drv") {
                 return Err(DerivationError::InvalidInputDerivationPrefix(
                     input_derivation_path.to_string(),
                 ));