[tbb-commits] [builders/tor-browser-build] 10/10: Bug 23656: Use mozconfig files from tor-browser.git to build firefox

gitolite role git at cupani.torproject.org
Fri Jul 15 09:04:43 UTC 2022


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

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

commit d853ed93c5757f9c09572b97e8ba995dfbf69b0b
Author: Nicolas Vigier <boklm at torproject.org>
AuthorDate: Fri Jun 24 15:29:11 2022 +0200

    Bug 23656: Use mozconfig files from tor-browser.git to build firefox
    
    We replace the multiple mozconfig files with a single one using
    templating. This mozconfig one includes the mozconfig files from
    tor-browser.git (added in tor-browser-build#40477).
    
    We still need to do the same for geckoview.
---
 projects/firefox/build                       |  6 ++-
 projects/firefox/config                      |  2 -
 projects/firefox/mozconfig                   | 68 ++++++++++++++++++++++++++++
 projects/firefox/mozconfig-linux-i686        | 45 ------------------
 projects/firefox/mozconfig-linux-x86_64      | 44 ------------------
 projects/firefox/mozconfig-linux-x86_64-asan | 49 --------------------
 projects/firefox/mozconfig-osx-x86_64        | 53 ----------------------
 projects/firefox/mozconfig-windows-i686      | 48 --------------------
 projects/firefox/mozconfig-windows-x86_64    | 48 --------------------
 9 files changed, 72 insertions(+), 291 deletions(-)

diff --git a/projects/firefox/build b/projects/firefox/build
index a044163..999d79c 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -62,7 +62,9 @@ tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
 mkdir -p $distdir/[% IF ! c("var/osx") %]Browser[% END %]
 
 cd /var/tmp/build/[% project %]-[% c("version") %]
-mv -f $rootdir/[% c('input_files_by_name/mozconfig') %] .mozconfig
+cat > .mozconfig << 'MOZCONFIG_EOF'
+[% INCLUDE mozconfig %]
+MOZCONFIG_EOF
 [% IF c("var/asan") -%]
   # Without disabling LSan our build is blowing up:
   # https://bugs.torproject.org/10599#comment:52
@@ -115,7 +117,7 @@ export MACH_USE_SYSTEM_PYTHON=1
 ./mach build stage-package
 
 [% IF c("var/osx") %]
-  cp -a obj-macos/dist/firefox/* $distdir
+  cp -a obj-*/dist/firefox/* $distdir
   [% IF c("var/base-browser") -%]
     mv "$distdir/Firefox.app" "$distdir/[% c('var/Project_Name') %].app"
   [% END -%]
diff --git a/projects/firefox/config b/projects/firefox/config
index 6ddabbb..bc8d2e2 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -129,8 +129,6 @@ input_files:
   - name: '[% c("var/compiler") %]'
     project: '[% c("var/compiler") %]'
   - filename: get-moz-build-date
-  - filename: 'mozconfig-[% c("var/osname") %][% IF c("var/asan") %]-asan[% END %]'
-    name: mozconfig
   - project: binutils
     name: binutils
     enable: '[% c("var/linux") %]'
diff --git a/projects/firefox/mozconfig b/projects/firefox/mozconfig
new file mode 100755
index 0000000..344a78b
--- /dev/null
+++ b/projects/firefox/mozconfig
@@ -0,0 +1,68 @@
+. $topsrcdir/mozconfig-[% IF c("var/osx"); GET 'macos-x86_64'; ELSE; GET c("var/osname"); END; %][% IF c("var/asan") %]-asan[% END %]
+
+[% IF c("var/linux") -%]
+  # We want to build with clang now and point to the GCC toolchain until #29041 is
+  # fixed. We explicitly need to define the host compiler as well as for some
+  # reason the gcc-toolchain argument does not get passed along otherwise.
+  CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
+  CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
+  HOST_CC=$CC
+  HOST_CXX=$CXX
+
+  export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
+[% END -%]
+
+[% IF c("var/windows") -%]
+  CROSS_COMPILE=1
+
+  HOST_CC="clang"
+  HOST_CXX="clang++"
+  CC="[% c('arch') %]-w64-mingw32-clang"
+  CXX="[% c('arch') %]-w64-mingw32-clang++"
+  CXXFLAGS="-fms-extensions"
+  AR=llvm-ar
+  RANLIB=llvm-ranlib
+
+  clang_path=/var/tmp/dist/mingw-w64-clang
+
+  # For Stylo
+  BINDGEN_CFLAGS="-I$clang_path/[% c('arch') %]-w64-mingw32/include/c++/v1 -I$clang_path/[% c('arch') %]-w64-mingw32/include"
+[% END -%]
+
+[% IF c("var/osx") -%]
+  TOOLCHAIN_DIR=/var/tmp/dist/macosx-toolchain
+
+  # ld needs libLTO.so from llvm
+  mk_add_options "export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/clang/lib"
+
+  CROSS_CCTOOLS_PATH=$TOOLCHAIN_DIR/cctools
+  CROSS_SYSROOT=$TOOLCHAIN_DIR/MacOSX10.12.sdk
+  CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
+  HARDENING_FLAGS="-Werror=format -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2"
+  FLAGS="-target x86_64-apple-darwin -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT $HARDENING_FLAGS"
+
+  export CC="$TOOLCHAIN_DIR/clang/bin/clang $FLAGS"
+  export CXX="$TOOLCHAIN_DIR/clang/bin/clang++ $FLAGS"
+  export LLVMCONFIG=$TOOLCHAIN_DIR/clang/bin/llvm-config
+  export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-pie"
+  export BINDGEN_CFLAGS="$FLAGS"
+  export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin-
+  export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil"
+
+  export HOST_CFLAGS="-g"
+  export HOST_CXXFLAGS="-g"
+  export HOST_LDFLAGS="-g"
+
+  ac_add_options --target=x86_64-apple-darwin
+  export MACOS_SDK_DIR=$CROSS_SYSROOT
+  export MACOS_PRIVATE_FRAMEWORKS_DIR=$CROSS_PRIVATE_FRAMEWORKS
+[% END -%]
+
+[% IF c("var/tor-browser") %]
+  ac_add_options --enable-tor-browser-update
+  ac_add_options --enable-verify-mar
+[% END -%]
+
+ac_add_options --with-relative-profile=[% c('var/ProjectName') %]/Data/Browser
+mk_add_options MOZ_APP_DISPLAYNAME="[% c('var/Project_Name') %]"
+
diff --git a/projects/firefox/mozconfig-linux-i686 b/projects/firefox/mozconfig-linux-i686
deleted file mode 100755
index 2ad1196..0000000
--- a/projects/firefox/mozconfig-linux-i686
+++ /dev/null
@@ -1,45 +0,0 @@
-. $topsrcdir/browser/config/mozconfig
-
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj- at CONFIG_GUESS@
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-
-# We want to build with clang now and point to the GCC toolchain until #29041 is
-# fixed. We explicitly need to define the host compiler as well as for some
-# reason the gcc-toolchain argument does not get passed along otherwise.
-CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
-CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
-HOST_CC=$CC
-HOST_CXX=$CXX
-
-export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
-
-ac_add_options --target=i686-linux-gnu
-
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --enable-official-branding
-
-# Let's support GTK3 for ESR60
-ac_add_options --enable-default-toolkit=cairo-gtk3
-
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
-
-ac_add_options --disable-tests
-ac_add_options --disable-debug
-ac_add_options --disable-crashreporter
-ac_add_options --disable-webrtc
-ac_add_options --disable-parental-controls
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-system-policies
-
-# Bug 31448: ld.gold fails if we don't disable debug-symbols
-ac_add_options --disable-debug-symbols
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
diff --git a/projects/firefox/mozconfig-linux-x86_64 b/projects/firefox/mozconfig-linux-x86_64
deleted file mode 100755
index d6bfdf4..0000000
--- a/projects/firefox/mozconfig-linux-x86_64
+++ /dev/null
@@ -1,44 +0,0 @@
-. $topsrcdir/browser/config/mozconfig
-
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj- at CONFIG_GUESS@
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-
-# We want to build with clang now and point to the GCC toolchain until #29041 is
-# fixed. We explicitly need to define the host compiler as well as for some
-# reason the gcc-toolchain argument does not get passed along otherwise.
-CC="clang --gcc-toolchain=/var/tmp/dist/gcc"
-CXX="clang++ --gcc-toolchain=/var/tmp/dist/gcc"
-HOST_CC=$CC
-HOST_CXX=$CXX
-
-export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
-
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --enable-official-branding
-
-# Let's support GTK3 for ESR60
-ac_add_options --enable-default-toolkit=cairo-gtk3
-
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
-
-ac_add_options --disable-strip
-ac_add_options --disable-install-strip
-ac_add_options --disable-tests
-ac_add_options --disable-debug
-ac_add_options --disable-crashreporter
-ac_add_options --disable-webrtc
-ac_add_options --disable-parental-controls
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-system-policies
-# We want to bundle an own geckodriver, so we can use it for QA and other work
-ac_add_options --enable-geckodriver
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
diff --git a/projects/firefox/mozconfig-linux-x86_64-asan b/projects/firefox/mozconfig-linux-x86_64-asan
deleted file mode 100644
index 508847a..0000000
--- a/projects/firefox/mozconfig-linux-x86_64-asan
+++ /dev/null
@@ -1,49 +0,0 @@
-. $topsrcdir/browser/config/mozconfig
-
-export CFLAGS="-fsanitize=address -Dxmalloc=myxmalloc"
-export CXXFLAGS="-fsanitize=address -Dxmalloc=myxmalloc"
-# We need to add -ldl explicitely due to bug 1213698
-export LDFLAGS="-fsanitize=address -ldl"
-
-# Define HOST_CFLAGS, etc. to avoid compiling programs such as mbsdiff
-# (which is part of mar-tools and is not distributed to end-users) with
-# ASan. See bug 17858.
-export HOST_CFLAGS=""
-export HOST_CXXFLAGS=""
-export HOST_LDFLAGS="-ldl"
-
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj- at CONFIG_GUESS@
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-export BINDGEN_CFLAGS='--gcc-toolchain=/var/tmp/dist/gcc'
-
-ac_add_options --enable-address-sanitizer
-ac_add_options --disable-jemalloc
-ac_add_options --disable-elf-hack
-ac_add_options --with-clang-path=/var/tmp/dist/clang/bin/clang
-
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --enable-official-branding
-
-# Let's support GTK3 for ESR60
-ac_add_options --enable-default-toolkit=cairo-gtk3
-
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
-
-ac_add_options --disable-strip
-ac_add_options --disable-install-strip
-ac_add_options --disable-tests
-ac_add_options --disable-debug
-ac_add_options --disable-crashreporter
-ac_add_options --disable-webrtc
-ac_add_options --disable-parental-controls
-ac_add_options --disable-eme
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-system-policies
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
diff --git a/projects/firefox/mozconfig-osx-x86_64 b/projects/firefox/mozconfig-osx-x86_64
deleted file mode 100644
index ad5ea84..0000000
--- a/projects/firefox/mozconfig-osx-x86_64
+++ /dev/null
@@ -1,53 +0,0 @@
-TOOLCHAIN_DIR=/var/tmp/dist/macosx-toolchain
-
-# ld needs libLTO.so from llvm
-mk_add_options "export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/clang/lib"
-
-CROSS_CCTOOLS_PATH=$TOOLCHAIN_DIR/cctools
-CROSS_SYSROOT=$TOOLCHAIN_DIR/MacOSX10.12.sdk
-CROSS_PRIVATE_FRAMEWORKS=$CROSS_SYSROOT/System/Library/PrivateFrameworks
-HARDENING_FLAGS="-Werror=format -Werror=format-security -fstack-protector-strong -D_FORTIFY_SOURCE=2"
-FLAGS="-target x86_64-apple-darwin -B $CROSS_CCTOOLS_PATH/bin -isysroot $CROSS_SYSROOT $HARDENING_FLAGS"
-
-export CC="$TOOLCHAIN_DIR/clang/bin/clang $FLAGS"
-export CXX="$TOOLCHAIN_DIR/clang/bin/clang++ $FLAGS"
-export LLVMCONFIG=$TOOLCHAIN_DIR/clang/bin/llvm-config
-export LDFLAGS="-Wl,-syslibroot,$CROSS_SYSROOT -Wl,-pie"
-export BINDGEN_CFLAGS="$FLAGS"
-export TOOLCHAIN_PREFIX=$CROSS_CCTOOLS_PATH/bin/x86_64-apple-darwin-
-export DSYMUTIL="$TOOLCHAIN_DIR/clang/bin/dsymutil"
-
-export HOST_CFLAGS="-g"
-export HOST_CXXFLAGS="-g"
-export HOST_LDFLAGS="-g"
-
-ac_add_options --target=x86_64-apple-darwin
-export MACOS_SDK_DIR=$CROSS_SYSROOT
-export MACOS_PRIVATE_FRAMEWORKS_DIR=$CROSS_PRIVATE_FRAMEWORKS
-
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-macos
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-
-ac_add_options --enable-application=browser
-ac_add_options --enable-strip
-ac_add_options --enable-official-branding
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --disable-debug
-
-ac_add_options --enable-tor-browser-data-outside-app-dir
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-
-ac_add_options --disable-crashreporter
-ac_add_options --disable-webrtc
-ac_add_options --disable-parental-controls
-ac_add_options --disable-tests
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-system-policies
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
diff --git a/projects/firefox/mozconfig-windows-i686 b/projects/firefox/mozconfig-windows-i686
deleted file mode 100644
index 0472eb1..0000000
--- a/projects/firefox/mozconfig-windows-i686
+++ /dev/null
@@ -1,48 +0,0 @@
-CROSS_COMPILE=1
-
-HOST_CC="clang"
-HOST_CXX="clang++"
-CC="i686-w64-mingw32-clang"
-CXX="i686-w64-mingw32-clang++"
-CXXFLAGS="-fms-extensions"
-AR=llvm-ar
-RANLIB=llvm-ranlib
-
-clang_path=/var/tmp/dist/mingw-w64-clang
-
-# For Stylo
-BINDGEN_CFLAGS="-I$clang_path/i686-w64-mingw32/include/c++/v1 -I$clang_path/i686-w64-mingw32/include"
-
-ac_add_options --enable-application=browser
-ac_add_options --target=i686-w64-mingw32
-ac_add_options --with-toolchain-prefix=i686-w64-mingw32-
-ac_add_options --enable-default-toolkit=cairo-windows
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mingw
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-
-ac_add_options --disable-debug
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --enable-strip
-ac_add_options --enable-official-branding
-
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-ac_add_options --disable-bits-download
-
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
-
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
-ac_add_options --disable-crashreporter
-ac_add_options --disable-maintenance-service
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-system-policies
-ac_add_options --disable-webrtc # Bug 1393901
-ac_add_options --disable-parental-controls
-ac_add_options --disable-tests
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
-ac_add_options --disable-default-browser-agent
diff --git a/projects/firefox/mozconfig-windows-x86_64 b/projects/firefox/mozconfig-windows-x86_64
deleted file mode 100644
index 66a8734..0000000
--- a/projects/firefox/mozconfig-windows-x86_64
+++ /dev/null
@@ -1,48 +0,0 @@
-CROSS_COMPILE=1
-
-HOST_CC="clang"
-HOST_CXX="clang++"
-CC="x86_64-w64-mingw32-clang"
-CXX="x86_64-w64-mingw32-clang++"
-CXXFLAGS="-fms-extensions"
-AR=llvm-ar
-RANLIB=llvm-ranlib
-
-clang_path=/var/tmp/dist/mingw-w64-clang
-
-# For Stylo
-BINDGEN_CFLAGS="-I$clang_path/x86_64-w64-mingw32/include/c++/v1 -I$clang_path/x86_64-w64-mingw32/include"
-
-ac_add_options --enable-application=browser
-ac_add_options --target=x86_64-w64-mingw32
-ac_add_options --with-toolchain-prefix=x86_64-w64-mingw32-
-ac_add_options --enable-default-toolkit=cairo-windows
-mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mingw
-mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
-export MOZILLA_OFFICIAL=1
-
-ac_add_options --disable-debug
-ac_add_options --enable-optimize
-ac_add_options --enable-rust-simd
-ac_add_options --enable-strip
-ac_add_options --enable-official-branding
-
-ac_add_options --enable-tor-browser-update
-ac_add_options --enable-verify-mar
-ac_add_options --disable-bits-download
-
-ac_add_options --with-relative-profile=TorBrowser/Data/Browser
-
-# Let's make sure no preference is enabling either Adobe's or Google's CDM.
-ac_add_options --disable-eme
-ac_add_options --disable-crashreporter
-ac_add_options --disable-maintenance-service
-ac_add_options --enable-proxy-bypass-protection
-ac_add_options --disable-webrtc # Bug 1393901
-ac_add_options --disable-parental-controls
-ac_add_options --disable-tests
-ac_add_options --disable-system-policies
-
-# Disable telemetry
-ac_add_options MOZ_TELEMETRY_REPORTING=
-ac_add_options --disable-default-browser-agent

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


More information about the tbb-commits mailing list