script: Feature-gate all crown support. (#35055)

* script: Feature-gate all crown support.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use cfg(crown) instead of a cargo feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-18 16:36:15 -05:00 committed by GitHub
parent 1bd34a5781
commit 875e387004
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
223 changed files with 442 additions and 417 deletions

View file

@ -797,6 +797,8 @@ class CommandBase(object):
if command == 'rustc':
args += ["--lib", "--crate-type=cdylib"]
features = []
if use_crown:
if 'CARGO_BUILD_RUSTC' in env:
current_rustc = env['CARGO_BUILD_RUSTC']
@ -805,6 +807,7 @@ class CommandBase(object):
f'already set to `{current_rustc}` in the parent environment.\n'
'These options conflict, please specify only one of them.')
sys.exit(1)
features += ["crown"]
env['CARGO_BUILD_RUSTC'] = 'crown'
# Changing `RUSTC` or `CARGO_BUILD_RUSTC` does not cause `cargo check` to
# recheck files with the new compiler. `cargo build` is not affected and
@ -814,7 +817,7 @@ class CommandBase(object):
env['RUSTFLAGS'] = env.get('RUSTFLAGS', "") + " --cfg=crown"
if "-p" not in cargo_args: # We're building specific package, that may not have features
features = list(self.features)
features += list(self.features)
if self.enable_media:
features.append("media-gstreamer")
if self.config["build"]["debug-mozjs"] or debug_mozjs: