[tbb-commits] [builders/tor-browser-build] 05/05: Bug 40439: Add option for macos single-arch non-universal testbuild

gitolite role git at cupani.torproject.org
Tue Nov 15 09:35:07 UTC 2022


This is an automated email from the git hooks/post-receive script.

boklm pushed a commit to branch main
in repository builders/tor-browser-build.

commit 0553b695c83b9a61abca6ff3b7b42507993f265b
Author: Nicolas Vigier <boklm at torproject.org>
AuthorDate: Fri Oct 28 20:36:47 2022 +0200

    Bug 40439: Add option for macos single-arch non-universal testbuild
    
    `make torbrowser-testbuild-macos-x86_64`
      and
    `make torbrowser-testbuild-macos-aarch64` can be used to do non-universal
    testbuilds for a single arch.
---
 Makefile                |  6 ++++++
 doc/MAKEFILE.txt        | 13 +++++++++++++
 projects/browser/build  | 24 ++++++++++++++----------
 projects/browser/config | 14 +++++++++++---
 projects/release/build  |  6 ++++++
 projects/release/config | 22 ++++++++++++++++++++++
 rbm.conf                | 13 +++++++++++++
 7 files changed, 85 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index fa5220ed..6be00da3 100644
--- a/Makefile
+++ b/Makefile
@@ -171,6 +171,12 @@ torbrowser-testbuild-windows-i686: submodule-update
 torbrowser-testbuild-macos: submodule-update
 	$(rbm) build release --target testbuild --target browser-macos --target torbrowser
 
+torbrowser-testbuild-macos-x86_64: submodule-update
+	$(rbm) build release --target testbuild --target browser-macos-x86_64 --target torbrowser
+
+torbrowser-testbuild-macos-aarch64: submodule-update
+	$(rbm) build release --target testbuild --target browser-macos-aarch64 --target torbrowser
+
 torbrowser-testbuild-src: submodule-update
 	$(rbm) build release --target testbuild --target browser-src-testbuild --target torbrowser
 
diff --git a/doc/MAKEFILE.txt b/doc/MAKEFILE.txt
index 0eec68ff..21704936 100644
--- a/doc/MAKEFILE.txt
+++ b/doc/MAKEFILE.txt
@@ -49,6 +49,19 @@ By default it is based on the alpha channel, but you can change that by
 editing rbm.local.conf. The resulting build can be found in directory
 testbuild.
 
+torbrowser-testbuild-{linux-x86_64,linux-i686,windows-i686,macos,
+                    android-armv7,android-x86,android-x86_64,
+                    android-aarch64,desktop,android}
+-----------------------------------------------------------------
+Same as torbrowser-testbuild, for the selected platform only.
+
+
+torbrowser-testbuild-macos-{x86_64,aarch64}
+-------------------------------------------
+By default, macos builds are universal (targeting x86_64 and aarch64).
+With this special testbuild target, you can do a build for a specific
+arch only.
+
 torbrowser-{release,alpha,nightly,testbuild}-linux-x86_64-asan
 --------------------------------------------------------------
 Create a build for Linux x86_64 with Address Sanitizer enabled.
diff --git a/projects/browser/build b/projects/browser/build
index 34be146a..8cbbc20d 100644
--- a/projects/browser/build
+++ b/projects/browser/build
@@ -21,8 +21,12 @@ touch "$GENERATEDPREFSPATH"
 
 [% IF c("var/macos") %]
   TBDIR="$TB_STAGE_DIR/[% c("var/Project_Name") %].app"
-  TBDIR_AARCH64="$TB_STAGE_DIR/[% c("var/Project_Name") %]-aarch64.app"
-  TBDIRS=("$TBDIR" "$TBDIR_AARCH64")
+  [% IF c("var/macos_universal") %]
+    TBDIR_AARCH64="$TB_STAGE_DIR/[% c("var/Project_Name") %]-aarch64.app"
+    TBDIRS=("$TBDIR" "$TBDIR_AARCH64")
+  [% ELSE -%]
+    TBDIRS=("$TBDIR")
+  [% END -%]
 
   DOCSPATH=Contents/Resources/[% c('var/ProjectName') %]/Docs
   EXTSPATH=Contents/Resources/distribution/extensions
@@ -60,7 +64,7 @@ mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b
     local dest="${args[-1]}"
     unset args[-1]
     mv ${args[@]} "$TBDIR/$dest"
-    [% IF c("var/macos") -%]
+    [% IF c("var/macos_universal") -%]
       for src in ${args[@]}
       do
         mv "aarch64/$src" "$TBDIR_AARCH64/$dest"
@@ -69,27 +73,27 @@ mv [% c('input_files_by_name/noscript') %] "$TBDIR/$EXTSPATH/{73a6fe31-595d-460b
   }
 
   tar -xvf [% c('input_files_by_name/tor-expert-bundle') %]
-  [% IF c("var/macos") -%]
+  [% IF c("var/macos_universal") -%]
     mkdir aarch64
     tar -C aarch64 -xf [% c('input_files_by_name/tor-expert-bundle-aarch64') %]
   [% END -%]
 
   # geoip(6) and anything else that belongs in the data dir from the expert bundle
-  mkdir -p "$TBDIR/$TORCONFIGPATH" [% IF c("var/macos") %]"$TBDIR_AARCH64/$TORCONFIGPATH"[% END %]
+  mkdir -p "$TBDIR/$TORCONFIGPATH" [% IF c("var/macos_universal") %]"$TBDIR_AARCH64/$TORCONFIGPATH"[% END %]
   mv_tbdir data/{geoip,geoip6} "$TORCONFIGPATH"
 
   # Bridge lists will be consumed later in `bridges_conf`
   mv tor/pluggable_transports/bridges_list.*.txt $rootdir
-  [% IF c("var/macos") %]
+  [% IF c("var/macos_universal") %]
     rm -f aarch64/tor/pluggable_transports/bridges_list.*.txt
   [% END -%]
 
   # Snowflake's README is the only documentation shipped in tor-expert-bundle
-  mkdir -p "$TBDIR/$DOCSPATH/snowflake" [% IF c("var/macos") %]"$TBDIR_AARCH64/$DOCSPATH/snowflake"[% END %]
+  mkdir -p "$TBDIR/$DOCSPATH/snowflake" [% IF c("var/macos_universal") %]"$TBDIR_AARCH64/$DOCSPATH/snowflake"[% END %]
   mv_tbdir tor/pluggable_transports/README.SNOWFLAKE.md "$DOCSPATH/snowflake/README.md"
 
   # Move the PTs to where TB expects them
-  mkdir -p "$TBDIR/$TORBINPATH" [% IF c("var/macos") %]"$TBDIR_AARCH64/$TORBINPATH"[% END %]
+  mkdir -p "$TBDIR/$TORBINPATH" [% IF c("var/macos_universal") %]"$TBDIR_AARCH64/$TORBINPATH"[% END %]
   mv_tbdir tor/pluggable_transports "$TORBINPATH/PluggableTransports"
 
   # Move tor and dependencies to where TB expects them
@@ -145,7 +149,7 @@ RBM_TB_EOF
 
 tar -C ${TB_STAGE_DIR} -xf [% c('input_files_by_name/firefox') %]/browser.tar.gz
 
-[% IF c("var/macos") -%]
+[% IF c("var/macos_universal") -%]
   # Use symlink in tmp dir to extract "Tor Browser.app" to "Tor Browser-aarch64.app"
   ff_aarch64=$(mktemp -d)
   ln -s "$TBDIR_AARCH64" "$ff_aarch64/[% c("var/Project_Name") %].app"
@@ -284,7 +288,7 @@ done
   mv $distdir/windows-installer ${TB_STAGE_DIR}
 [% END %]
 
-[% IF c("var/macos") -%]
+[% IF c("var/macos_universal") -%]
   # unify.py requires lipo, so we need to add cctools in the PATH
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/macosx-toolchain') %]
   export PATH="/var/tmp/dist/macosx-toolchain/cctools/bin:$PATH"
diff --git a/projects/browser/config b/projects/browser/config
index db68912a..f9d9cba5 100644
--- a/projects/browser/config
+++ b/projects/browser/config
@@ -28,7 +28,6 @@ targets:
       mar_osname: linux64
   macos:
     var:
-      mar_osname: macos
       arch_deps:
         - genisoimage
         - faketime
@@ -36,6 +35,15 @@ targets:
         - python3-pip
         - python3-distutils-extra
         - python3-psutil
+  macos-universal:
+    var:
+      mar_osname: macos
+  macos-aarch64:
+    var:
+      mar_osname: macos-aarch64
+  macos-x86_64:
+    var:
+      mar_osname: macos-x86_64
   windows:
     var:
       arch_deps:
@@ -66,7 +74,7 @@ input_files:
     enable: '[% ! c("var/android") %]'
   - project: firefox
     name: firefox-aarch64
-    enable: '[% c("var/macos") %]'
+    enable: '[% c("var/macos_universal") %]'
     target_prepend:
       - macos-aarch64
   - project: firefox
@@ -81,7 +89,7 @@ input_files:
     enable: '[% c("var/tor-browser") %]'
   - project: tor-expert-bundle
     name: tor-expert-bundle-aarch64
-    enable: '[% c("var/macos") && c("var/tor-browser") %]'
+    enable: '[% c("var/macos_universal") && c("var/tor-browser") %]'
     target_prepend:
       - macos-aarch64
   - project: fonts
diff --git a/projects/release/build b/projects/release/build
index 84d09b05..1a95362a 100644
--- a/projects/release/build
+++ b/projects/release/build
@@ -25,6 +25,12 @@ mkdir -p "$destdir"
 [% IF c("var/browser-macos") -%]
   mv [% c('input_files_by_name/macos') %]/* "$destdir"/
 [% END -%]
+[% IF c("var/browser-macos-x86_64") -%]
+  mv [% c('input_files_by_name/macos-x86_64') %]/* "$destdir"/
+[% END -%]
+[% IF c("var/browser-macos-aarch64") -%]
+  mv [% c('input_files_by_name/macos-aarch64') %]/* "$destdir"/
+[% END -%]
 [% IF c("var/browser-linux-i686") -%]
   mv [% c('input_files_by_name/linux-i686') %]/* "$destdir"/
 [% END -%]
diff --git a/projects/release/config b/projects/release/config
index cd1c7d74..fb49e0d8 100644
--- a/projects/release/config
+++ b/projects/release/config
@@ -63,6 +63,12 @@ targets:
   browser-macos:
     var:
       browser-macos: 1
+  browser-macos-x86_64:
+    var:
+      browser-macos-x86_64: 1
+  browser-macos-aarch64:
+    var:
+      browser-macos-aarch64: 1
   browser-src:
     var:
       browser-src: '[% ! c("var/testbuild") %]'
@@ -192,6 +198,22 @@ input_files:
      - '[% c("var/build_target") %]'
      - '[% c("var/browser_type") %]-macos'
 
+ # non-universal macos build
+ - name: macos-x86_64
+   project: browser
+   enable: '[% c("var/browser-macos-x86_64") %]'
+   target:
+     - '[% c("var/build_target") %]'
+     - '[% c("var/browser_type") %]-macos-x86_64'
+
+ # non-universal macos build
+ - name: macos-aarch64
+   project: browser
+   enable: '[% c("var/browser-macos-aarch64") %]'
+   target:
+     - '[% c("var/build_target") %]'
+     - '[% c("var/browser_type") %]-macos-aarch64'
+
  - name: src-firefox
    project: firefox
    enable: '[% c("var/browser-src") %]'
diff --git a/rbm.conf b/rbm.conf
index fff2fd68..e1f8b867 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -500,13 +500,26 @@ targets:
         - unzip
 
   torbrowser-macos:
+    - macos-universal
     - macos-x86_64
     - macos
     - torbrowser
+  torbrowser-macos-x86_64:
+    - macos-x86_64
+    - macos
+    - torbrowser
+  torbrowser-macos-aarch64:
+    - macos-aarch64
+    - macos
+    - torbrowser
   basebrowser-macos:
+    - macos-universal
     - macos-x86_64
     - macos
     - basebrowser
+  macos-universal:
+    var:
+      macos_universal: 1
   macos-aarch64:
     arch: aarch64
     var:

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list