Unverified Commit e8411c88 authored by boklm's avatar boklm Committed by Matthew Finkel
Browse files

Bug 40331: Update components for mozilla91: application-services part

parent 1c8682e1
From 4b9826025ac3242580efd7549d9b55d4466112e3 Mon Sep 17 00:00:00 2001
From: Matthew Finkel <sysrqb@torproject.org>
Date: Wed, 28 Apr 2021 18:38:47 +0000
Subject: [PATCH] Store the universe of known types in an ordered BTreeSet
(#374)
The set of types is used in multiple places during FFI creation. When
the data structure does not guarantee the order of elements, such as
HashSet, the resulting generated source code is not deterministic. Using
a BTreeSet resolves this issue by providing a well-defined element order
over which the the set may be iterated.
---
uniffi_bindgen/src/interface/types/mod.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/uniffi_bindgen/src/interface/types/mod.rs b/uniffi_bindgen/src/interface/types/mod.rs
index c4b0094..670b4bb 100644
--- a/uniffi_bindgen/src/interface/types/mod.rs
+++ b/uniffi_bindgen/src/interface/types/mod.rs
@@ -21,7 +21,7 @@
//! about how these API-level types map into the lower-level types of the FFI layer as represented
//! by the [`ffi::FFIType`] enum, but that's a detail that is invisible to end users.
-use std::{collections::hash_map::Entry, collections::HashMap, collections::HashSet};
+use std::{collections::hash_map::Entry, collections::BTreeSet, collections::HashMap};
use anyhow::{bail, Result};
@@ -35,7 +35,7 @@ pub(super) use resolver::{resolve_builtin_type, TypeResolver};
/// Represents all the different high-level types that can be used in a component interface.
/// At this level we identify user-defined types by name, without knowing any details
/// of their internal structure apart from what type of thing they are (record, enum, etc).
-#[derive(Debug, Clone, Eq, PartialEq, Hash)]
+#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub enum Type {
// Primitive types.
UInt8,
@@ -159,8 +159,8 @@ impl Into<FFIType> for &Type {
pub(crate) struct TypeUniverse {
// Named type definitions (including aliases).
type_definitions: HashMap<String, Type>,
- // All the types in the universe, by canonical type name.
- all_known_types: HashSet<Type>,
+ // All the types in the universe, by canonical type name, in a well-defined order.
+ all_known_types: BTreeSet<Type>,
}
impl TypeUniverse {
--
2.25.1
......@@ -49,15 +49,6 @@ directory = "/var/tmp/build/application-services/vendor"
offline=true
EOF
# Bug 40293: Patch vendored uniffi_bindgen.
pushd /var/tmp/build/application-services/vendor/
patch -p1 < $rootdir/0001-Store-the-universe-of-known-types-in-an-ordered-BTre.patch
# Update the expected checksum in the vendored source.
sed -i \
's/e39e61458d0d28c2b3425852c8a55625cc185ce806fbc7c0c6682f8cc93dec8d/0909e5214eedf1f2e709909176b1cbda39887002b26388535c3bc551fb04da1b/' \
uniffi_bindgen/.cargo-checksum.json
popd
# Move NSS and SQLCipher to the right place
# XXX: Maybe merge with the loop above.
archs="armv7 aarch64 x86 x86_64"
......
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
version: 77.0.2
git_hash: dd09c25f14dbf45f1637ed8dca2d1e5ff668479f
version: 79.0.0
git_hash: 89ea9cfa6eaa0763d17ec9aa04098839d028004c
git_url: https://github.com/mozilla/application-services
git_submodule: 1
......@@ -80,18 +80,17 @@ input_files:
enable: '[% !c("var/fetch_gradle_dependencies") %]'
# Use `make cargo_vendor-application-services` to re-generate the vendor tarball
- URL: https://people.torproject.org/~boklm/mirrors/sources/application-services-vendor-[% c('version') %].tar.bz2
sha256sum: 313c1e9b164ce9905eafe29a913edb617379e6d153ce28fa751d9f544e6e87c8
sha256sum: 386f0f94452f4a6185e9db094a157c67684c259b38e6f6d62805eaed30f20e58
- filename: no-git.patch
- filename: mavenLocal.patch
enable: '[% !c("var/fetch_gradle_dependencies") %]'
- filename: target.patch
- filename: gen_gradle_deps_file.sh
enable: '[% c("var/fetch_gradle_dependencies") %]'
- filename: 0001-Store-the-universe-of-known-types-in-an-ordered-BTre.patch
steps:
list_toolchain_updates:
git_hash: 'v77.0.2'
git_hash: 'v79.0.0'
input_files: []
var:
container:
......
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
filename: '[% project %]-[% c("version") %]-with-nspr-[% c("nspr_version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
# The required versions for application-services can be found at the respective
# commit in libs/build-all.sh
version: 3.59
nspr_version: 4.29
version: 3.65
nspr_version: 4.30
var:
container:
use_container: 1
......@@ -19,7 +19,7 @@ input_files:
project: ninja
- URL: 'https://ftp.mozilla.org/pub/security/nss/releases/NSS_[% c("version") | replace("\\.", "_") %]_RTM/src/nss-[% c("version") %]-with-nspr-[% c("nspr_version") %].tar.gz'
name: nss
sha256sum: 2e2c09c17b1c9f43a2f0a5d83a30a712bff3016d2b7cf5a3dd904847292607ae
sha256sum: 5da275c751d0a4f624089d4589ae68b0dfc9cb77bc846ef903fb819fbf678976
- filename: configure.patch
- filename: config.patch
- filename: bug_13028.patch
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment