Backed out changeset 028a7f4e4b32 (bug 1776255) for causing Linux artifact builds bustages on central CLOSED TREE

This commit is contained in:
Cristian Tuns
2022-11-26 17:13:36 -05:00
parent 1685b29aed
commit cd2b114ec2
9 changed files with 47 additions and 141 deletions

View File

@@ -19,19 +19,10 @@ def enable_nspr_build(enable):
return enable return enable
system_lib_option( system_lib_option("--with-system-nspr", help="Use system NSPR")
"--with-system-nspr",
help="Use system NSPR",
when=use_pkg_config,
)
@depends("--with-system-nspr", when=use_pkg_config) @depends(enable_nspr_build, "--with-system-nspr", js_standalone)
def with_system_nspr_option(with_system_nspr):
return with_system_nspr
@depends(enable_nspr_build, with_system_nspr_option, js_standalone)
def build_nspr(nspr_build, system_nspr, js_standalone): def build_nspr(nspr_build, system_nspr, js_standalone):
if nspr_build is not None and nspr_build.origin != "default": if nspr_build is not None and nspr_build.origin != "default":
if nspr_build and system_nspr: if nspr_build and system_nspr:
@@ -45,7 +36,7 @@ set_config("MOZ_BUILD_NSPR", True, when=build_nspr)
set_config("MOZ_SYSTEM_NSPR", True, when="--with-system-nspr") set_config("MOZ_SYSTEM_NSPR", True, when="--with-system-nspr")
@depends(build_nspr, with_system_nspr_option, js_standalone) @depends(build_nspr, "--with-system-nspr", js_standalone)
def js_without_nspr(build_nspr, system_nspr, js_standalone): def js_without_nspr(build_nspr, system_nspr, js_standalone):
if js_standalone: if js_standalone:
return not build_nspr and not system_nspr return not build_nspr and not system_nspr
@@ -83,7 +74,7 @@ def nspr_pkg(nspr_pkg):
) )
@depends(with_system_nspr_option, nspr_minver) @depends("--with-system-nspr", nspr_minver)
def pkgconf_requires_private(system_nspr, nspr_minver): def pkgconf_requires_private(system_nspr, nspr_minver):
if not system_nspr: if not system_nspr:
return "" return ""

View File

@@ -4,11 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
system_lib_option( system_lib_option("--with-system-nss", help="Use system NSS")
"--with-system-nss",
help="Use system NSS",
when=use_pkg_config,
)
imply_option("--with-system-nspr", True, when="--with-system-nss") imply_option("--with-system-nspr", True, when="--with-system-nss")

View File

@@ -10,17 +10,13 @@ def pkg_config(prefixes):
return tuple("{}pkg-config".format(p) for p in (prefixes or ()) + ("",)) return tuple("{}pkg-config".format(p) for p in (prefixes or ()) + ("",))
@depends(compile_environment, target)
def use_pkg_config(compile_environment, target):
return compile_environment and target.os not in ("WINNT", "OSX", "Android")
pkg_config = check_prog( pkg_config = check_prog(
"PKG_CONFIG", "PKG_CONFIG",
pkg_config, pkg_config,
bootstrap=depends(when=target_sysroot.bootstrapped)(lambda: "pkgconf"), bootstrap=depends(when=target_sysroot.bootstrapped)(lambda: "pkgconf"),
allow_missing=True, allow_missing=True,
when=use_pkg_config, when=compile_environment
& depends(target.os)(lambda os: os not in ("WINNT", "OSX", "Android")),
) )
@@ -105,12 +101,7 @@ set_config("PKG_CONFIG_LIBDIR", pkg_config_vars.PKG_CONFIG_LIBDIR)
# Returns `True` when the package description is fulfilled. # Returns `True` when the package description is fulfilled.
@template @template
def pkg_check_modules( def pkg_check_modules(
var, var, package_desc, when=always, allow_missing=False, config=True, cflags_only=False
package_desc,
when=always,
allow_missing=False,
config=True,
cflags_only=False,
): ):
@depends(dependable(package_desc), when=when) @depends(dependable(package_desc), when=when)
def package_desc(desc): def package_desc(desc):
@@ -125,11 +116,11 @@ def pkg_check_modules(
allow_missing = dependable(allow_missing) allow_missing = dependable(allow_missing)
@depends(when, when=use_pkg_config) @depends(when, "--enable-compile-environment")
def when_and_use_pkg_config(when): def when_and_compile_environment(when, compile_environment):
return when return when and compile_environment
@depends(pkg_config, pkg_config_version, when=when_and_use_pkg_config) @depends(pkg_config, pkg_config_version, when=when_and_compile_environment)
def check_pkg_config(pkg_config, version): def check_pkg_config(pkg_config, version):
min_version = "0.9.0" min_version = "0.9.0"
if pkg_config is None: if pkg_config is None:
@@ -149,7 +140,7 @@ def pkg_check_modules(
pkg_config_env, pkg_config_env,
package_desc, package_desc,
allow_missing, allow_missing,
when=when_and_use_pkg_config, when=when_and_compile_environment,
) )
@imports("sys") @imports("sys")
@imports(_from="mozbuild.configure.util", _import="LineIO") @imports(_from="mozbuild.configure.util", _import="LineIO")

