about summary refs log tree commit diff
path: root/tvix/derivation/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/derivation/src')
-rw-r--r--tvix/derivation/src/derivation.rs7
-rw-r--r--tvix/derivation/src/validate.rs10
-rw-r--r--tvix/derivation/src/write.rs2
3 files changed, 5 insertions, 14 deletions
diff --git a/tvix/derivation/src/derivation.rs b/tvix/derivation/src/derivation.rs
index d1f46de8c5ee..1e2605f5b931 100644
--- a/tvix/derivation/src/derivation.rs
+++ b/tvix/derivation/src/derivation.rs
@@ -22,7 +22,7 @@ pub struct Derivation {
     pub input_derivations: BTreeMap<String, BTreeSet<String>>,
 
     #[serde(rename = "inputSrcs")]
-    pub input_sources: Vec<String>,
+    pub input_sources: BTreeSet<String>,
 
     pub outputs: BTreeMap<String, Output>,
 
@@ -111,15 +111,14 @@ impl Derivation {
         let mut hasher = Sha256::new();
 
         // collect the list of paths from input_sources and input_derivations
-        // into a sorted list, and join them by :
+        // into a (sorted, guaranteed by BTreeSet) list, and join them by :
         hasher.update(write::TEXT_COLON);
 
-        let concat_inputs: Vec<String> = {
+        let concat_inputs: BTreeSet<String> = {
             let mut inputs = self.input_sources.clone();
             let input_derivation_keys: Vec<String> =
                 self.input_derivations.keys().cloned().collect();
             inputs.extend(input_derivation_keys);
-            inputs.sort();
             inputs
         };
 
diff --git a/tvix/derivation/src/validate.rs b/tvix/derivation/src/validate.rs
index 5335f43636d3..e225bd2fdb07 100644
--- a/tvix/derivation/src/validate.rs
+++ b/tvix/derivation/src/validate.rs
@@ -61,16 +61,8 @@ impl Derivation {
         }
 
         // Validate all input_sources
-        for (i, input_source) in self.input_sources.iter().enumerate() {
+        for input_source in self.input_sources.iter() {
             StorePath::from_absolute_path(input_source)?;
-
-            if i > 0 && self.input_sources[i - 1] >= *input_source {
-                bail!(
-                    "invalid input source order: {} < {}",
-                    input_source,
-                    self.input_sources[i - 1],
-                );
-            }
         }
 
         // validate platform
diff --git a/tvix/derivation/src/write.rs b/tvix/derivation/src/write.rs
index af8f50d9b104..daca5ece2194 100644
--- a/tvix/derivation/src/write.rs
+++ b/tvix/derivation/src/write.rs
@@ -118,7 +118,7 @@ pub fn write_input_derivations(
 
 pub fn write_input_sources(
     writer: &mut impl Write,
-    input_sources: &[String],
+    input_sources: &BTreeSet<String>,
 ) -> Result<(), fmt::Error> {
     writer.write_char(COMMA)?;