commit 9072578261fc2e4198e39b81313683bf2674c5b4 Author: Nicolas Vigier boklm@torproject.org Date: Thu Apr 4 14:35:37 2019 +0200
Bug 29981: Add option to build without using containers
We do that by adding support for a no_containers target which defines the new option var/container/global_disable in rbm.conf. We already had the option var/container/use_container doing something similar to this new option, however it can not be overriden in rbm.conf as we define it in each project's configuration, which has priority over rbm.conf. --- README | 29 +++++++++++++++++++++++++++++ projects/container-image/config | 9 +++++++++ projects/firefox/build | 4 ++-- projects/release/config | 7 +++++++ rbm.conf | 19 +++++++++++++------ 5 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/README b/README index 2b09ab1..1dc2cfd 100644 --- a/README +++ b/README @@ -182,6 +182,35 @@ of files and containers that would be removed without doing it, you can use 'make clean-dry-run'.
+Building without containers (Android builds only) +------------------------------------------------- + +By default the build is done inside containers. Adding the no_containers +target will disable the use of containers. The following commands can +be used to build the alpha version for android-armv7 and android-x86: + + ./rbm/rbm build release --target no_containers --target testbuild \ + --target torbrowser-android-armv7 + ./rbm/rbm build release --target no_containers --target testbuild \ + --target torbrowser-android-x86 + +Note: the logs will still show the use and creation of a container image +called "containers_disabled". This is due to the way we disable the use +of containers: the container-image project is still called, but it will +just create an empty file instead of a real container image. + +The build without containers is currently only supported for the Android +builds, and will require that you run Debian Stretch and install build +dependencies for all the components that are built. This can be done +with the following command: + + # apt-get install build-essential python automake libtool zip unzip + autoconf2.13 openjdk-8-jdk gettext-base autotools-dev \ + automake autoconf libtool autopoint libssl-dev \ + pkg-config zlib1g-dev libparallel-forkmanager-perl \ + libfile-slurp-perl bzip2 xz-utils apksigner + + Common Build Errors -------------------
diff --git a/projects/container-image/config b/projects/container-image/config index 68c401a..effcdf3 100644 --- a/projects/container-image/config +++ b/projects/container-image/config @@ -13,6 +13,15 @@ lsb_release: codename: wheezy release: 7.11
+targets: + no_containers: + filename: containers_disabled + pre: '' + input_files: [] + build: | + mkdir -p [% dest_dir %] + touch [% dest_dir _ '/' _ c('filename') %] + pre: | #!/bin/sh # [% c('var/container/suite') %] diff --git a/projects/firefox/build b/projects/firefox/build index c070770..aace388 100644 --- a/projects/firefox/build +++ b/projects/firefox/build @@ -98,8 +98,8 @@ mv -f $rootdir/[% c('input_files_by_name/mozconfig') %] .mozconfig [% END -%]
[% IF c("var/android") %] - export GRADLE_MAVEN_REPOSITORIES="file:///var/tmp/gradle-dependencies" - gradle_repo=/var/tmp/gradle-dependencies + gradle_repo=/var/tmp/dist/gradle-dependencies + export GRADLE_MAVEN_REPOSITORIES="file://$gradle_repo" # Move Gradle Repo to hard-coded location. This location is embedded in the file # chrome/toolkit/content/global/buildconfig.html so needs to be standard for reproducibility mv $rootdir/[% c('input_files_by_name/gradle-dependencies') %] $gradle_repo diff --git a/projects/release/config b/projects/release/config index 52a416a..ddb17d1 100644 --- a/projects/release/config +++ b/projects/release/config @@ -6,6 +6,7 @@ var: signed_status: unsigned today: '[% USE date; date.format(format = "%Y-%m-%d") %]' publish_dir: '[% c("var/signed_status") %]/[% c("version") %]-[% c("var/torbrowser_build") %]' + containers_target: with_containers
targets: torbrowser-all: @@ -85,6 +86,10 @@ targets: build_target: torbrowser-testbuild publish_dir: ''
+ no_containers: + var: + containers_target: no_containers + signed: var: signed_status: signed @@ -100,6 +105,7 @@ input_files: project: tor-browser enable: '[% c("var/torbrowser-android-armv7") %]' target: + - '[% c("var/containers_target") %]' - '[% c("var/build_target") %]' - torbrowser-android-armv7
@@ -107,6 +113,7 @@ input_files: project: tor-browser enable: '[% c("var/torbrowser-android-x86") %]' target: + - '[% c("var/containers_target") %]' - '[% c("var/build_target") %]' - torbrowser-android-x86
diff --git a/rbm.conf b/rbm.conf index a3482ac..9e4fc78 100644 --- a/rbm.conf +++ b/rbm.conf @@ -40,7 +40,7 @@ var: build_id_txt: | [% c("version") %] [% IF c("git_hash") || c("hg_hash"); GET c("abbrev"); END; %] - [% IF c("var/container/use_container") -%] + [% IF c("var/container/use_container") && ! c("var/container/global_disable") -%] [% c("var/container/suite") %] [% c("var/container/arch") %] [% END -%] @@ -118,6 +118,9 @@ var: export SHELL=/bin/bash export HOME=$rootdir umask 0022 + [% IF c("var/container/global_disable") -%] + rm -Rf /var/tmp/build /var/tmp/dist + [% END -%]
DOCSDIR_project: '[% project %]' set_PTDIR_DOCSDIR: | @@ -351,6 +354,10 @@ targets: var: build_id: 1
+ no_containers: + var: + container: + global_disable: 1
# change the default gpg_wrapper to allow git tag signed using an # expired key. @@ -376,11 +383,11 @@ gpg_wrapper: | exec [% c('gpg_bin') %] [% c('gpg_args') %] --with-fingerprint [% gpg_kr %] "$@" fi
-remote_start: '[% IF c("var/container/use_container") %][% c("runc/remote_start") %][% END %]' -remote_exec: '[% IF c("var/container/use_container") %][% c("runc/remote_exec") %][% END %]' -remote_put: '[% IF c("var/container/use_container") %][% c("runc/remote_put") %][% END %]' -remote_get: '[% IF c("var/container/use_container") %][% c("runc/remote_get") %][% END %]' -remote_finish: '[% IF c("var/container/use_container") %][% c("runc/remote_finish") %][% END %]' +remote_start: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("runc/remote_start") %][% END %]' +remote_exec: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("runc/remote_exec") %][% END %]' +remote_put: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("runc/remote_put") %][% END %]' +remote_get: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("runc/remote_get") %][% END %]' +remote_finish: '[% IF c("var/container/use_container") && ! c("var/container/global_disable") %][% c("runc/remote_finish") %][% END %]'
runc: remote_start: |
tbb-commits@lists.torproject.org