Bug 1694884 - Fail configure when using --*-system-* options with a bootstrapped sysroot. r=firefox-build-system-reviewers,mhentges

The bootstrapped sysroot doesn't contain all the system libraries that
would allow these options to be supported.

Differential Revision: https://phabricator.services.mozilla.com/D120043
This commit is contained in:
Mike Hommey 2021-07-16 20:51:27 +00:00
Родитель 28088b069e
Коммит 9aa3587bbf
7 изменённых файлов: 49 добавлений и 11 удалений

Просмотреть файл

@ -19,7 +19,7 @@ def enable_nspr_build(enable):
return enable
option("--with-system-nspr", help="Use system NSPR")
system_lib_option("--with-system-nspr", help="Use system NSPR")
@depends(enable_nspr_build, "--with-system-nspr", js_standalone)

Просмотреть файл

@ -4,7 +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/.
option("--with-system-nss", help="Use system NSS")
system_lib_option("--with-system-nss", help="Use system NSS")
imply_option("--with-system-nspr", True, when="--with-system-nss")

Просмотреть файл

@ -73,7 +73,16 @@ def prepare_configure(mozconfig, old_configure_assignments):
@template
def old_configure_options(*options):
for opt in options:
option(opt, nargs="*", help="Help missing for old configure options")
if opt in (
"--enable-system-cairo",
"--enable-system-png",
"--with-system-libevent",
"--with-system-png",
):
cb = system_lib_option
else:
cb = option
cb(opt, nargs="*", help="Help missing for old configure options")
@dependable
def all_options():

Просмотреть файл

@ -960,22 +960,45 @@ def sysroot_path(host_or_target):
"MOZ_AUTOMATION",
)
def sysroot_path(sysroot_input, path, bootstrap, automation):
bootstrapped = False
if sysroot_input:
path = sysroot_input[0]
elif sysroot_input is not None and sysroot_input.origin != "default":
return
if sysroot_input or (bootstrap and bootstrap.origin != "default") or automation:
elif (bootstrap and bootstrap.origin != "default") or automation:
bootstrapped = True
if sysroot_input or bootstrapped:
if path:
log.info("Using %s sysroot in %s", host_or_target_str, path)
return path
return namespace(path=path, bootstrapped=bootstrapped)
return sysroot_path
host_sysroot_path = sysroot_path(host)
target_sysroot_path = sysroot_path(target)
# Use `system_lib_option` instead of `option` for options that enable building
# with a system library for which the development headers are not available in
# the bootstrapped sysroots.
@template
def system_lib_option(name, *args, **kwargs):
option(name, *args, **kwargs)
@depends(name, target_sysroot_path.bootstrapped)
def no_system_lib_in_sysroot(value, bootstrapped):
if bootstrapped and value:
die(
"%s is not supported with bootstrapped sysroot. "
"Drop the option, or use --without-sysroot or --disable-bootstrap",
value.format(name),
)
host_sysroot_path = sysroot_path(host).path
target_sysroot_path = target_sysroot_path.path
@template
def sysroot_flags(host_or_target):
sysroot_path = {

Просмотреть файл

@ -14,7 +14,9 @@ def force_system_ffi(target):
imply_option("--with-system-ffi", force_system_ffi, "target")
option("--with-system-ffi", help="Use system libffi (located with pkgconfig)")
system_lib_option(
"--with-system-ffi", help="Use system libffi (located with pkgconfig)"
)
use_system_ffi = depends_if("--with-system-ffi")(lambda _: True)

Просмотреть файл

@ -957,7 +957,7 @@ set_define(
# ECMAScript Internationalization API Support (uses ICU)
# ======================================================
option("--with-system-icu", help="Use system ICU")
system_lib_option("--with-system-icu", help="Use system ICU")
system_icu = pkg_check_modules("MOZ_ICU", "icu-i18n >= 69.1", when="--with-system-icu")

Просмотреть файл

@ -985,7 +985,9 @@ def skia_includes(skia):
set_config("SKIA_INCLUDES", skia_includes)
option("--with-system-webp", help="Use system libwebp (located with pkgconfig)")
system_lib_option(
"--with-system-webp", help="Use system libwebp (located with pkgconfig)"
)
system_webp = pkg_check_modules(
"MOZ_WEBP", "libwebp >= 1.0.2 libwebpdemux >= 1.0.2", when="--with-system-webp"
@ -1640,7 +1642,9 @@ with only_when(compile_environment):
# ===
with only_when(compile_environment):
option("--with-system-libvpx", help="Use system libvpx (located with pkgconfig)")
system_lib_option(
"--with-system-libvpx", help="Use system libvpx (located with pkgconfig)"
)
with only_when("--with-system-libvpx"):
vpx = pkg_check_modules("MOZ_LIBVPX", "vpx >= 1.8.0")
@ -1722,7 +1726,7 @@ with only_when(compile_environment):
# ====
with only_when(compile_environment):
option(
system_lib_option(
"--with-system-jpeg",
nargs="?",
help="Use system libjpeg (installed at given prefix)",