View File

@@ -1034,11 +1034,7 @@ target_sysroot = sysroot(target)
def system_lib_option(name, *args, **kwargs): def system_lib_option(name, *args, **kwargs):
option(name, *args, **kwargs) option(name, *args, **kwargs)
@depends( @depends(name, target_sysroot.bootstrapped)
name,
target_sysroot.bootstrapped,
when=kwargs.get("when"),
)
def no_system_lib_in_sysroot(value, bootstrapped): def no_system_lib_in_sysroot(value, bootstrapped):
if bootstrapped and value: if bootstrapped and value:
die( die(

View File

@@ -15,12 +15,10 @@ def force_system_ffi(target):
imply_option("--with-system-ffi", force_system_ffi, "target") imply_option("--with-system-ffi", force_system_ffi, "target")
system_lib_option( system_lib_option(
"--with-system-ffi", "--with-system-ffi", help="Use system libffi (located with pkgconfig)"
help="Use system libffi (located with pkgconfig)",
when=use_pkg_config,
) )
use_system_ffi = depends_if("--with-system-ffi", when=use_pkg_config)(lambda _: True) use_system_ffi = depends_if("--with-system-ffi")(lambda _: True)
system_ffi = pkg_check_modules("MOZ_FFI", "libffi > 3.0.9", when=use_system_ffi) system_ffi = pkg_check_modules("MOZ_FFI", "libffi > 3.0.9", when=use_system_ffi)

View File

@@ -1014,22 +1014,12 @@ set_define(
# ECMAScript Internationalization API Support (uses ICU) # ECMAScript Internationalization API Support (uses ICU)
# ====================================================== # ======================================================
system_lib_option( system_lib_option("--with-system-icu", help="Use system ICU")
"--with-system-icu",
help="Use system ICU",
when=use_pkg_config,
)
@depends("--with-system-icu", when=use_pkg_config)
def enable_system_icu_option(enable_system_icu):
return enable_system_icu
system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 72.1", when="--with-system-icu") system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 72.1", when="--with-system-icu")
@depends(enable_system_icu_option) @depends("--with-system-icu")
def in_tree_icu(system_icu): def in_tree_icu(system_icu):
return not system_icu return not system_icu

View File

@@ -193,8 +193,6 @@ include("build/moz.configure/bootstrap.configure")
# check_prog to use bootstrap_search_path directly because check_prog # check_prog to use bootstrap_search_path directly because check_prog
# comes first, so we use a trick to allow it. Uses of check_prog # comes first, so we use a trick to allow it. Uses of check_prog
# happening before here won't allow bootstrap. # happening before here won't allow bootstrap.
@template @template
def check_prog(*args, **kwargs): def check_prog(*args, **kwargs):
kwargs["bootstrap_search_path"] = bootstrap_search_path kwargs["bootstrap_search_path"] = bootstrap_search_path
@@ -985,18 +983,12 @@ option(
nargs="?", nargs="?",
default=system_zlib_default, default=system_zlib_default,
help="{Use|Do not use} system libz", help="{Use|Do not use} system libz",
when=use_pkg_config,
) )
@depends("--with-system-zlib", when=use_pkg_config) @depends("--with-system-zlib")
def with_system_zlib_option(with_system_zlib):
return with_system_zlib
@depends(with_system_zlib_option)
def deprecated_system_zlib_path(value): def deprecated_system_zlib_path(value):
if value and len(value) == 1: if len(value) == 1:
die( die(
"--with-system-zlib=PATH is not supported anymore. Please use " "--with-system-zlib=PATH is not supported anymore. Please use "
"--with-system-zlib and set any necessary pkg-config environment variable." "--with-system-zlib and set any necessary pkg-config environment variable."
@@ -1008,7 +1000,7 @@ pkg_check_modules("MOZ_ZLIB", "zlib >= 1.2.3", when="--with-system-zlib")
set_config("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib") set_config("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib")
@depends(with_system_zlib_option, js_shared, moz_linker, target.os) @depends("--with-system-zlib", js_shared, moz_linker, target.os)
def zlib_in_mozglue(system_zlib, js_shared, linker, os): def zlib_in_mozglue(system_zlib, js_shared, linker, os):
if not system_zlib and (js_shared or linker or os == "Android"): if not system_zlib and (js_shared or linker or os == "Android"):
return True return True

View File

@@ -4,19 +4,21 @@
from __future__ import absolute_import, print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
from six import StringIO
import os import os
import sys import sys
import textwrap import textwrap
import unittest import unittest
from mozunit import main, MockedOpen
from mozbuild.configure import ConfigureError, ConfigureSandbox
from mozbuild.util import exec_
from mozbuild.shellutil import quote as shell_quote
from mozpack import path as mozpath
from buildconfig import topsrcdir from buildconfig import topsrcdir
from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path
from mozbuild.configure import ConfigureError, ConfigureSandbox
from mozbuild.shellutil import quote as shell_quote
from mozbuild.util import exec_
from mozpack import path as mozpath
from mozunit import MockedOpen, main
from six import StringIO
class TestChecksConfigure(unittest.TestCase): class TestChecksConfigure(unittest.TestCase):
@@ -732,7 +734,7 @@ class TestChecksConfigure(unittest.TestCase):
toolchain_prefix = depends(when=True)(lambda: None) toolchain_prefix = depends(when=True)(lambda: None)
target_multiarch_dir = depends(when=True)(lambda: None) target_multiarch_dir = depends(when=True)(lambda: None)
target_sysroot = depends(when=True)(lambda: %(sysroot)s) target_sysroot = depends(when=True)(lambda: %(sysroot)s)
target = depends(when=True)(lambda: namespace(os="unknown")) target = depends(when=True)(lambda: None)
include('%(topsrcdir)s/build/moz.configure/util.configure') include('%(topsrcdir)s/build/moz.configure/util.configure')
include('%(topsrcdir)s/build/moz.configure/checks.configure') include('%(topsrcdir)s/build/moz.configure/checks.configure')
# Skip bootstrapping. # Skip bootstrapping.

View File

@@ -320,20 +320,10 @@ set_config("MOZ_WASAPI", imply_wasapi, when="--enable-audio-backends")
# ALSA cubeb backend # ALSA cubeb backend
# ============================================================== # ==============================================================
option( option("--enable-alsa", env="MOZ_ALSA", help="Enable ALSA audio backend.")
"--enable-alsa",
env="MOZ_ALSA",
help="Enable ALSA audio backend.",
when=use_pkg_config,
)
@depends("--enable-alsa", when=use_pkg_config) @depends("--enable-alsa", midir_linux_support)
def enable_alsa_option(enable_alsa):
return enable_alsa
@depends(enable_alsa_option, midir_linux_support)
def enable_alsa_or_midir_linux_support(alsa_enabled, midir_linux_support): def enable_alsa_or_midir_linux_support(alsa_enabled, midir_linux_support):
return alsa_enabled or midir_linux_support return alsa_enabled or midir_linux_support
@@ -344,12 +334,7 @@ set_config("MOZ_ALSA", True, when="--enable-alsa")
# JACK cubeb backend # JACK cubeb backend
# ============================================================== # ==============================================================
system_lib_option( system_lib_option("--enable-jack", env="MOZ_JACK", help="Enable JACK audio backend.")
"--enable-jack",
env="MOZ_JACK",
help="Enable JACK audio backend.",
when=use_pkg_config,
)
jack = pkg_check_modules("MOZ_JACK", "jack", when="--enable-jack") jack = pkg_check_modules("MOZ_JACK", "jack", when="--enable-jack")
@@ -361,7 +346,6 @@ option(
"--enable-pulseaudio", "--enable-pulseaudio",
env="MOZ_PULSEAUDIO", env="MOZ_PULSEAUDIO",
help="{Enable|Disable} PulseAudio audio backend.", help="{Enable|Disable} PulseAudio audio backend.",
when=use_pkg_config,
) )
pulseaudio = pkg_check_modules("MOZ_PULSEAUDIO", "libpulse", when="--enable-pulseaudio") pulseaudio = pkg_check_modules("MOZ_PULSEAUDIO", "libpulse", when="--enable-pulseaudio")
@@ -370,12 +354,7 @@ set_config("MOZ_PULSEAUDIO", depends_if(pulseaudio)(lambda _: True))
# sndio cubeb backend # sndio cubeb backend
# ============================================================== # ==============================================================
system_lib_option( system_lib_option("--enable-sndio", env="MOZ_SNDIO", help="Enable sndio audio backend.")
"--enable-sndio",
env="MOZ_SNDIO",
help="Enable sndio audio backend.",
when=use_pkg_config,
)
sndio = pkg_check_modules("MOZ_SNDIO", "sndio", when="--enable-sndio") sndio = pkg_check_modules("MOZ_SNDIO", "sndio", when="--enable-sndio")
@@ -999,15 +978,10 @@ set_define("MOZ_TELEMETRY_ON_BY_DEFAULT", True, when=telemetry_on_by_default)
# gpsd support # gpsd support
# ============================================================== # ==============================================================
system_lib_option( system_lib_option("--enable-gpsd", env="MOZ_GPSD", help="Enable gpsd support")
"--enable-gpsd",
env="MOZ_GPSD",
help="Enable gpsd support",
when=use_pkg_config,
)
@depends("--enable-gpsd", when=use_pkg_config) @depends("--enable-gpsd")
def gpsd(value): def gpsd(value):
return bool(value) return bool(value)
@@ -1155,9 +1129,7 @@ set_config(
) )
system_lib_option( system_lib_option(
"--with-system-webp", "--with-system-webp", help="Use system libwebp (located with pkgconfig)"
help="Use system libwebp (located with pkgconfig)",
when=use_pkg_config,
) )
system_webp = pkg_check_modules( system_webp = pkg_check_modules(
@@ -1901,15 +1873,9 @@ with only_when(compile_environment):
with only_when(compile_environment): with only_when(compile_environment):
system_lib_option( system_lib_option(
"--with-system-libvpx", "--with-system-libvpx", help="Use system libvpx (located with pkgconfig)"
help="Use system libvpx (located with pkgconfig)",
when=use_pkg_config,
) )
@depends("--with-system-libvpx", when=use_pkg_config)
def with_system_libvpx_option(with_system_libvpx):
return with_system_libvpx
with only_when("--with-system-libvpx"): with only_when("--with-system-libvpx"):
vpx = pkg_check_modules("MOZ_LIBVPX", "vpx >= 1.10.0") vpx = pkg_check_modules("MOZ_LIBVPX", "vpx >= 1.10.0")
@@ -1934,7 +1900,7 @@ with only_when(compile_environment):
set_config("MOZ_SYSTEM_LIBVPX", True) set_config("MOZ_SYSTEM_LIBVPX", True)
@depends(with_system_libvpx_option, target) @depends("--with-system-libvpx", target)
def in_tree_vpx(system_libvpx, target): def in_tree_vpx(system_libvpx, target):
if system_libvpx: if system_libvpx:
return return
@@ -2145,10 +2111,9 @@ with only_when(compile_environment):
"--with-system-png", "--with-system-png",
nargs="?", nargs="?",
help="Use system libpng", help="Use system libpng",
when=use_pkg_config,
) )
@depends("--with-system-png", when=use_pkg_config) @depends("--with-system-png")
def deprecated_system_png_path(value): def deprecated_system_png_path(value):
if len(value) == 1: if len(value) == 1:
die( die(
@@ -2842,10 +2807,9 @@ with only_when(compile_environment):
"--with-system-libevent", "--with-system-libevent",
nargs="?", nargs="?",
help="Use system libevent", help="Use system libevent",
when=use_pkg_config,
) )
@depends("--with-system-libevent", when=use_pkg_config) @depends("--with-system-libevent")
def deprecated_system_libevent_path(value): def deprecated_system_libevent_path(value):
if len(value) == 1: if len(value) == 1:
die( die(
@@ -2922,13 +2886,9 @@ with only_when(toolkit_gtk):
# DBus # DBus
# ============================================================== # ==============================================================
with only_when(toolkit_gtk): with only_when(toolkit_gtk):
option("--disable-dbus", help="Disable dbus support", when=use_pkg_config) option("--disable-dbus", help="Disable dbus support")
@depends("--enable-dbus", when=use_pkg_config) with only_when("--enable-dbus"):
def enable_dbus_option(enable_dbus):
return enable_dbus
with only_when(enable_dbus_option):
pkg_check_modules("MOZ_DBUS", "dbus-1 >= 0.60") pkg_check_modules("MOZ_DBUS", "dbus-1 >= 0.60")
pkg_check_modules("MOZ_DBUS_GLIB", "dbus-glib-1 >= 0.60") pkg_check_modules("MOZ_DBUS_GLIB", "dbus-glib-1 >= 0.60")
@@ -2953,7 +2913,7 @@ set_define("NECKO_WIFI", True, when="--enable-necko-wifi")
@depends( @depends(
depends("--enable-necko-wifi", when=necko_wifi_when)(lambda x: x), depends("--enable-necko-wifi", when=necko_wifi_when)(lambda x: x),
depends(enable_dbus_option, when=toolkit_gtk)(lambda x: x), depends("--enable-dbus", when=toolkit_gtk)(lambda x: x),
when=depends(target)(lambda t: t.os == "GNU" and t.kernel == "Linux"), when=depends(target)(lambda t: t.os == "GNU" and t.kernel == "Linux"),
) )
def necko_wifi_dbus(necko_wifi, dbus): def necko_wifi_dbus(necko_wifi, dbus):
@@ -2992,11 +2952,7 @@ set_define("MOZ_LAYERS_HAVE_LOG", True, when="--enable-dump-painting")
# libproxy support # libproxy support
# ============================================================== # ==============================================================
with only_when(toolkit_gtk): with only_when(toolkit_gtk):
system_lib_option( system_lib_option("--enable-libproxy", help="Enable libproxy support")
"--enable-libproxy",
help="Enable libproxy support",
when=use_pkg_config,
)
with only_when("--enable-libproxy"): with only_when("--enable-libproxy"):
pkg_check_modules("MOZ_LIBPROXY", "libproxy-1.0") pkg_check_modules("MOZ_LIBPROXY", "libproxy-1.0")
@@ -3087,16 +3043,10 @@ set_define("ENABLE_SYSTEM_EXTENSION_DIRS", True, when="--enable-system-extension
# ============================================================== # ==============================================================
with only_when(compile_environment): with only_when(compile_environment):
system_lib_option( system_lib_option(
"--enable-system-pixman", "--enable-system-pixman", help="Use system pixman (located with pkgconfig)"
help="Use system pixman (located with pkgconfig)",
when=use_pkg_config,
) )
@depends("--enable-system-pixman", when=use_pkg_config) @depends("--enable-system-pixman")
def enable_system_pixman_option(enable_system_pixman):
return enable_system_pixman
@depends(enable_system_pixman_option)
def in_tree_pixman(pixman): def in_tree_pixman(pixman):
return not pixman return not pixman