Bug 1410475: Add support for detecting whether c-c is topdir in mozconfigs; r=mshal
☠☠ backed out by 00904da56d34 ☠ ☠
authorTom Prince <mozilla@hocat.ca>
Thu, 19 Oct 2017 13:55:24 -0600
changeset 29294 539567e1f723a51400d5b14b32c0267d1ce210a9
parent 29293 b9a174f7f3625909b081fc537ce8858d5f201b30
child 29295 4ff617d6bb346f9d2ae955f723c5f19f0fd5b1c4
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1410475
Bug 1410475: Add support for detecting whether c-c is topdir in mozconfigs; r=mshal MozReview-Commit-ID: KdakNqn2ETl
build/check-sync-exceptions
build/mozconfig.comm-support
mail/config/mozconfigs/linux64/nightly
--- a/build/check-sync-exceptions
+++ b/build/check-sync-exceptions
@@ -1,15 +1,16 @@
 dumbmake-dependencies
 mach_bootstrap.py
 merge-installrdf.py
 pymake
 client.py-args
 client.py-l10n-args
 configobj.py
+mozconfig.comm-support
 
 # Ignore detritus left lying around by editing tools.
 *~
 .#*
 #*#
 *.orig
 *.rej
 
new file mode 100644
--- /dev/null
+++ b/build/mozconfig.comm-support
@@ -0,0 +1,22 @@
+# This file exists to support comm-central from building with mozilla-central
+# as a subdirectory to building as a subdirectory of mozilla-central.
+
+# In order to have mozconfig files that support building in either
+# configuration during the transition, without duplicating the logic
+# in every mozconfig file, there needs to exist a file that exists at the
+# same path in mozilla-central and comm-central.
+
+# This file sets some variables that can be used by the rest of the mozconfig
+# to find other include files.
+
+if [ -d "$topsrcdir/mail" ]; then
+  # Building with comm-central as top-level directory.
+  commtopsrcdir=$topsrcdir
+  MOZ_IS_COMM_TOPDIR=1
+elif [ -d "$topsrcdir/comm/mail" ]; then
+  # Building with mozila-central as top-level directory.
+  commtopsrcdir=$topsrcdir/comm
+else
+  echo "ERROR: Unknown build directory layout."
+  exit 1
+fi
--- a/mail/config/mozconfigs/linux64/nightly
+++ b/mail/config/mozconfigs/linux64/nightly
@@ -1,16 +1,21 @@
+. "$topsrcdir/build/mozconfig.comm-support"
 . $topsrcdir/build/unix/mozconfig.linux
-. "$topsrcdir/build/mozconfig.stylo"
+. "$commtopsrcdir/build/mozconfig.stylo"
 
 # Disable webrender on Linux buildbot builders to avoid the Rust requirement
 # of libX11 version > 1.4.99.1 (see bug 1350011).
 ac_add_options --disable-webrender
 
-ac_add_options --enable-application=mail
+if [ "$MOZ_IS_COMM_TOPDIR" == "1" ]; then
+  ac_add_options --enable-application=mail
+else
+  ac_add_options --enable-application=comm/mail
+fi
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-profiling
 ac_add_options --disable-elf-hack # --enable-elf-hack conflicts with --enable-profiling
 ac_add_options --enable-calendar
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
@@ -23,13 +28,14 @@ ac_add_options "MOZ_ALLOW_LEGACY_EXTENSI
 # Disable checking that add-ons are signed by the trusted root
 MOZ_ADDON_SIGNING=0
 # Disable enforcing that add-ons are signed by the trusted root
 MOZ_REQUIRE_ADDON_SIGNING=0
 
 # Package js shell
 export MOZ_PACKAGE_JSSHELL=1
 
-# Run client.py
-mk_add_options CLIENT_PY_ARGS="$([ -f $topsrcdir/build/client.py-args ] && cat $topsrcdir/build/client.py-args)"
-mk_add_options ALWAYS_RUN_CLIENT_PY=1
+if [ "$MOZ_IS_COMM_TOPDIR" == "1" ]; then
+  mk_add_options CLIENT_PY_ARGS="$([ -f $topsrcdir/build/client.py-args ] && cat $topsrcdir/build/client.py-args)"
+  mk_add_options ALWAYS_RUN_CLIENT_PY=1
+fi
 
 . "$topsrcdir/build/mozconfig.cache"