Skip to content

Commit

Permalink
Backed out changeset 028a7f4e4b32 (bug 1776255) for causing Linux art…
Browse files Browse the repository at this point in the history
…ifact builds bustages on central CLOSED TREE
  • Loading branch information
Cristian Tuns committed Nov 26, 2022
1 parent 6b093f9 commit 280201b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 140 deletions.
17 changes: 4 additions & 13 deletions build/moz.configure/nspr.configure
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,10 @@ def enable_nspr_build(enable):
return enable


system_lib_option(
"--with-system-nspr",
help="Use system NSPR",
when=use_pkg_config,
)


@depends("--with-system-nspr", when=use_pkg_config)
def with_system_nspr_option(with_system_nspr):
return with_system_nspr
system_lib_option("--with-system-nspr", help="Use system NSPR")


@depends(enable_nspr_build, with_system_nspr_option, js_standalone)
@depends(enable_nspr_build, "--with-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 and system_nspr:
Expand All @@ -45,7 +36,7 @@ set_config("MOZ_BUILD_NSPR", True, when=build_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):
if js_standalone:
return not build_nspr and not system_nspr
Expand Down Expand Up @@ -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):
if not system_nspr:
return ""
Expand Down
6 changes: 1 addition & 5 deletions build/moz.configure/nss.configure
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
# 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/.

system_lib_option(
"--with-system-nss",
help="Use system NSS",
when=use_pkg_config,
)
system_lib_option("--with-system-nss", help="Use system NSS")

imply_option("--with-system-nspr", True, when="--with-system-nss")

Expand Down
25 changes: 8 additions & 17 deletions build/moz.configure/pkg.configure
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ def pkg_config(prefixes):
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",
pkg_config,
bootstrap=depends(when=target_sysroot.bootstrapped)(lambda: "pkgconf"),
allow_missing=True,
when=use_pkg_config,
when=compile_environment
& depends(target.os)(lambda os: os not in ("WINNT", "OSX", "Android")),
)


Expand Down Expand Up @@ -105,12 +101,7 @@ set_config("PKG_CONFIG_LIBDIR", pkg_config_vars.PKG_CONFIG_LIBDIR)
# Returns `True` when the package description is fulfilled.
@template
def pkg_check_modules(
var,
package_desc,
when=always,
allow_missing=False,
config=True,
cflags_only=False,
var, package_desc, when=always, allow_missing=False, config=True, cflags_only=False
):
@depends(dependable(package_desc), when=when)
def package_desc(desc):
Expand All @@ -125,11 +116,11 @@ def pkg_check_modules(

allow_missing = dependable(allow_missing)

@depends(when, when=use_pkg_config)
def when_and_use_pkg_config(when):
return when
@depends(when, "--enable-compile-environment")
def when_and_compile_environment(when, compile_environment):
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):
min_version = "0.9.0"
if pkg_config is None:
Expand All @@ -149,7 +140,7 @@ def pkg_check_modules(
pkg_config_env,
package_desc,
allow_missing,
when=when_and_use_pkg_config,
when=when_and_compile_environment,
)
@imports("sys")
@imports(_from="mozbuild.configure.util", _import="LineIO")
Expand Down
6 changes: 1 addition & 5 deletions build/moz.configure/toolchain.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1034,11 +1034,7 @@ target_sysroot = sysroot(target)
def system_lib_option(name, *args, **kwargs):
option(name, *args, **kwargs)

@depends(
name,
target_sysroot.bootstrapped,
when=kwargs.get("when"),
)
@depends(name, target_sysroot.bootstrapped)
def no_system_lib_in_sysroot(value, bootstrapped):
if bootstrapped and value:
die(
Expand Down
6 changes: 2 additions & 4 deletions js/ffi.configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ def force_system_ffi(target):
imply_option("--with-system-ffi", force_system_ffi, "target")

system_lib_option(
"--with-system-ffi",
help="Use system libffi (located with pkgconfig)",
when=use_pkg_config,
"--with-system-ffi", help="Use system libffi (located with pkgconfig)"
)

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)

Expand Down
14 changes: 2 additions & 12 deletions js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1014,22 +1014,12 @@ set_define(

# ECMAScript Internationalization API Support (uses ICU)
# ======================================================
system_lib_option(
"--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_lib_option("--with-system-icu", help="Use 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):
return not system_icu

Expand Down
14 changes: 3 additions & 11 deletions moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ include("build/moz.configure/bootstrap.configure")
# 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
# happening before here won't allow bootstrap.


@template
def check_prog(*args, **kwargs):
kwargs["bootstrap_search_path"] = bootstrap_search_path
Expand Down Expand Up @@ -985,18 +983,12 @@ option(
nargs="?",
default=system_zlib_default,
help="{Use|Do not use} system libz",
when=use_pkg_config,
)


@depends("--with-system-zlib", when=use_pkg_config)
def with_system_zlib_option(with_system_zlib):
return with_system_zlib


@depends(with_system_zlib_option)
@depends("--with-system-zlib")
def deprecated_system_zlib_path(value):
if value and len(value) == 1:
if len(value) == 1:
die(
"--with-system-zlib=PATH is not supported anymore. Please use "
"--with-system-zlib and set any necessary pkg-config environment variable."
Expand All @@ -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")


@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):
if not system_zlib and (js_shared or linker or os == "Android"):
return True
Expand Down
14 changes: 8 additions & 6 deletions python/mozbuild/mozbuild/test/configure/test_checks_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@

from __future__ import absolute_import, print_function, unicode_literals

from six import StringIO
import os
import sys
import textwrap
import unittest

from buildconfig import topsrcdir
from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path
from mozunit import main, MockedOpen

from mozbuild.configure import ConfigureError, ConfigureSandbox
from mozbuild.shellutil import quote as shell_quote
from mozbuild.util import exec_
from mozbuild.shellutil import quote as shell_quote
from mozpack import path as mozpath
from mozunit import MockedOpen, main
from six import StringIO

from buildconfig import topsrcdir
from common import ConfigureTestSandbox, ensure_exe_extension, fake_short_path


class TestChecksConfigure(unittest.TestCase):
Expand Down Expand Up @@ -732,7 +734,7 @@ def get_result(cmd, args=[], bootstrapped_sysroot=False, extra_paths=None):
toolchain_prefix = depends(when=True)(lambda: None)
target_multiarch_dir = depends(when=True)(lambda: None)
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/checks.configure')
# Skip bootstrapping.
Expand Down
Loading

0 comments on commit 280201b

Please sign in to comment.