richard pushed to branch main at The Tor Project / Applications / tor-browser-build

Commits:

1 changed file:

Changes:

  • projects/application-services/bug40485.diff
    1
    +diff --git a/components/support/nimbus-fml/src/intermediate_representation.rs b/components/support/nimbus-fml/src/intermediate_representation.rs
    
    2
    +index e61f8a728..c1e396cab 100644
    
    3
    +--- a/components/support/nimbus-fml/src/intermediate_representation.rs
    
    4
    ++++ b/components/support/nimbus-fml/src/intermediate_representation.rs
    
    5
    +@@ -8,7 +8,7 @@ use crate::util::loaders::FilePath;
    
    6
    + use anyhow::{bail, Error, Result as AnyhowResult};
    
    7
    + use serde::{Deserialize, Serialize};
    
    8
    + use serde_json::{Map, Value};
    
    9
    +-use std::collections::{BTreeSet, HashMap, HashSet};
    
    10
    ++use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
    
    11
    + use std::fmt::Display;
    
    12
    + use std::slice::Iter;
    
    13
    + 
    
    14
    +@@ -191,10 +191,10 @@ pub struct FeatureManifest {
    
    15
    +     pub(crate) about: AboutBlock,
    
    16
    + 
    
    17
    +     #[serde(default)]
    
    18
    +-    pub(crate) imported_features: HashMap<ModuleId, BTreeSet<String>>,
    
    19
    ++    pub(crate) imported_features: BTreeMap<ModuleId, BTreeSet<String>>,
    
    20
    + 
    
    21
    +     #[serde(default)]
    
    22
    +-    pub(crate) all_imports: HashMap<ModuleId, FeatureManifest>,
    
    23
    ++    pub(crate) all_imports: BTreeMap<ModuleId, FeatureManifest>,
    
    24
    + }
    
    25
    + 
    
    26
    + impl TypeFinder for FeatureManifest {
    
    1 27
     diff --git a/components/support/nimbus-fml/src/parser.rs b/components/support/nimbus-fml/src/parser.rs
    
    2
    -index bb676f827..d00b1b6ef 100644
    
    28
    +index bb676f827..0d7e78583 100644
    
    3 29
     --- a/components/support/nimbus-fml/src/parser.rs
    
    4 30
     +++ b/components/support/nimbus-fml/src/parser.rs
    
    5 31
     @@ -26,7 +26,7 @@ pub(crate) struct EnumVariantBody {
    
    ... ... @@ -41,6 +67,33 @@ index bb676f827..d00b1b6ef 100644
    41 67
      
    
    42 68
          #[serde(default)]
    
    43 69
          #[serde(alias = "include")]
    
    70
    +@@ -785,7 +785,7 @@ impl Parser {
    
    71
    +         &self,
    
    72
    +         current: &FilePath,
    
    73
    +         channel: &str,
    
    74
    +-        imports: &mut HashMap<ModuleId, FeatureManifest>,
    
    75
    ++        imports: &mut BTreeMap<ModuleId, FeatureManifest>,
    
    76
    +     ) -> Result<ModuleId> {
    
    77
    +         let id = current.try_into()?;
    
    78
    +         if imports.contains_key(&id) {
    
    79
    +@@ -814,7 +814,7 @@ impl Parser {
    
    80
    +         // This loop does the work of merging the default blocks back into the imported manifests.
    
    81
    +         // We'll then attach all the manifests to the root (i.e. the one we're generating code for today), in `imports`.
    
    82
    +         // We associate only the feature ids with the manifest we're loading in this method.
    
    83
    +-        let mut imported_feature_id_map = HashMap::new();
    
    84
    ++        let mut imported_feature_id_map = BTreeMap::new();
    
    85
    + 
    
    86
    +         for block in &frontend.imports {
    
    87
    +             // 1. Load the imported manifests in to the hash map.
    
    88
    +@@ -888,7 +888,7 @@ impl Parser {
    
    89
    +         &self,
    
    90
    +         channel: &str,
    
    91
    +     ) -> Result<FeatureManifest, FMLError> {
    
    92
    +-        let mut manifests = HashMap::new();
    
    93
    ++        let mut manifests = BTreeMap::new();
    
    94
    +         let id = self.load_imports(&self.source, channel, &mut manifests)?;
    
    95
    +         let mut fm = manifests
    
    96
    +             .remove(&id)
    
    44 97
     @@ -1009,12 +1009,12 @@ impl Parser {
    
    45 98
      }
    
    46 99