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

Commits:

11 changed files:

Changes:

  • projects/application-services/41422-disable-viaduct.diff deleted
    1
    -diff --git a/components/viaduct/src/backend/ffi.rs b/components/viaduct/src/backend/ffi.rs
    
    2
    -index cca6bc68f..5d11eb026 100644
    
    3
    ---- a/components/viaduct/src/backend/ffi.rs
    
    4
    -+++ b/components/viaduct/src/backend/ffi.rs
    
    5
    -@@ -37,6 +37,8 @@ macro_rules! backend_error {
    
    6
    - pub struct FfiBackend;
    
    7
    - impl Backend for FfiBackend {
    
    8
    -     fn send(&self, request: crate::Request) -> Result<crate::Response, Error> {
    
    9
    -+        return Err(backend_error!("Viaduct is disabled in Tor Browser."));
    
    10
    -+
    
    11
    -         use ffi_support::IntoFfi;
    
    12
    -         use prost::Message;
    
    13
    -         super::note_backend("FFI (trusted)");

  • projects/application-services/a-s-noop.diff deleted
    1
    -diff --git a/build-scripts/component-common.gradle b/build-scripts/component-common.gradle
    
    2
    -index a126341b0..3b3579290 100644
    
    3
    ---- a/build-scripts/component-common.gradle
    
    4
    -+++ b/build-scripts/component-common.gradle
    
    5
    -@@ -111,16 +111,30 @@ ext.configureUniFFIBindgen = { crateName ->
    
    6
    -                     commandLine "${mozconfig.topobjdir}/dist/host/bin/embedded-uniffi-bindgen", 'generate', '--library', libraryPath, "--crate", crateName, '--language', 'kotlin', '--out-dir', uniffiOutDir.get(), '--no-format'
    
    7
    -                 }
    
    8
    -             } else {
    
    9
    --                def libraryPath = megazordNative.asFileTree.matching {
    
    10
    --                    include "${nativeRustTarget}/libmegazord.*"
    
    11
    --                }.singleFile
    
    12
    --
    
    13
    --                if (libraryPath == null) {
    
    14
    --                    throw new GradleException("libmegazord dynamic library path not found")
    
    15
    --                }
    
    16
    --                exec {
    
    17
    --                    workingDir project.rootDir
    
    18
    --                    commandLine '/usr/bin/env', 'cargo', 'uniffi-bindgen', 'generate', '--library', libraryPath, "--crate", crateName, '--language', 'kotlin', '--out-dir', uniffiOutDir.get(), '--no-format'
    
    19
    -+                if (crateName.toString().contains("places")) {
    
    20
    -+                     def libraryPath = megazordNative.asFileTree.matching {
    
    21
    -+                        include "${nativeRustTarget}/libmegazord.*"
    
    22
    -+                    }.singleFile
    
    23
    -+
    
    24
    -+                    if (libraryPath == null) {
    
    25
    -+                        throw new GradleException("libmegazord dynamic library path not found")
    
    26
    -+                    }
    
    27
    -+                    exec {
    
    28
    -+                        workingDir project.rootDir
    
    29
    -+                        commandLine '/usr/bin/env', 'cargo', 'uniffi-bindgen', 'generate', '--library', libraryPath, "--crate", crateName, '--language', 'kotlin', '--out-dir', uniffiOutDir.get(), '--no-format'
    
    30
    -+                    }
    
    31
    -+                } else {
    
    32
    -+                    def libraryPath = "${project.rootDir}/megazords/full/target/debug/libmegazord.so"
    
    33
    -+                    exec {
    
    34
    -+                        workingDir project.rootDir
    
    35
    -+                        def command = ["${rootProject.projectDir}/uniffi-rs/uniffi-bindgen", 'generate', '--library', libraryPath, "--crate", crateName, '--language', 'kotlin', '--out-dir', uniffiOutDir.get(), '--no-format']
    
    36
    -+                        println "Executing command: ${command.join(' ')}"
    
    37
    -+                        commandLine command
    
    38
    -+
    
    39
    -+                        // Print both stdout and stderr to Gradle's console
    
    40
    -+                        standardOutput = System.out
    
    41
    -+                        errorOutput = System.err
    
    42
    -+                    }
    
    43
    -                 }
    
    44
    -             }
    
    45
    -         }
    
    46
    -diff --git a/components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/Config.kt b/components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/Config.kt
    
    47
    -index 78c16dd0a..d2615fa74 100644
    
    48
    ---- a/components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/Config.kt
    
    49
    -+++ b/components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/Config.kt
    
    50
    -@@ -13,4 +13,5 @@ fun FxaServer.contentUrl() = when (this) {
    
    51
    -     is FxaServer.China -> "https://accounts.firefox.com.cn"
    
    52
    -     is FxaServer.LocalDev -> "http://127.0.0.1:3030"
    
    53
    -     is FxaServer.Custom -> this.url
    
    54
    -+    is FxaServer.__NOOP -> ""
    
    55
    - }
    
    56
    -diff --git a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
    
    57
    -index 376ef90d9..d80eea50f 100644
    
    58
    ---- a/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
    
    59
    -+++ b/components/nimbus/android/src/main/java/org/mozilla/experiments/nimbus/Nimbus.kt
    
    60
    -@@ -535,6 +535,8 @@ open class Nimbus(
    
    61
    -                         ),
    
    62
    -                     )
    
    63
    -                 }
    
    64
    -+
    
    65
    -+                EnrollmentChangeEventType.__NOOP -> {}
    
    66
    -             }
    
    67
    -         }
    
    68
    -     }
    
    69
    -diff --git a/megazords/full/Cargo.toml b/megazords/full/Cargo.toml
    
    70
    -index c5e9eea19..ce899aac1 100644
    
    71
    ---- a/megazords/full/Cargo.toml
    
    72
    -+++ b/megazords/full/Cargo.toml
    
    73
    -@@ -9,24 +9,24 @@ license = "MPL-2.0"
    
    74
    - crate-type = ["cdylib"]
    
    75
    -
    
    76
    - [dependencies]
    
    77
    --fxa-client = { path = "../../components/fxa-client" }
    
    78
    --logins = { path = "../../components/logins" }
    
    79
    --tabs = { path = "../../components/tabs/" }
    
    80
    --sync_manager = { path = "../../components/sync_manager/" }
    
    81
    -+# fxa-client = { path = "../../components/fxa-client" }
    
    82
    -+# logins = { path = "../../components/logins" }
    
    83
    -+# tabs = { path = "../../components/tabs/" }
    
    84
    -+# sync_manager = { path = "../../components/sync_manager/" }
    
    85
    - # TODO: Uncomment this code when webext-storage component is integrated in android
    
    86
    - # webext-storage = { path = "../../components/webext-storage/" }
    
    87
    - places = { path = "../../components/places" }
    
    88
    --push = { path = "../../components/push" }
    
    89
    --remote_settings = { path = "../../components/remote_settings" }
    
    90
    --rust-log-forwarder = { path = "../../components/support/rust-log-forwarder" }
    
    91
    --viaduct = { path = "../../components/viaduct" }
    
    92
    --nimbus-sdk = { path = "../../components/nimbus" }
    
    93
    --autofill = { path = "../../components/autofill" }
    
    94
    --crashtest = { path = "../../components/crashtest" }
    
    95
    --error-support = { path = "../../components/support/error" }
    
    96
    --suggest = { path = "../../components/suggest" }
    
    97
    --search = { path = "../../components/search" }
    
    98
    --tracing-support = { path = "../../components/support/tracing" }
    
    99
    -+# push = { path = "../../components/push" }
    
    100
    -+# remote_settings = { path = "../../components/remote_settings" }
    
    101
    -+# rust-log-forwarder = { path = "../../components/support/rust-log-forwarder" }
    
    102
    -+# viaduct = { path = "../../components/viaduct" }
    
    103
    -+# nimbus-sdk = { path = "../../components/nimbus" }
    
    104
    -+# autofill = { path = "../../components/autofill" }
    
    105
    -+# crashtest = { path = "../../components/crashtest" }
    
    106
    -+# error-support = { path = "../../components/support/error" }
    
    107
    -+# suggest = { path = "../../components/suggest" }
    
    108
    -+# search = { path = "../../components/search" }
    
    109
    -+# tracing-support = { path = "../../components/support/tracing" }
    
    110
    -
    
    111
    - lazy_static = "1.4"
    
    112
    - init_rust_components = { path = "../../components/init_rust_components" }
    
    113
    -diff --git a/megazords/full/src/lib.rs b/megazords/full/src/lib.rs
    
    114
    -index 4b6ba4499..e4fde58ae 100644
    
    115
    ---- a/megazords/full/src/lib.rs
    
    116
    -+++ b/megazords/full/src/lib.rs
    
    117
    -@@ -8,24 +8,24 @@
    
    118
    - use std::ffi::CString;
    
    119
    - use std::os::raw::c_char;
    
    120
    -
    
    121
    --pub use autofill;
    
    122
    --pub use crashtest;
    
    123
    --pub use error_support;
    
    124
    --pub use fxa_client;
    
    125
    --pub use init_rust_components;
    
    126
    --pub use logins;
    
    127
    --pub use merino;
    
    128
    --pub use nimbus;
    
    129
    -+// pub use autofill;
    
    130
    -+// pub use crashtest;
    
    131
    -+// pub use error_support;
    
    132
    -+// pub use fxa_client;
    
    133
    -+// pub use init_rust_components;
    
    134
    -+// pub use logins;
    
    135
    -+// pub use merino;
    
    136
    -+// pub use nimbus;
    
    137
    - pub use places;
    
    138
    --pub use push;
    
    139
    --pub use remote_settings;
    
    140
    --pub use rust_log_forwarder;
    
    141
    --pub use search;
    
    142
    --pub use suggest;
    
    143
    --pub use sync_manager;
    
    144
    --pub use tabs;
    
    145
    --pub use tracing_support;
    
    146
    --pub use viaduct;
    
    147
    -+// pub use push;
    
    148
    -+// pub use remote_settings;
    
    149
    -+// pub use rust_log_forwarder;
    
    150
    -+// pub use search;
    
    151
    -+// pub use suggest;
    
    152
    -+// pub use sync_manager;
    
    153
    -+// pub use tabs;
    
    154
    -+// pub use tracing_support;
    
    155
    -+// pub use viaduct;
    
    156
    - // TODO: Uncomment this code when webext-storage component is integrated in android
    
    157
    - // pub use webext_storage;
    
    158
    -

  • projects/application-services/apply-bug-13028.diff deleted
    1
    -diff --git a/libs/build-all.sh b/libs/build-all.sh
    
    2
    -index 650c1299..6c4e5404 100755
    
    3
    ---- a/libs/build-all.sh
    
    4
    -+++ b/libs/build-all.sh
    
    5
    -@@ -128,6 +128,15 @@ echo $'\
    
    6
    -      fi
    
    7
    - ' | patch "${NSS_SRC_PATH}/nspr/configure"
    
    8
    - 
    
    9
    -+rm -f python
    
    10
    -+ln -s /usr/bin/python3 python
    
    11
    -+export PATH=$(pwd):$PATH
    
    12
    -+patch_13028=$(realpath bug_13028.patch)
    
    13
    -+pushd $NSS_SRC_PATH
    
    14
    -+# Apply our proxy bypass defense-in-depth here as well to be on the safe side.
    
    15
    -+patch -p2 < $patch_13028
    
    16
    -+popd
    
    17
    -+
    
    18
    - if [[ "${PLATFORM}" == "ios" ]]
    
    19
    - then
    
    20
    -   ./build-all-ios.sh "${SQLCIPHER_SRC_PATH}" "${NSS_SRC_PATH}"

  • projects/application-services/bug_13028.patch deleted
    1
    -From 2f0888c348561249d3083555db33c5619840dbfa Mon Sep 17 00:00:00 2001
    
    2
    -From: Mike Perry <mikeperry-git@torproject.org>
    
    3
    -Date: Mon, 29 Sep 2014 14:30:19 -0700
    
    4
    -Subject: [PATCH] Bug 13028: Prevent potential proxy bypass cases.
    
    5
    -
    
    6
    -It looks like these cases should only be invoked in the NSS command line
    
    7
    -tools, and not the browser, but I decided to patch them anyway because there
    
    8
    -literally is a maze of network function pointers being passed around, and it's
    
    9
    -very hard to tell if some random code might not pass in the proper proxied
    
    10
    -versions of the networking code here by accident.
    
    11
    -
    
    12
    -diff --git a/security/nss/lib/certhigh/ocsp.c b/security/nss/lib/certhigh/ocsp.c
    
    13
    -index cea8456606bf..86fa971cfbef 100644
    
    14
    ---- a/security/nss/lib/certhigh/ocsp.c
    
    15
    -+++ b/security/nss/lib/certhigh/ocsp.c
    
    16
    -@@ -2932,6 +2932,14 @@ ocsp_ConnectToHost(const char *host, PRUint16 port)
    
    17
    -     PRNetAddr addr;
    
    18
    -     char *netdbbuf = NULL;
    
    19
    - 
    
    20
    -+    // XXX: Do we need a unittest ifdef here? We don't want to break the tests, but
    
    21
    -+    // we want to ensure nothing can ever hit this code in production.
    
    22
    -+#if 1
    
    23
    -+    printf("Tor Browser BUG: Attempted OSCP direct connect to %s, port %u\n", host,
    
    24
    -+            port);
    
    25
    -+    goto loser;
    
    26
    -+#endif
    
    27
    -+
    
    28
    -     sock = PR_NewTCPSocket();
    
    29
    -     if (sock == NULL)
    
    30
    -         goto loser;
    
    31
    -diff --git a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
    
    32
    -index e8698376b5be..85791d84a932 100644
    
    33
    ---- a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
    
    34
    -+++ b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c
    
    35
    -@@ -1334,6 +1334,13 @@ pkix_pl_Socket_Create(
    
    36
    -                     plContext),
    
    37
    -                     PKIX_COULDNOTCREATESOCKETOBJECT);
    
    38
    - 
    
    39
    -+        // XXX: Do we need a unittest ifdef here? We don't want to break the tests, but
    
    40
    -+        // we want to ensure nothing can ever hit this code in production.
    
    41
    -+#if 1
    
    42
    -+        printf("Tor Browser BUG: Attempted pkix direct socket connect\n");
    
    43
    -+        PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
    
    44
    -+#endif
    
    45
    -+
    
    46
    -         socket->isServer = isServer;
    
    47
    -         socket->timeout = timeout;
    
    48
    -         socket->clientSock = NULL;
    
    49
    -@@ -1433,6 +1440,13 @@ pkix_pl_Socket_CreateByName(
    
    50
    - 
    
    51
    -         localCopyName = PL_strdup(serverName);
    
    52
    - 
    
    53
    -+        // XXX: Do we need a unittest ifdef here? We don't want to break the tests, but
    
    54
    -+        // we want to ensure nothing can ever hit this code in production.
    
    55
    -+#if 1
    
    56
    -+        printf("Tor Browser BUG: Attempted pkix direct connect to %s\n", serverName);
    
    57
    -+        PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
    
    58
    -+#endif
    
    59
    -+
    
    60
    -         sepPtr = strchr(localCopyName, ':');
    
    61
    -         /* First strip off the portnum, if present, from the end of the name */
    
    62
    -         if (sepPtr) {
    
    63
    -@@ -1582,6 +1596,13 @@ pkix_pl_Socket_CreateByHostAndPort(
    
    64
    -         PKIX_ENTER(SOCKET, "pkix_pl_Socket_CreateByHostAndPort");
    
    65
    -         PKIX_NULLCHECK_THREE(hostname, pStatus, pSocket);
    
    66
    - 
    
    67
    -+        // XXX: Do we need a unittest ifdef here? We don't want to break the tests, but
    
    68
    -+        // we want to ensure nothing can ever hit this code in production.
    
    69
    -+#if 1
    
    70
    -+        printf("Tor Browser BUG: Attempted pkix direct connect to %s, port %u\n", hostname,
    
    71
    -+                portnum);
    
    72
    -+        PKIX_ERROR(PKIX_PRNEWTCPSOCKETFAILED);
    
    73
    -+#endif
    
    74
    - 
    
    75
    -         prstatus = PR_GetHostByName(hostname, buf, sizeof(buf), &hostent);
    
    76
    - 
    
    77
    --- 
    
    78
    -2.27.0
    
    79
    -

  • projects/application-services/build
    ... ... @@ -68,34 +68,12 @@ EOF
    68 68
     
    
    69 69
     tar -xf $rootdir/[% c('input_files_by_name/uniffi-rs') %]
    
    70 70
     
    
    71
    -# We add a suffix to the version to make it super specific.
    
    72
    -# This is useful for developer builds, which seem to try to fetch
    
    73
    -# latest versions of dependencies sometimes.
    
    74
    -sed -i '$ s/$/-TORBROWSER/' version.txt
    
    75
    -
    
    76 71
     pushd libs
    
    77 72
     ln -s $rootdir/[% c("input_files_by_name/nss") %] ./
    
    78
    -ln -s $rootdir/bug_13028.patch
    
    79
    -patch -p2 < $rootdir/apply-bug-13028.diff
    
    80
    -patch -p2 < $rootdir/no-ndk-lookup.diff
    
    81 73
     ./build-all.sh desktop
    
    82 74
     ./build-all.sh android
    
    83 75
     popd
    
    84 76
     
    
    85
    -pushd megazords/full
    
    86
    -NSS_DIR=$(pwd)/../../libs/desktop/linux-x86-64/nss cargo build --target-dir=$(pwd)/target
    
    87
    -popd
    
    88
    -
    
    89
    -cp $rootdir/cargo-no-build.sh megazords/full/android/
    
    90
    -chmod +x megazords/full/android/cargo-no-build.sh
    
    91
    -patch -p1 < $rootdir/a-s-noop.diff
    
    92
    -
    
    93
    -pushd components/external/glean
    
    94
    -cp $rootdir/cargo-no-build.sh glean-core/android-native/
    
    95
    -cp $builddir/uniffi-rs/uniffi-bindgen glean-core/android-native/
    
    96
    -patch -p1 < $rootdir/glean-noop.diff
    
    97
    -popd
    
    98
    -
    
    99 77
     [% IF c('var/fetch_gradle_dependencies') %]
    
    100 78
       # XXX: `assemble` is still not enough to see all fetched dependencies via
    
    101 79
       # Gradle's --debug. See: tor-browser-build#40056.
    
    ... ... @@ -107,10 +85,7 @@ popd
    107 85
       # otherwise `click` barfs. See: https://click.palletsprojects.com/python3/
    
    108 86
       export LC_ALL=C.UTF-8
    
    109 87
       export LANG=C.UTF-8
    
    110
    -  patch -p1 < $rootdir/local-repository.diff
    
    111
    -  patch -p1 < $rootdir/offline-nimbus-fml.diff
    
    112
    -  patch -p1 < $rootdir/41422-disable-viaduct.diff
    
    113
    -  gradle_flags="--offline --no-daemon"
    
    88
    +  gradle_flags="--offline --no-daemon -PuniffiBindgenNoop=$builddir/uniffi-rs/uniffi-bindgen -PgradleDependenciesUrl=file:///var/tmp/dist/gradle-dependencies"
    
    114 89
       gradle $gradle_flags assembleRelease
    
    115 90
       gradle $gradle_flags publish
    
    116 91
       mv build/maven $distdir
    

  • projects/application-services/cargo-no-build.sh deleted
    1
    -#!/bin/bash
    
    2
    -
    
    3
    -if [[ "$1" == "build" ]]; then
    
    4
    -    echo "cargo build is disabled."
    
    5
    -    exit 0
    
    6
    -else
    
    7
    -    command cargo "$@"
    
    8
    -fi

  • projects/application-services/config
    1 1
     # vim: filetype=yaml sw=2
    
    2 2
     version: 140.0
    
    3
    -git_hash: 8ee6cb6a23f96ff8e2161926441aea72d6f09249
    
    4
    -git_url: https://github.com/mozilla/application-services
    
    3
    +git_hash: 'v[% c("version") %]-TORBROWSER'
    
    4
    +git_url: https://gitlab.torproject.org/tpo/applications/application-services.git
    
    5
    +tag_gpg_id: 1
    
    5 6
     git_submodule: 1
    
    6 7
     container:
    
    7 8
       use_container: 1
    
    ... ... @@ -65,19 +66,10 @@ steps:
    65 66
             project: application-services
    
    66 67
             pkg_type: cargo_vendor
    
    67 68
             norec:
    
    68
    -          sha256sum: 4cf0235b525b5ce1d8bcc40e9763a13fd0e79c773749b900b4d7420551cf5114
    
    69
    -      - filename: local-repository.diff
    
    69
    +          sha256sum: 23b027cf546e34b57576ab88ef3ce8218cf1654cc44c4bde3c553aea98274f20
    
    70 70
             enable: '[% !c("var/fetch_gradle_dependencies") %]'
    
    71 71
           - filename: gen_gradle_deps_file.sh
    
    72 72
             enable: '[% c("var/fetch_gradle_dependencies") %]'
    
    73
    -      - filename: bug_13028.patch
    
    74
    -      - filename: apply-bug-13028.diff
    
    75
    -      - filename: no-ndk-lookup.diff
    
    76
    -      - filename: offline-nimbus-fml.diff
    
    77
    -      - filename: glean-noop.diff
    
    78
    -      - filename: a-s-noop.diff
    
    79
    -      - filename: cargo-no-build.sh
    
    80
    -      - filename: 41422-disable-viaduct.diff
    
    81 73
     
    
    82 74
       list_toolchain_updates:
    
    83 75
         git_hash: 'v[% c("version") %]'
    

  • projects/application-services/glean-noop.diff deleted
    1
    -diff --git a/glean-core/android-native/build.gradle b/glean-core/android-native/build.gradle
    
    2
    -index 53716d523..d38af8320 100644
    
    3
    ---- a/glean-core/android-native/build.gradle
    
    4
    -+++ b/glean-core/android-native/build.gradle
    
    5
    -@@ -48,6 +48,8 @@ android {
    
    6
    - }
    
    7
    -
    
    8
    - cargo {
    
    9
    -+    cargoCommand = "${rootDir}/glean-core/android-native/cargo-no-build.sh"
    
    10
    -+
    
    11
    -     // The directory of the Cargo.toml to build.
    
    12
    -     module = '../bundle-android'
    
    13
    -
    
    14
    -diff --git a/glean-core/android/build.gradle b/glean-core/android/build.gradle
    
    15
    -index 7748378b4..5af06b1c3 100644
    
    16
    ---- a/glean-core/android/build.gradle
    
    17
    -+++ b/glean-core/android/build.gradle
    
    18
    -@@ -197,7 +197,7 @@ def generateUniffiBindings = tasks.register("generateUniffiBindings") {
    
    19
    -     doFirst {
    
    20
    -         exec {
    
    21
    -             workingDir project.rootDir
    
    22
    --            commandLine 'cargo', 'uniffi-bindgen', 'generate', '--no-format', "${project.projectDir}/${udlFilePath}", '--language', 'kotlin', '--out-dir', UNIFFI_OUT_DIR.get()
    
    23
    -+            commandLine '${rootDir}/glean-core/android-native/uniffi-bindgen', 'generate', '--no-format', "${project.projectDir}/${udlFilePath}", '--language', 'kotlin', '--out-dir', UNIFFI_OUT_DIR.get()
    
    24
    -         }
    
    25
    -     }
    
    26
    -     outputs.dir UNIFFI_OUT_DIR

  • projects/application-services/local-repository.diff deleted
    1
    -diff --git a/build.gradle b/build.gradle
    
    2
    -index bd516e58c..b30d552c9 100644
    
    3
    ---- a/build.gradle
    
    4
    -+++ b/build.gradle
    
    5
    -@@ -14,6 +14,14 @@ buildscript {
    
    6
    -     }
    
    7
    -
    
    8
    -     repositories {
    
    9
    -+        maven {
    
    10
    -+            url "file:///var/tmp/dist/gradle-dependencies"
    
    11
    -+            metadataSources {
    
    12
    -+                gradleMetadata()
    
    13
    -+                mavenPom()
    
    14
    -+            }
    
    15
    -+        }
    
    16
    -+
    
    17
    -         mavenCentral()
    
    18
    -         google()
    
    19
    -         maven {
    
    20
    -@@ -59,6 +67,14 @@ plugins {
    
    21
    -
    
    22
    - allprojects {
    
    23
    -     repositories {
    
    24
    -+        maven {
    
    25
    -+            url "file:///var/tmp/dist/gradle-dependencies"
    
    26
    -+            metadataSources {
    
    27
    -+                gradleMetadata()
    
    28
    -+                mavenPom()
    
    29
    -+            }
    
    30
    -+        }
    
    31
    -+
    
    32
    -         google()
    
    33
    -         mavenCentral()
    
    34
    -         maven {
    
    35
    -diff --git a/settings.gradle b/settings.gradle
    
    36
    -index 4117bc0d3..f1b028dad 100644
    
    37
    ---- a/settings.gradle
    
    38
    -+++ b/settings.gradle
    
    39
    -@@ -1,6 +1,19 @@
    
    40
    - /* This Source Code Form is subject to the terms of the Mozilla Public
    
    41
    -  * License, v. 2.0. If a copy of the MPL was not distributed with this
    
    42
    -  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
    
    43
    -+
    
    44
    -+pluginManagement {
    
    45
    -+    repositories {
    
    46
    -+        maven {
    
    47
    -+            url "file:///var/tmp/dist/gradle-dependencies"
    
    48
    -+            metadataSources {
    
    49
    -+                gradleMetadata()
    
    50
    -+                mavenPom()
    
    51
    -+            }
    
    52
    -+        }
    
    53
    -+    }
    
    54
    -+}
    
    55
    -+
    
    56
    - import org.yaml.snakeyaml.Yaml
    
    57
    -
    
    58
    - // We prefer `appServicesRootDir` over `rootDir` to help us on the path to the monorepo.
    
    59
    -@@ -23,6 +36,14 @@ buildscript {
    
    60
    -     if (!gradle.root.hasProperty("mozconfig")) {
    
    61
    -         // in app-services
    
    62
    -         repositories {
    
    63
    -+            maven {
    
    64
    -+                url "file:///var/tmp/dist/gradle-dependencies"
    
    65
    -+                metadataSources {
    
    66
    -+                    gradleMetadata()
    
    67
    -+                    mavenPom()
    
    68
    -+                }
    
    69
    -+            }
    
    70
    -+
    
    71
    -             mavenCentral()
    
    72
    -         }
    
    73
    -     } else {
    
    74
    -diff --git a/tools/nimbus-gradle-plugin/settings.gradle b/tools/nimbus-gradle-plugin/settings.gradle
    
    75
    -index 7d907f057..c0d213503 100644
    
    76
    ---- a/tools/nimbus-gradle-plugin/settings.gradle
    
    77
    -+++ b/tools/nimbus-gradle-plugin/settings.gradle
    
    78
    -@@ -14,6 +14,14 @@ buildscript {
    
    79
    -     if (!gradle.root.hasProperty("mozconfig")) {
    
    80
    -         // in app-services
    
    81
    -         repositories {
    
    82
    -+            maven {
    
    83
    -+                url "file:///var/tmp/dist/gradle-dependencies"
    
    84
    -+                metadataSources {
    
    85
    -+                    gradleMetadata()
    
    86
    -+                    mavenPom()
    
    87
    -+                }
    
    88
    -+            }
    
    89
    -+
    
    90
    -             mavenCentral()
    
    91
    -         }
    
    92
    -     } else {

  • projects/application-services/no-ndk-lookup.diff deleted
    1
    -diff --git a/libs/android_defaults.sh b/libs/android_defaults.sh
    
    2
    -index 2cfcc4206..9e3d3de97 100755
    
    3
    ---- a/libs/android_defaults.sh
    
    4
    -+++ b/libs/android_defaults.sh
    
    5
    -@@ -1,11 +1,7 @@
    
    6
    - #!/usr/bin/env bash
    
    7
    - 
    
    8
    --# Find the NDK.
    
    9
    --pushd ..
    
    10
    --NDK_VERSION=$(./gradlew -q printNdkVersion | tail -1)
    
    11
    --export ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VERSION"
    
    12
    --export ANDROID_NDK_ROOT="$ANDROID_NDK_HOME"
    
    13
    --popd || exit
    
    14
    -+# Do not try to find the NDK, as it does not work offline.
    
    15
    -+# We already define the needed variables in our environment.
    
    16
    - 
    
    17
    - if [[ -z "${ANDROID_NDK_API_VERSION:-}" ]]; then
    
    18
    -     export ANDROID_NDK_API_VERSION=21

  • projects/application-services/offline-nimbus-fml.diff deleted
    1
    -diff --git a/tools/nimbus-gradle-plugin/src/main/groovy/org/mozilla/appservices/tooling/nimbus/NimbusAssembleToolsTask.groovy b/tools/nimbus-gradle-plugin/src/main/groovy/org/mozilla/appservices/tooling/nimbus/NimbusAssembleToolsTask.groovy
    
    2
    -index 67c9e66d0..6dd949c92 100644
    
    3
    ---- a/tools/nimbus-gradle-plugin/src/main/groovy/org/mozilla/appservices/tooling/nimbus/NimbusAssembleToolsTask.groovy
    
    4
    -+++ b/tools/nimbus-gradle-plugin/src/main/groovy/org/mozilla/appservices/tooling/nimbus/NimbusAssembleToolsTask.groovy
    
    5
    -@@ -20,6 +20,11 @@ import org.gradle.api.tasks.Nested
    
    6
    - import org.gradle.api.tasks.OutputFile
    
    7
    - import org.gradle.api.tasks.TaskAction
    
    8
    - 
    
    9
    -+import java.nio.file.Files
    
    10
    -+import java.nio.file.Path
    
    11
    -+import java.nio.file.Paths
    
    12
    -+import java.nio.file.StandardCopyOption
    
    13
    -+
    
    14
    - import javax.inject.Inject
    
    15
    - 
    
    16
    - import groovy.transform.Immutable
    
    17
    -@@ -84,46 +89,17 @@ abstract class NimbusAssembleToolsTask extends DefaultTask {
    
    18
    - 
    
    19
    -     @TaskAction
    
    20
    -     void assembleTools() {
    
    21
    --        def sources = [fetchSpec, *fetchSpec.fallbackSources.get()].collect {
    
    22
    --            new Source(new URI(it.archive.get()), new URI(it.hash.get()))
    
    23
    --        }
    
    24
    --
    
    25
    --        def successfulSource = sources.find { it.trySaveArchiveTo(archiveFile.get().asFile) }
    
    26
    --        if (successfulSource == null) {
    
    27
    --            throw new GradleException("Couldn't fetch archive from any of: ${sources*.archiveURI.collect { "`$it`" }.join(', ')}")
    
    28
    --        }
    
    29
    --
    
    30
    --        // We get the checksum, although don't do anything with it yet;
    
    31
    --        // Checking it here would be able to detect if the zip file was tampered with
    
    32
    --        // in transit between here and the server.
    
    33
    --        // It won't detect compromise of the CI server.
    
    34
    --        try {
    
    35
    --            successfulSource.saveHashTo(hashFile.get().asFile)
    
    36
    --        } catch (IOException e) {
    
    37
    --            throw new GradleException("Couldn't fetch hash from `${successfulSource.hashURI}`", e)
    
    38
    --        }
    
    39
    --
    
    40
    --        def zipTree = archiveOperations.zipTree(archiveFile.get())
    
    41
    --        def visitedFilePaths = []
    
    42
    --        zipTree.matching {
    
    43
    --            include unzipSpec.includePatterns.get()
    
    44
    --        }.visit { FileVisitDetails details ->
    
    45
    --            if (!details.directory) {
    
    46
    --                if (visitedFilePaths.empty) {
    
    47
    --                    details.copyTo(fmlBinary.get().asFile)
    
    48
    --                    fmlBinary.get().asFile.setExecutable(true)
    
    49
    --                }
    
    50
    --                visitedFilePaths.add(details.relativePath)
    
    51
    -+        String nimbusFmlPath = System.getenv("NIMBUS_FML")
    
    52
    -+        Path source
    
    53
    -+        if (nimbusFmlPath == null) {
    
    54
    -+            nimbusFmlPath = System.getProperty("nimbusFml")
    
    55
    -+            if (nimbusFmlPath == null) {
    
    56
    -+                throw new GradleException("NIMBUS_FML and property nimbusFml are not defined.")
    
    57
    -             }
    
    58
    -         }
    
    59
    --
    
    60
    --        if (visitedFilePaths.empty) {
    
    61
    --            throw new GradleException("Couldn't find any files in archive matching unzip spec: (${unzipSpec.includePatterns.get().collect { "`$it`" }.join(' | ')})")
    
    62
    --        }
    
    63
    --
    
    64
    --        if (visitedFilePaths.size() > 1) {
    
    65
    --            throw new GradleException("Ambiguous unzip spec matched ${visitedFilePaths.size()} files in archive: ${visitedFilePaths.collect { "`$it`" }.join(', ')}")
    
    66
    --        }
    
    67
    -+        source = Paths.get(nimbusFmlPath)
    
    68
    -+        Path dest = fmlBinary.get().asFile.toPath()
    
    69
    -+        Files.copy(source, dest, StandardCopyOption.REPLACE_EXISTING)
    
    70
    -     }
    
    71
    - 
    
    72
    -     /**