Pier Angelo Vendrame pushed to branch tor-browser-102.9.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits: c13ad2e8 by Pier Angelo Vendrame at 2023-03-22T14:18:11+01:00 fixup! TB3: Tor Browser's official .mozconfigs.
Bug 41684: Fix Android mozconfigs for local dev builds
- - - - - 23624ebe by Pier Angelo Vendrame at 2023-03-22T14:18:12+01:00 fixup! Base Browser's .mozconfigs.
Bug 41684: Fix Android mozconfigs for local dev builds
- - - - - cbc8642f by Pier Angelo Vendrame at 2023-03-22T14:18:12+01:00 fixup! Bug 41089: Add tor-browser build scripts + Makefile to tor-browser
Bug 41684: Fix Android mozconfigs for local dev builds
The shell script matched x86 with x86_64. I do not know how to match an entire token in shell scripts, so I switched to a Python script, instead.
- - - - -
6 changed files:
- browser/config/mozconfigs/base-browser-android - browser/config/mozconfigs/tor-browser-android - mozconfig-android-all - tools/torbrowser/Makefile - + tools/torbrowser/fataar.py - − tools/torbrowser/fataar.sh
Changes:
===================================== browser/config/mozconfigs/base-browser-android ===================================== @@ -38,6 +38,7 @@ ac_add_options MOZ_TELEMETRY_REPORTING= if test -n "$LOCAL_DEV_BUILD"; then # You must use the "default" bogus channel for dev builds ac_add_options --enable-update-channel=default + ac_add_options --with-base-browser-version=dev-build else # We only use beta GeckoView for now, for official builds ac_add_options --enable-update-channel=beta
===================================== browser/config/mozconfigs/tor-browser-android ===================================== @@ -1,7 +1,3 @@ . $topsrcdir/browser/config/mozconfigs/base-browser-android
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser" - -if test ! -z "$LOCAL_DEV_BUILD"; then - ac_add_options --with-tor-browser-version=dev-build -fi
===================================== mozconfig-android-all ===================================== @@ -10,7 +10,7 @@ if test -n "$LOCAL_DEV_BUILD"; then # You must use the "default" bogus channel for dev builds ac_add_options --enable-update-channel=default ac_add_options --without-wasm-sandboxed-libraries - ac_add_options --with-tor-browser-version=dev-build + ac_add_options --with-base-browser-version=dev-build else # We want to have a similar fat .aar versioning as Mozilla and make it clear # we are on the beta channel for GeckoView
===================================== tools/torbrowser/Makefile ===================================== @@ -29,7 +29,7 @@ deploy: ./deploy.sh $(BINARIES) $(BUILD_OUTPUT)
fat-aar: - ./fataar.sh $(DEV_ROOT) $(ARCHS) + ./fataar.py $(DEV_ROOT) $(ARCHS)
all: build deploy
===================================== tools/torbrowser/fataar.py ===================================== @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +import os +import re +import subprocess +import sys + + +dev_root = sys.argv[1] +archs_in = re.split("\s+|,", sys.argv[2]) if len(sys.argv) >= 3 else [] +archs_out = [] +env = dict(os.environ) + +env["MOZCONFIG"] = "mozconfig-android-all" +if "armv7" in archs_in: + env["MOZ_ANDROID_FAT_AAR_ARMEABI_V7A"] = ( + dev_root + + "/obj-arm-linux-androideabi/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar" + ) + archs_out.append("armeabi-v7a") +if "aarch64" in archs_in: + env["MOZ_ANDROID_FAT_AAR_ARM64_V8A"] = ( + dev_root + + "/obj-aarch64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar" + ) + archs_out.append("arm64-v8a") +if "x86" in archs_in or "i686" in archs_in: + env["MOZ_ANDROID_FAT_AAR_X86"] = ( + dev_root + + "/obj-i386-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar" + ) + archs_out.append("x86") +if "x86_64" in archs_in or "x86-64" in archs_in: + env["MOZ_ANDROID_FAT_AAR_X86_64"] = ( + dev_root + + "/obj-x86_64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar" + ) + archs_out.append("x86_64") +env["MOZ_ANDROID_FAT_AAR_ARCHITECTURES"] = ",".join(archs_out) + +if not archs_out: + print( + "The architectures have not specified or are not valid.", + file=sys.stderr, + ) + print('Usage: make fat-aar ARCHS="$archs"', file=sys.stderr) + print( + "Valid architectures are armv7 aarch64 x86 x86_64, and must be separated with a space.", + file=sys.stderr, + ) + sys.exit(1) + +subprocess.run(["./mach", "configure"], cwd=dev_root, env=env, check=True) +subprocess.run(["./mach", "build"], cwd=dev_root, env=env, check=True)
===================================== tools/torbrowser/fataar.sh deleted ===================================== @@ -1,34 +0,0 @@ -#!/bin/bash -set -e -DEV_ROOT=$1 -ARCHS=$2 - -cd $DEV_ROOT - -glue="" -if [[ "$ARCHS" == *"armv7"* ]]; then - export MOZ_ANDROID_FAT_AAR_ARMEABI_V7A=$DEV_ROOT/obj-arm-linux-androideabi/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar - glue="$glue,armeabi-v7a" -fi -if [[ "$ARCHS" == *"aarch64"* ]]; then - export MOZ_ANDROID_FAT_AAR_ARM64_V8A=$DEV_ROOT/obj-aarch64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar - glue="$glue,arm64-v8a" -fi -if [[ "$ARCHS" == *"x86"* ]]; then - export MOZ_ANDROID_FAT_AAR_X86=$DEV_ROOT/obj-i386-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar - glue="$glue,x86" -fi -if [[ "$ARCHS" == *"x86_64"* ]]; then - export MOZ_ANDROID_FAT_AAR_X86_64=$DEV_ROOT/obj-x86_64-linux-android/gradle/build/mobile/android/geckoview/outputs/aar/geckoview-withGeckoBinaries-debug.aar - glue="$glue,x86_64" -fi -if [ -z "$glue" ]; then - echo "The architectures have not specified or are not valid." - echo "Usage: make fat-aar ARCHS="$archs"" - echo "Valid architectures are armv7 aarch64 x86 x86_64, and must be separated with a space." - exit 1 -fi -export MOZ_ANDROID_FAT_AAR_ARCHITECTURES=${glue:1} - -MOZCONFIG=mozconfig-android-all ./mach configure -MOZCONFIG=mozconfig-android-all ./mach build
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/compare/2a2e87c...
tor-commits@lists.torproject.org