Skip to content

Commit

Permalink
Bug 1950258 - Use mozbuild::config items instead of reading extra-bin…
Browse files Browse the repository at this point in the history
…dgen-flags files. r=firefox-build-system-reviewers,sergesanspaille

We add NSS_CFLAGS in preparation of equivalent changes to crates that
are vendored in third-party/rust that use netwerk/socket/neqo/extra-bindgen-flags
(that we thus keep around for now).

Differential Revision: https://phabricator.services.mozilla.com/D239831
  • Loading branch information
glandium committed Feb 27, 2025
1 parent 147d653 commit d6e1111
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 24 deletions.
4 changes: 4 additions & 0 deletions build/rust/mozbuild/generate_buildconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,7 @@ def generate(output):
output.write(generate_string_array("BINDGEN_SYSTEM_FLAGS"))
output.write(generate_string_array("MOZ_GTK3_CFLAGS"))
output.write(generate_string_array("MOZ_GTK3_LIBS"))
output.write(generate_string_array("NSPR_CFLAGS"))
output.write(generate_string_array("NSS_CFLAGS"))
output.write(generate_string_array("MOZ_PIXMAN_CFLAGS"))
output.write(generate_string_array("MOZ_ICU_CFLAGS"))
2 changes: 1 addition & 1 deletion js/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ def in_tree_icu(system_icu):


# Set MOZ_ICU_CFLAGS to an explicit empty value when --with-system-icu is *not* used,
# for layout/style/extra-bindgen-flags
# for use for bindgen through the mozbuild crate.
set_config("MOZ_ICU_CFLAGS", [], when=in_tree_icu)

set_config("MOZ_SYSTEM_ICU", True, when=system_icu)
Expand Down
1 change: 0 additions & 1 deletion layout/style/extra-bindgen-flags.in

This file was deleted.

4 changes: 0 additions & 4 deletions layout/style/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,3 @@ if CONFIG["COMPILE_ENVIRONMENT"]:
"ServoStyleConsts.h",
inputs=["/servo/ports/geckolib", "/servo/components/style"],
)

CONFIGURE_SUBST_FILES += [
"extra-bindgen-flags",
]
12 changes: 6 additions & 6 deletions servo/components/style/build_gecko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ lazy_static! {
read_config(&path)
};
static ref BINDGEN_FLAGS: Vec<String> = {
// Load build-specific config overrides.
let path = mozbuild::TOPOBJDIR.join("layout/style/extra-bindgen-flags");
println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
fs::read_to_string(path).expect("Failed to read extra-bindgen-flags file")
.split_whitespace()
.map(std::borrow::ToOwned::to_owned)
mozbuild::config::BINDGEN_SYSTEM_FLAGS
.iter()
.chain(&mozbuild::config::NSPR_CFLAGS)
.chain(&mozbuild::config::MOZ_PIXMAN_CFLAGS)
.chain(&mozbuild::config::MOZ_ICU_CFLAGS)
.map(|s| s.to_string())
.collect()
};
static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap();
Expand Down
5 changes: 0 additions & 5 deletions tools/profiler/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,6 @@ GeneratedFile(
inputs=["../../mozglue/baseprofiler/build/profiling_categories.yaml"],
)

CONFIGURE_SUBST_FILES += [
"rust-api/extra-bindgen-flags",
]


if CONFIG["COMPILE_ENVIRONMENT"]:
CbindgenHeader("profiler_ffi_generated.h", inputs=["rust-api"])

Expand Down
10 changes: 4 additions & 6 deletions tools/profiler/rust-api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ const BINDINGS_FILE: &str = "bindings.rs";

lazy_static! {
static ref BINDGEN_FLAGS: Vec<String> = {
// Load build-specific config overrides.
let path = mozbuild::TOPOBJDIR.join("tools/profiler/rust-api/extra-bindgen-flags");
println!("cargo:rerun-if-changed={}", path.to_str().unwrap());
fs::read_to_string(path).expect("Failed to read extra-bindgen-flags file")
.split_whitespace()
.map(std::borrow::ToOwned::to_owned)
mozbuild::config::BINDGEN_SYSTEM_FLAGS
.iter()
.chain(&mozbuild::config::NSPR_CFLAGS)
.map(|s| s.to_string())
.collect()
};
static ref SEARCH_PATHS: Vec<PathBuf> = vec![
Expand Down
1 change: 0 additions & 1 deletion tools/profiler/rust-api/extra-bindgen-flags.in

This file was deleted.

0 comments on commit d6e1111

Please sign in to comment.