Backed out 2 changesets (bug 1443204) for build bustages at mozbuild/test/frontend/test_emitter.py on a CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Wed, 07 Mar 2018 23:58:00 +0200
changeset 462061 c3d771dd55dbe91cd1c67787ffe74f784dccaca0
parent 462060 9703d2406c22f4843c0d7f3efc5583ad7ccb8c9c
child 462062 18d68a0c96e62e9c48833cf12dbecda8f37eccc4
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1443204
milestone60.0a1
backs outeb1dfa51050f47c2b6a66e521e75c9ed6e95800f
e3a7560b42061f927bc932947381aa795e5a6dee
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1443204) for build bustages at mozbuild/test/frontend/test_emitter.py on a CLOSED TREE Backed out changeset eb1dfa51050f (bug 1443204) Backed out changeset e3a7560b4206 (bug 1443204)
mobile/android/base/Makefile.in
mobile/android/base/moz.build
mobile/android/geckoview/BuildConfig.java.in
mobile/android/geckoview/build.gradle
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/data.py
python/mozbuild/mozbuild/frontend/emitter.py
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -25,16 +25,17 @@ GARBAGE_DIRS += classes db jars res sync
 generated_resources := \
   AndroidManifest.xml \
   res/raw/browsersearch.json \
   res/raw/suggestedsites.json \
   res/values/strings.xml \
   $(NULL)
 
 generated_files := \
