richard pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 64cb7b18 by Pier Angelo Vendrame at 2023-08-10T16:26:11+00:00 Bug 40917: Remove the uniffi-rs project.
We build an old version of uniffi-rs which is consumed only by application-services. However, AS includes a newer version in its Cargo.lock and it is automatically added to the vendor archive, so it can build completely fine also without this project.
So, we can remove it.
- - - - -
6 changed files:
- Makefile - projects/application-services/build - projects/application-services/config - − projects/uniffi-rs/btreeset.patch - − projects/uniffi-rs/build - − projects/uniffi-rs/config
Changes:
===================================== Makefile ===================================== @@ -583,9 +583,6 @@ cargo_vendor-application-services: submodule-update cargo_vendor-cbindgen: submodule-update $(rbm) build cbindgen --step cargo_vendor --target alpha --target torbrowser-linux-x86_64
-cargo_vendor-uniffi-rs: submodule-update - $(rbm) build uniffi-rs --step cargo_vendor --target nightly --target torbrowser-linux-x86_64 - go_vendor-snowflake-alpha: submodule-update $(rbm) build snowflake --step go_vendor --target alpha --target torbrowser-linux-x86_64
===================================== projects/application-services/build ===================================== @@ -21,8 +21,7 @@ mkdir /var/tmp/build cd /var/tmp/dist tar -xf $rootdir/[% c('input_files_by_name/rust') %] tar -xf $rootdir/[% c('input_files_by_name/ninja') %] -tar -xf $rootdir/[% c('input_files_by_name/uniffi-rs') %] -export PATH=/var/tmp/dist/rust/bin:/var/tmp/dist/ninja:/var/tmp/dist/uniffi-rs:$PATH +export PATH=/var/tmp/dist/rust/bin:/var/tmp/dist/ninja:$PATH export RUST_ANDROID_GRADLE_PYTHON_COMMAND=python3 cd $rootdir
===================================== projects/application-services/config ===================================== @@ -46,9 +46,6 @@ steps: - project: ninja name: ninja pkg_type: build - - project: uniffi-rs - name: uniffi-rs - pkg_type: build # See libs/build-all.sh to update these! # Also, build them with application-services, since they need the NDK and # we are using a different one from the other projects.
===================================== projects/uniffi-rs/btreeset.patch deleted ===================================== @@ -1,31 +0,0 @@ -diff --git a/uniffi_bindgen/src/interface/types.rs b/uniffi_bindgen/src/interface/types.rs -index 6448d58..b7efd22 100644 ---- a/uniffi_bindgen/src/interface/types.rs -+++ b/uniffi_bindgen/src/interface/types.rs -@@ -26,7 +26,7 @@ - use anyhow::bail; - use anyhow::Result; - use std::convert::TryFrom; --use std::{collections::hash_map::Entry, collections::HashMap, collections::HashSet}; -+use std::{collections::hash_map::Entry, collections::HashMap, collections::BTreeSet}; - - use super::Attributes; - -@@ -71,7 +71,7 @@ pub enum FFIType { - /// 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, PartialOrd, Ord)] - pub enum Type { - // Primitive types. - UInt8, -@@ -195,7 +195,7 @@ 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_known_types: BTreeSet<Type>, - } - - impl TypeUniverse {
===================================== projects/uniffi-rs/build deleted ===================================== @@ -1,42 +0,0 @@ -#!/bin/bash -[% c("var/set_default_env") -%] -distdir=/var/tmp/dist -builddir=/var/tmp/build/[% project %] -mkdir -p $distdir/[% project %] -tar -C $distdir -xf $rootdir/[% c('input_files_by_name/rust') %] -export PATH="/var/tmp/dist/rust/bin:$PATH" -mkdir -p /var/tmp/build -tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.[% c('compress_tar') %] - -# Now prepare the offline build -# Move the directory for hardcoding the path in .cargo/config -mv /var/tmp/build/[% project %]-[% c('version') %] $builddir -tar -C $builddir -xjf uniffi-rs-vendor-[% c('version') %].tar.bz2 -cd $builddir -mkdir .cargo -cat > .cargo/config << 'EOF' -[source.crates-io] -replace-with = "vendored-sources" - -[source.vendored-sources] -directory = "/var/tmp/build/uniffi-rs/vendor" -EOF - -# We change the data type of the `all_known_types` Set from HashSet to BTreeSet. -# Uniffi iterates over the elements of this set, and iteration over a HashSet occurs -# in an arbitrary order, while iteration over a BTreeSet orders in a defined (and -# deterministic) order. This patch solves a build reproducibility issue, see -# tor-browser-build#40208. -# -# Upstream bug: https://github.com/mozilla/uniffi-rs/issues/374 -patch -p1 < $rootdir/btreeset.patch -# We usually use --frozen but there is no Cargo.lock file available. Thus resort -# to --offline. -cargo build --release --offline --target x86_64-unknown-linux-gnu -mv target/x86_64-unknown-linux-gnu/release/uniffi-bindgen $distdir/[% project %] - -cd $distdir -[% c('tar', { - tar_src => [ project ], - tar_args => '-caf ' _ dest_dir _ '/' _ c('filename'), - }) %]
===================================== projects/uniffi-rs/config deleted ===================================== @@ -1,27 +0,0 @@ -# vim: filetype=yaml sw=2 -version: 0.7.0 -git_url: https://github.com/mozilla/uniffi-rs -git_hash: ea3ff0402438ef1ebceda4c5fbbbd2ed6a9be227 -filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.[% c("compress_tar") %]' - -container: - use_container: 1 - -input_files: - - project: container-image - - name: rust - project: rust - # Use `make cargo_vendor-uniffi-rs` to re-generate the vendor tarball - - URL: https://people.torproject.org/~boklm/mirrors/sources/uniffi-rs-vendor-%5B% c('version') %].tar.bz2 - sha256sum: 8f201df618b3e7bcaaf01a87e0d55171605b80abeb1b660fe4dd0b9bfc10a0d8 - - filename: btreeset.patch - -steps: - cargo_vendor: - filename: '[% project %]-vendor-[% c("version") %].tar.bz2' - input_files: - - project: container-image - pkg_type: build - - project: rust - name: rust - pkg_type: build
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/64...