Backed out 10 changesets (bug 1751331) for causing bustages. CLOSED TREE

Backed out changeset 5ce212465a26 (bug 1751331)
Backed out changeset 14d62b8ffa5a (bug 1751331)
Backed out changeset 76f46bd9afa1 (bug 1751331)
Backed out changeset 147faaad046f (bug 1751331)
Backed out changeset f85b049d12f9 (bug 1751331)
Backed out changeset 16d8d3f8378b (bug 1751331)
Backed out changeset 1cd9386a3927 (bug 1751331)
Backed out changeset 20faacba6db6 (bug 1751331)
Backed out changeset 7d17f75bcb38 (bug 1751331)
Backed out changeset 28b9aab1f174 (bug 1751331)
This commit is contained in:
criss 2022-01-25 13:00:25 +02:00
parent 9a1036bf48
commit 592389ca2d
31 changed files with 79 additions and 156 deletions

19
Cargo.lock generated
View File

@ -1872,7 +1872,6 @@ dependencies = [
"bincode",
"bindgen",
"lazy_static",
"mozbuild",
"profiler-macros",
"serde",
]
@ -3212,9 +3211,6 @@ dependencies = [
[[package]]
name = "moz_asserts"
version = "0.1.0"
dependencies = [
"mozbuild",
]
[[package]]
name = "moz_cbor"
@ -3244,13 +3240,6 @@ dependencies = [
"moz_task",
]
[[package]]
name = "mozbuild"
version = "0.1.0"
dependencies = [
"once_cell",
]
[[package]]
name = "mozdevice"
version = "0.4.0"
@ -3271,7 +3260,6 @@ version = "0.1.0"
dependencies = [
"arrayvec 0.5.2",
"cc",
"mozbuild",
"rustc_version",
]
@ -3548,7 +3536,6 @@ dependencies = [
name = "nserror"
version = "0.1.0"
dependencies = [
"mozbuild",
"nsstring",
]
@ -4780,9 +4767,6 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "static_prefs"
version = "0.1.0"
dependencies = [
"mozbuild",
]
[[package]]
name = "storage"
@ -4834,7 +4818,6 @@ dependencies = [
"malloc_size_of",
"malloc_size_of_derive",
"matches",
"mozbuild",
"new_debug_unreachable",
"nsstring",
"num-derive",
@ -5960,7 +5943,6 @@ version = "0.1.0"
dependencies = [
"cstr",
"libc",
"mozbuild",
"nserror",
"nsstring",
"thin-vec",
@ -5982,7 +5964,6 @@ name = "xpcom_macros"
version = "0.1.0"
dependencies = [
"lazy_static",
"mozbuild",
"proc-macro2",
"quote",
"syn",

View File

@ -86,9 +86,6 @@ opt-level = 2
cmake = { path = "build/rust/cmake" }
vcpkg = { path = "build/rust/vcpkg" }
# Helper crate for integration in the gecko build system.
mozbuild = { path = "build/rust/mozbuild" }
# Patch autocfg to hide rustc output. Workaround for https://github.com/cuviper/autocfg/issues/30
autocfg = { path = "third_party/rust/autocfg" }

View File

@ -21,9 +21,6 @@ else:
if CONFIG["MOZ_STDCXX_COMPAT"]:
DIRS += ["unix/stdc++compat"]
if CONFIG["RUSTC"]:
DIRS += ["rust/mozbuild"]
CRAMTEST_MANIFESTS += [
"tests/cram/cram.ini",
]

View File

@ -1,11 +0,0 @@
[package]
name = "mozbuild"
version = "0.1.0"
edition = "2018"
license = "MPL-2.0"
[lib]
path = "lib.rs"
[dependencies]
once_cell = "1"

View File

@ -1,20 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
use std::path::PathBuf;
fn main() {
let out_dir = PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
if let Some(topobjdir) = out_dir
.ancestors()
.find(|dir| dir.join("config.status").exists())
{
println!(
"cargo:rustc-env=BUILDCONFIG_RS={}",
topobjdir
.join("build/rust/mozbuild/buildconfig.rs")
.display()
);
}
}

View File

@ -1,20 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
import buildconfig
def generate_bool(name):
value = buildconfig.substs.get(name)
return f"pub const {name}: bool = {'true' if value else 'false'};\n"
def generate(output):
output.write(generate_bool("MOZ_FOLD_LIBS"))
output.write(generate_bool("NIGHTLY_BUILD"))
output.write(generate_bool("RELEASE_OR_BETA"))
output.write(generate_bool("EARLY_BETA_OR_EARLIER"))
output.write(generate_bool("MOZ_DEV_EDITION"))
output.write(generate_bool("MOZ_ESR"))
output.write(generate_bool("MOZ_DIAGNOSTIC_ASSERT_ENABLED"))

View File

@ -1,41 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
use once_cell::sync::Lazy;
use std::env;
use std::path::PathBuf;
pub static TOPOBJDIR: Lazy<PathBuf> = Lazy::new(|| {
let path = PathBuf::from(
env::var_os("MOZ_TOPOBJDIR").expect("MOZ_TOPOBJDIR must be set in the environment"),
);
assert!(
path.is_absolute() && path.is_dir(),
"MOZ_TOPOBJDIR must be an absolute directory, was: {}",
path.display()
);
path
});
#[macro_export]
macro_rules! objdir_path {
($path:literal) => {
concat!(env!("MOZ_TOPOBJDIR"), "/", $path)
};
}
pub static TOPSRCDIR: Lazy<PathBuf> = Lazy::new(|| {
let path =
PathBuf::from(env::var_os("MOZ_SRC").expect("MOZ_SRC must be set in the environment"));
assert!(
path.is_absolute() && path.is_dir(),
"MOZ_SRC must be an absolute directory, was: {}",
path.display()
);
path
});
pub mod config {
include!(env!("BUILDCONFIG_RS"));
}

View File

@ -1,9 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# 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/.
GeneratedFile(
"buildconfig.rs", script="generate_buildconfig.py", entry_point="generate"
)

View File

@ -214,6 +214,7 @@ export RUSTC
export RUSTDOC
export RUSTFMT
export MOZ_SRC=$(topsrcdir)
export MOZ_DIST=$(ABS_DIST)
export LIBCLANG_PATH=$(MOZ_LIBCLANG_PATH)
export CLANG_PATH=$(MOZ_CLANG_PATH)
export PKG_CONFIG

View File

@ -110,7 +110,10 @@ fn translate_shader(shader_key: &str, shader_dir: &str) {
}
fn main() {
let shader_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap() + "/../webrender/res";
let shader_dir = match std::env::var("MOZ_SRC") {
Ok(dir) => dir + "/gfx/wr/webrender/res",
Err(_) => std::env::var("CARGO_MANIFEST_DIR").unwrap() + "/../webrender/res",
};
let shader_flags =
ShaderFeatureFlags::GL |

View File

@ -7,4 +7,3 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
mozbuild = "0.1"

View File

@ -8,4 +8,7 @@
//! `modules/libpref/init/generate_static_pref_list.py`, from
//! `modules/libpref/init/StaticPrefList.yaml`.
include!(mozbuild::objdir_path!("modules/libpref/static_prefs.rs"));
include!(concat!(
env!("MOZ_TOPOBJDIR"),
"/modules/libpref/static_prefs.rs"
));

View File

@ -11,7 +11,6 @@ path = "lib.rs"
arrayvec = "0.5"
[build-dependencies]
mozbuild = "0.1"
cc = "1"
rustc_version = "0.2"

View File

@ -3,13 +3,35 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use rustc_version::{version, Version};
use std::env;
use std::path::PathBuf;
fn main() {
let dist_path = {
let path = PathBuf::from(env::var_os("MOZ_DIST").unwrap());
if !path.is_absolute() || !path.is_dir() {
panic!(
"MOZ_DIST must be an absolute directory, was: {}",
path.display()
);
}
path
};
let topobjdir = {
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap());
if !path.is_absolute() || !path.is_dir() {
panic!(
"MOZ_TOPOBJDIR must be an absolute directory, was: {}",
path.display()
);
}
path
};
let mut build = cc::Build::new();
build.cpp(true);
// For js-confdefs.h, see wrappers.cpp.
build.include(mozbuild::TOPOBJDIR.join("js").join("src"));
build.include(mozbuild::TOPOBJDIR.join("dist").join("include"));
build.include(topobjdir.join("js").join("src"));
build.include(dist_path.join("include"));
build.define("MOZ_HAS_MOZGLUE", None);
build.file("wrappers.cpp");
build.compile("wrappers");

View File

@ -7,5 +7,6 @@ license = "MPL-2.0"
[lib]
path = "lib.rs"
[dependencies]
mozbuild = "0.1"
[features]
nightly = []
diagnostic = []

View File

@ -19,10 +19,10 @@
// is also how rust's `debug_assert!` is implemented)
/// Whether Nightly-only assertions are enabled.
pub use mozbuild::config::NIGHTLY_BUILD;
pub const NIGHTLY_BUILD: bool = cfg!(feature = "nightly");
/// Whether diagnostic assertions are enabled.
pub use mozbuild::config::MOZ_DIAGNOSTIC_ASSERT_ENABLED;
pub const MOZ_DIAGNOSTIC_ASSERT_ENABLED: bool = cfg!(feature = "diagnostic");
/// assert! on Nightly, gets compiled out otherwise.
#[macro_export]

View File

@ -594,7 +594,9 @@ class CommonBackend(BuildBackend):
"""Write out a rust file which includes the generated xpcom rust modules"""
topobjdir = self.environment.topobjdir
include_tmpl = 'include!(mozbuild::objdir_path!("dist/xpcrs/%s/%s.rs"))'
include_tmpl = (
'include!(concat!(env!("MOZ_TOPOBJDIR"), "/dist/xpcrs/%s/%s.rs"))'
)
# Ensure deterministic output files.
stems = sorted(manager.idl_stems())

View File

@ -17,7 +17,7 @@ path = "lib.rs"
doctest = false
[features]
gecko = ["nsstring", "serde", "style_traits/gecko", "bindgen", "regex", "toml", "mozbuild"]
gecko = ["nsstring", "serde", "style_traits/gecko", "bindgen", "regex", "toml"]
servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5ever",
"cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union",
"servo_url", "string_cache", "to_shmem/servo", "servo_arc/servo"]
@ -84,4 +84,3 @@ bindgen = {version = "0.56", optional = true, default-features = false}
regex = {version = "1.0", optional = true, default-features = false, features = ["perf", "std"]}
walkdir = "2.1.4"
toml = {version = "0.4.5", optional = true, default-features = false}
mozbuild = {version = "0.1", optional = true}

View File

@ -42,12 +42,14 @@ fn read_config(path: &PathBuf) -> Table {
lazy_static! {
static ref CONFIG: Table = {
// Load Gecko's binding generator config from the source tree.
let path = mozbuild::TOPSRCDIR.join("layout/style/ServoBindings.toml");
let path = PathBuf::from(env::var_os("MOZ_SRC").unwrap())
.join("layout/style/ServoBindings.toml");
read_config(&path)
};
static ref BINDGEN_FLAGS: Vec<String> = {
// Load build-specific config overrides.
let path = mozbuild::TOPOBJDIR.join("layout/style/extra-bindgen-flags");
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap())
.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()
@ -55,7 +57,13 @@ lazy_static! {
.collect()
};
static ref INCLUDE_RE: Regex = Regex::new(r#"#include\s*"(.+?)""#).unwrap();
static ref DISTDIR_PATH: PathBuf = mozbuild::TOPOBJDIR.join("dist");
static ref DISTDIR_PATH: PathBuf = {
let path = PathBuf::from(env::var_os("MOZ_DIST").unwrap());
if !path.is_absolute() || !path.is_dir() {
panic!("MOZ_DIST must be an absolute directory, was: {}", path.display());
}
path
};
static ref SEARCH_PATHS: Vec<PathBuf> = vec![
DISTDIR_PATH.join("include"),
DISTDIR_PATH.join("include/nspr"),

View File

@ -6,6 +6,12 @@
gkrust_features = []
if CONFIG['NIGHTLY_BUILD']:
gkrust_features += ['gkrust-shared/moz_asserts_nightly']
if CONFIG['MOZ_DIAGNOSTIC_ASSERT_ENABLED']:
gkrust_features += ['gkrust-shared/moz_asserts_diagnostic']
if CONFIG['MOZ_DEBUG']:
gkrust_features += [
'gecko_debug',

View File

@ -81,6 +81,8 @@ webext_storage_bridge = { path = "../../../components/extensions/storage/webext_
[features]
default = []
moz_asserts_nightly = ["moz_asserts/nightly"]
moz_asserts_diagnostic = ["moz_asserts/diagnostic"]
cubeb-remoting = ["cubeb-sys", "audioipc-client", "audioipc-server", "audioipc2-client", "audioipc2-server"]
cubeb_coreaudio_rust = ["cubeb-sys", "cubeb-coreaudio"]
cubeb_pulse_rust = ["cubeb-sys", "cubeb-pulse"]

View File

@ -9,12 +9,10 @@ profiler-macros = { path = "./macros" }
lazy_static = "1"
serde = { version = "1.0", features = ["derive"] }
bincode = "1"
mozbuild = "0.1"
[build-dependencies]
lazy_static = "1"
bindgen = {version = "0.56", default-features = false}
mozbuild = "0.1"
[features]
# This feature is being set by Gecko. If it's not set, all public functions and

View File

@ -24,16 +24,24 @@ 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");
let path = PathBuf::from(env::var_os("MOZ_TOPOBJDIR").unwrap())
.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)
.collect()
};
static ref DISTDIR_PATH: PathBuf = {
let path = PathBuf::from(env::var_os("MOZ_DIST").unwrap());
if !path.is_absolute() || !path.is_dir() {
panic!("MOZ_DIST must be an absolute directory, was: {}", path.display());
}
path
};
static ref SEARCH_PATHS: Vec<PathBuf> = vec![
mozbuild::TOPOBJDIR.join("dist/include"),
mozbuild::TOPOBJDIR.join("dist/include/nspr"),
DISTDIR_PATH.join("include"),
DISTDIR_PATH.join("include/nspr"),
];
}

View File

@ -8,8 +8,9 @@
//! `mozglue/baseprofiler/generate_profiling_categories.py`, from
//! 'mozglue/baseprofiler/core/profiling_categories.yaml`.
include!(mozbuild::objdir_path!(
"tools/profiler/rust-api/src/gecko_bindings/profiling_categories.rs"
include!(concat!(
env!("MOZ_TOPOBJDIR"),
"/tools/profiler/rust-api/src/gecko_bindings/profiling_categories.rs"
));
/// Helper macro that returns the profiling category pair from either only

View File

@ -8,4 +8,3 @@ edition = "2018"
[dependencies]
nsstring = { path = "../nsstring" }
mozbuild = "0.1"

View File

@ -73,7 +73,7 @@ extern "C" {
}
mod error_list {
include!(mozbuild::objdir_path!("xpcom/base/error_list.rs"));
include!(concat!(env!("MOZ_TOPOBJDIR"), "/xpcom/base/error_list.rs"));
}
pub use error_list::*;

View File

@ -12,7 +12,6 @@ nserror = { path = "../nserror" }
threadbound = "0.1"
xpcom_macros = { path = "xpcom_macros" }
thin-vec = { version = "0.2.1", features = ["gecko-ffi"] }
mozbuild = "0.1"
[features]
thread_sanitizer = []

View File

@ -9,4 +9,4 @@ use crate::*;
// NOTE: This file contains a series of `include!()` invocations, defining all
// idl interfaces directly within this module.
include!(mozbuild::objdir_path!("dist/xpcrs/rt/all.rs"));
include!(concat!(env!("MOZ_TOPOBJDIR"), "/dist/xpcrs/rt/all.rs"));

View File

@ -6,4 +6,4 @@
//!
//! The contents of this file are generated from `xpcom/build/Services.py`.
include!(mozbuild::objdir_path!("xpcom/build/services.rs"));
include!(concat!(env!("MOZ_TOPOBJDIR"), "/xpcom/build/services.rs"));

View File

@ -12,4 +12,3 @@ syn = "1"
quote = "1"
proc-macro2 = "1"
lazy_static = "1.0"
mozbuild = "0.1"

View File

@ -216,7 +216,7 @@ lazy_static! {
/// the form of a `HashMap` from interface names to their descriptions.
static ref IFACES: HashMap<&'static str, &'static Interface> = {
let lists: &[&[Interface]] =
include!(mozbuild::objdir_path!("dist/xpcrs/bt/all.rs"));
include!(concat!(env!("MOZ_TOPOBJDIR"), "/dist/xpcrs/bt/all.rs"));
let mut hm = HashMap::new();
for &list in lists {