+  ../geckoview/generated/preprocessed/org/mozilla/geckoview/BuildConfig.java \
   AndroidManifest.xml \
   generated/preprocessed/org/mozilla/gecko/AdjustConstants.java \
   generated/preprocessed/org/mozilla/gecko/AppConstants.java \
   generated/preprocessed/org/mozilla/gecko/MmaConstants.java \
   $(NULL)
 
 gradle_dir := $(topobjdir)/gradle/build/mobile/android
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -107,21 +107,25 @@ with Files('../app/src/*/res/menu/*activ
     BUG_COMPONENT = ('Firefox for Android', 'Awesomescreen')
 
 with Files('../app/src/*/res/menu/browsersearch_contextmenu.xml'):
     BUG_COMPONENT = ('Firefox for Android', 'Awesomescreen')
 
 DIRS += ['locales']
 
 GENERATED_FILES += [
+    '../geckoview/generated/preprocessed/org/mozilla/geckoview/BuildConfig.java',
     'AndroidManifest.xml',
     'generated/preprocessed/org/mozilla/gecko/AdjustConstants.java',
     'generated/preprocessed/org/mozilla/gecko/AppConstants.java',
     'generated/preprocessed/org/mozilla/gecko/MmaConstants.java',
 ]
+w = GENERATED_FILES['../geckoview/generated/preprocessed/org/mozilla/geckoview/BuildConfig.java']
+w.script = 'generate_build_config.py:generate_java'
+w.inputs += ['../geckoview/BuildConfig.java.in']
 x = GENERATED_FILES['generated/preprocessed/org/mozilla/gecko/AdjustConstants.java']
 x.script = 'generate_build_config.py:generate_java'
 x.inputs += ['AdjustConstants.java.in']
 y = GENERATED_FILES['generated/preprocessed/org/mozilla/gecko/AppConstants.java']
 y.script = 'generate_build_config.py:generate_java'
 y.inputs += ['AppConstants.java.in']
 y = GENERATED_FILES['generated/preprocessed/org/mozilla/gecko/MmaConstants.java']
 y.script = 'generate_build_config.py:generate_java'
new file mode 100644
--- /dev/null
+++ b/mobile/android/geckoview/BuildConfig.java.in
@@ -0,0 +1,106 @@
+//#filter substitution
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+package org.mozilla.geckoview;
+
+import android.os.Build;
+
+/**
+ * A collection of constants that pertain to the build state of the GeckoView
+ * library, sourced from build-time definitions.  This is a partial Java-side
+ * substitute for nsIXULAppInfo, amongst other things.
+ *
+ * See also SysInfo.java, which includes some of the values available from
+ * nsSystemInfo inside Gecko.
+ */
+public class BuildConfig {
+    public static final String GRE_MILESTONE = "@GRE_MILESTONE@";
+
+    public static final String MOZ_APP_ABI = "@MOZ_APP_ABI@";
+    public static final String MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@";
+
+    // For the benefit of future archaeologists:
+    // GRE_BUILDID is exactly the same as MOZ_APP_BUILDID unless you're running
+    // on XULRunner, which is never the case on Android.
+    public static final String MOZ_APP_BUILDID = "@MOZ_BUILDID@";
+    public static final String MOZ_APP_ID = "@MOZ_APP_ID@";
+    public static final String MOZ_APP_NAME = "@MOZ_APP_NAME@";
+    public static final String MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@";
+    public static final String MOZ_APP_VERSION = "@MOZ_APP_VERSION@";
+    public static final String MOZ_APP_DISPLAYNAME = "@MOZ_APP_DISPLAYNAME@";
+    public static final String MOZ_APP_UA_NAME = "@MOZ_APP_UA_NAME@";
+
+    // MOZILLA_VERSION is already quoted when it gets substituted in. If we
+    // add additional quotes we end up with ""x.y"", which is a syntax error.
+    public static final String MOZILLA_VERSION = @MOZILLA_VERSION@;
+    public static final String OMNIJAR_NAME = "@OMNIJAR_NAME@";
+
+    public static final String USER_AGENT_GECKOVIEW_MOBILE = "Mozilla/5.0 (Android " +
+        Build.VERSION.RELEASE + "; Mobile; rv:" +
+        MOZ_APP_VERSION + ") Gecko/" +
+        MOZ_APP_VERSION + " GeckoView/" +
+        MOZ_APP_VERSION;
+
+    public static final String USER_AGENT_GECKOVIEW_TABLET = "Mozilla/5.0 (Android " +
+        Build.VERSION.RELEASE + "; Tablet; rv:" +
+        MOZ_APP_VERSION + ") Gecko/" +
+        MOZ_APP_VERSION + " GeckoView/" +
+        MOZ_APP_VERSION;
+
+    /**
+     * Target CPU architecture: "armeabi-v7a", "arm64-v8a", "x86", "mips", ..
+     */
+    public static final String ANDROID_CPU_ARCH = "@ANDROID_CPU_ARCH@";
+
+    public static final String MOZ_UPDATE_CHANNEL = "@MOZ_UPDATE_CHANNEL@";
+
+    public static final int MIN_SDK_VERSION = @MOZ_ANDROID_MIN_SDK_VERSION@;
+
+    // Is the underlying compiled C/C++ code compiled with --enable-debug?
+    public static final boolean DEBUG_BUILD =
+//#ifdef MOZ_DEBUG
+    true;
+//#else
+    false;
+//#endif
+
+    // See this wiki page for more details about channel specific build defines:
+    // https://wiki.mozilla.org/Platform/Channel-specific_build_defines
+    // This makes no sense for GeckoView and should be removed as soon as possible.
+    public static final boolean RELEASE_OR_BETA =
+//#ifdef RELEASE_OR_BETA
+    true;
+//#else
+    false;
+//#endif
+
+    // This makes no sense for GeckoView and should be removed as soon as possible.
+    public static final boolean NIGHTLY_BUILD =
+//#ifdef NIGHTLY_BUILD
+    true;
+//#else
+    false;
+//#endif
+
+    // This makes no sense for GeckoView and should be removed as soon as possible.
+    public static final boolean MOZ_CRASHREPORTER =
+//#ifdef MOZ_CRASHREPORTER
+    true;
+//#else
+    false;
+//#endif
+
+    // Official corresponds, roughly, to whether this build is performed on
+    // Mozilla's continuous integration infrastructure. You should disable
+    // developer-only functionality when this flag is set.
+    // This makes no sense for GeckoView and should be removed as soon as possible.
+    public static final boolean MOZILLA_OFFICIAL =
+//#ifdef MOZILLA_OFFICIAL
+    true;
+//#else
+    false;
+//#endif
+}
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -48,16 +48,18 @@ android {
         manifestPlaceholders = project.ext.manifestPlaceholders
 
         versionCode computeVersionCode()
         versionName "${mozconfig.substs.MOZ_APP_VERSION}-${mozconfig.substs.MOZ_UPDATE_CHANNEL}"
         consumerProguardFiles 'proguard-rules.txt'
 
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
 
+        // TODO: ensure these fields always agree with mobile/android/geckoview/BuildConfig.java.in,
+        // either by diffing the processed files or by generating the output from a single source.
         buildConfigField 'String', "GRE_MILESTONE", "\"${mozconfig.substs.GRE_MILESTONE}\""
         // This should really come from the included binaries, but that's not easy.
         buildConfigField 'String', "MOZ_APP_ABI", mozconfig.substs['COMPILE_ENVIRONMENT'] ? "\"${ mozconfig.substs.TARGET_XPCOM_ABI}\"" : '"arm-eabi-gcc3"';
         buildConfigField 'String', "MOZ_APP_BASENAME", "\"${mozconfig.substs.MOZ_APP_BASENAME}\"";
 
         // For the benefit of future archaeologists:
         // GRE_BUILDID is exactly the same as MOZ_APP_BUILDID unless you're running
         // on XULRunner, which is never the case on Android.
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -24,16 +24,20 @@ from mozbuild.frontend.context import (
     AbsolutePath,
     Path,
     RenamedSourcePath,
     SourcePath,
     ObjDirPath,
 )
 from .common import CommonBackend
 from ..frontend.data import (
+    AndroidAssetsDirs,
+    AndroidResDirs,
+    AndroidExtraResDirs,
+    AndroidExtraPackages,
     BaseLibrary,
     BaseProgram,
     ChromeManifestEntry,
     ComputedFlags,
     ConfigFileSubstitution,
     ContextDerived,
     ContextWrapped,
     Defines,
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -1128,16 +1128,69 @@ class GeneratedFile(ContextDerived):
             '.inc',
             '.py',
             '.rs',
             'new', # 'new' is an output from make-stl-wrappers.py
         )
         self.required_for_compile = any(f.endswith(suffixes) for f in self.outputs)
 
 
+class AndroidResDirs(ContextDerived):
+    """Represents Android resource directories."""
+
+    __slots__ = (
+        'paths',
+    )
+
+    def __init__(self, context, paths):
+        ContextDerived.__init__(self, context)
+        self.paths = paths
+
+
+class AndroidAssetsDirs(ContextDerived):
+    """Represents Android assets directories."""
+
+    __slots__ = (
+        'paths',
+    )
+
+    def __init__(self, context, paths):
+        ContextDerived.__init__(self, context)
+        self.paths = paths
+
+
+class AndroidExtraResDirs(ContextDerived):
+    """Represents Android extra resource directories.
+
+    Extra resources are resources provided by libraries and including in a
+    packaged APK, but not otherwise redistributed.  In practice, this means
+    resources included in Fennec but not in GeckoView.
+    """
+
+    __slots__ = (
+        'paths',
+    )
+
+    def __init__(self, context, paths):
+        ContextDerived.__init__(self, context)
+        self.paths = paths
+
+
+class AndroidExtraPackages(ContextDerived):
+    """Represents Android extra packages."""
+
+    __slots__ = (
+        'packages',
+    )
+
+    def __init__(self, context, packages):
+        ContextDerived.__init__(self, context)
+        self.packages = packages
+
+
 class ChromeManifestEntry(ContextDerived):
     """Represents a chrome.manifest entry."""
 
     __slots__ = (
         'path',
         'entry',
     )
 
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -18,16 +18,20 @@ from mozbuild.util import (
     OrderedDefaultDict,
 )
 
 import mozpack.path as mozpath
 import mozinfo
 import pytoml
 
 from .data import (
+    AndroidAssetsDirs,
+    AndroidExtraPackages,
+    AndroidExtraResDirs,
+    AndroidResDirs,
     BaseRustProgram,
     BaseSources,
     ChromeManifestEntry,
     ComputedFlags,
     ConfigFileSubstitution,
     ContextWrapped,
     Defines,
     DirectoryTraversal,