about summary refs log tree commit diff
path: root/tvix/derivation/src/derivation.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-16T14·25+0100
committerclbot <clbot@tvl.fyi>2023-01-16T16·45+0000
commit95cad95b9333214df90d6002e51c7ae34910fa7e (patch)
tree71a9d7dddbad123a1ccbf68beb94da145d2e2280 /tvix/derivation/src/derivation.rs
parentf6b4abac358c176cf5f686fed4f2e597e6b73704 (diff)
feat(tvix/derivation): make input_sources a BTreeSet r/5667
These need to be sorted anyways, so let's use the correct data structure for it.

Change-Id: I009c9989d7647dc1df716170f3680c981db6e4b2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7846
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/derivation/src/derivation.rs')
-rw-r--r--tvix/derivation/src/derivation.rs7
1 files changed, 3 insertions, 4 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
         };