Bug 1824671 - patch 11 - Make the JS build run cbindgen unconditionally, so that the unicode-bidi-ffi header gets generated. r=firefox-build-system-reviewers,glandium

Differential Revision: https://phabricator.services.mozilla.com/D200385
This commit is contained in:
Jonathan Kew 2024-02-06 11:41:13 +00:00
parent 213ad19af0
commit d9682f23b1
5 changed files with 30 additions and 28 deletions

View file

@ -41,18 +41,24 @@ def _run_process(args):
def generate_metadata(output, cargo_config):
stdout, returncode = _run_process(
[
buildconfig.substs["CARGO"],
"metadata",
"--frozen",
"--all-features",
"--format-version",
"1",
"--manifest-path",
CARGO_TOML,
]
)
args = [
buildconfig.substs["CARGO"],
"metadata",
"--all-features",
"--format-version",
"1",
"--manifest-path",
CARGO_TOML,
]
# The Spidermonkey library can be built from a package tarball outside the
# tree, so we want to let Cargo create lock files in this case. When built
# within a tree, the Rust dependencies have been vendored in so Cargo won't
# touch the lock file.
if not buildconfig.substs.get("JS_STANDALONE"):
args.append("--frozen")
stdout, returncode = _run_process(args)
if returncode != 0:
return returncode

View file

@ -5,17 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
@depends(build_project, "--enable-smoosh")
def cbindgen_is_needed(build_project, js_enable_smoosh):
if build_project != "js":
# cbindgen is needed by the style system build and webrender.
return True
# cbindgen is needed by SmooshMonkey.
return js_enable_smoosh
option(env="CBINDGEN", nargs=1, when=cbindgen_is_needed, help="Path to cbindgen")
option(env="CBINDGEN", nargs=1, help="Path to cbindgen")
@imports(_from="textwrap", _import="dedent")
@ -48,17 +38,14 @@ def check_cbindgen_version(cbindgen, fatal=False):
# Similar behavior to what check_prog does.
has_cbindgen_input = depends("CBINDGEN", when=cbindgen_is_needed)(lambda x: x)
bootstrap_cbindgen = depends(cbindgen_is_needed, has_cbindgen_input)(
lambda n, i: n and not i
)
has_cbindgen_input = depends("CBINDGEN")(lambda x: x)
bootstrap_cbindgen = depends(has_cbindgen_input)(lambda i: not i)
@depends_if(
"CBINDGEN",
bootstrap_search_path("cbindgen", when=bootstrap_cbindgen),
rust_search_path,
when=cbindgen_is_needed,
)
@checking("for cbindgen")
@imports(_from="textwrap", _import="dedent")

View file

@ -137,6 +137,8 @@ rsync_filter_list = """
+ /mfbt/**
+ /nsprpub/**
+ /intl/bidi/**
- /intl/icu/source/data
- /intl/icu/source/test
- /intl/icu/source/tools

View file

@ -632,6 +632,7 @@ if CONFIG["JS_HAS_CTYPES"]:
if CONFIG["JS_HAS_INTL_API"]:
DIRS += [
"../../intl/bidi",
"../../intl/components",
]

View file

@ -21,6 +21,7 @@ sm-plain-win64/debug:
spidermonkey-platform: win64
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake
@ -40,6 +41,7 @@ sm-plain-win32/debug:
run-on-projects: ['mozilla-central']
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake
@ -57,6 +59,7 @@ sm-plain-win64/opt:
spidermonkey-platform: win64
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake
@ -76,6 +79,7 @@ sm-plain-win32/opt:
run-on-projects: ['mozilla-central']
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake
@ -93,6 +97,7 @@ sm-compacting-win64/debug:
spidermonkey-platform: win64
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake
@ -112,6 +117,7 @@ sm-compacting-win32/debug:
run-on-projects: []
fetches:
toolchain:
- win64-cbindgen
- win64-clang
- win64-rust
- win64-mozmake