Skip to content

Commit

Permalink
Auto merge of #277 - sagudev:master, r=jdm
Browse files Browse the repository at this point in the history
Update to SpiderMonkey 88

In line with Firefox again 🎉

Note to self: Now forks are having trouble running CI builds if doing work on master. We should do something like that do not trigger builds on master from @bors-servo
something like:
`if: "!contains(github.event.head_commit.message, 'Auto merge') && !contains(github.event.head_commit.author, 'Bors Servo')"`
  • Loading branch information
bors-servo authored Apr 15, 2021
2 parents c7d4e98 + 51b616a commit d68e072
Show file tree
Hide file tree
Showing 886 changed files with 32,297 additions and 20,248 deletions.
70 changes: 41 additions & 29 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ extern crate cc;
extern crate walkdir;

use std::env;
use std::path::{Path, PathBuf};
use std::ffi::{OsStr, OsString};
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str;
use walkdir::WalkDir;
Expand Down Expand Up @@ -89,17 +89,10 @@ fn find_make() -> OsString {
}

fn cc_flags() -> Vec<&'static str> {
let mut result = vec![
"-DRUST_BINDGEN",
"-DSTATIC_JS_API",
];
let mut result = vec!["-DRUST_BINDGEN", "-DSTATIC_JS_API"];

if env::var_os("CARGO_FEATURE_DEBUGMOZJS").is_some() {
result.extend(&[
"-DJS_GC_ZEAL",
"-DDEBUG",
"-DJS_DEBUG",
]);
result.extend(&["-DJS_GC_ZEAL", "-DDEBUG", "-DJS_DEBUG"]);
}

let target = env::var("TARGET").unwrap();
Expand Down Expand Up @@ -151,7 +144,9 @@ fn build_jsapi(build_dir: &Path) {

let encoding_c_mem_include_dir = env::var("DEP_ENCODING_C_MEM_INCLUDE_DIR").unwrap();
let mut cppflags = OsString::from("-I");
cppflags.push(OsString::from(encoding_c_mem_include_dir.replace("\\", "/")));
cppflags.push(OsString::from(
encoding_c_mem_include_dir.replace("\\", "/"),
));
cppflags.push(" ");
cppflags.push(env::var_os("CPPFLAGS").unwrap_or_default());
cmd.env("CPPFLAGS", cppflags);
Expand All @@ -176,10 +171,16 @@ fn build_jsapi(build_dir: &Path) {
.expect("Failed to run `make`");
assert!(result.success());

println!("cargo:rustc-link-search=native={}/js/src/build", build_dir.display());
println!(
"cargo:rustc-link-search=native={}/js/src/build",
build_dir.display()
);
println!("cargo:rustc-link-lib=static=js_static"); // Must come before c++
if target.contains("windows") {
println!("cargo:rustc-link-search=native={}/dist/bin", build_dir.display());
println!(
"cargo:rustc-link-search=native={}/dist/bin",
build_dir.display()
);
println!("cargo:rustc-link-lib=winmm");
println!("cargo:rustc-link-lib=psapi");
println!("cargo:rustc-link-lib=user32");
Expand All @@ -197,7 +198,6 @@ fn build_jsapi(build_dir: &Path) {
}
}


fn build_jsglue(build_dir: &Path) {
let mut build = cc::Build::new();
build.cpp(true);
Expand Down Expand Up @@ -250,9 +250,12 @@ fn build_jsapi_bindings(build_dir: &Path) {
.with_codegen_config(config)
.rustfmt_bindings(true)
.rustfmt_configuration_file(rustfmt_config)
.clang_arg("-I").clang_arg(build_dir.join("dist/include").to_str().expect("UTF-8"))
.clang_arg("-I").clang_arg(build_dir.join("js/src").to_str().expect("UTF-8"))
.clang_arg("-x").clang_arg("c++");
.clang_arg("-I")
.clang_arg(build_dir.join("dist/include").to_str().expect("UTF-8"))
.clang_arg("-I")
.clang_arg(build_dir.join("js/src").to_str().expect("UTF-8"))
.clang_arg("-x")
.clang_arg("c++");

let target = env::var("TARGET").unwrap();
if target.contains("windows") {
Expand All @@ -276,9 +279,18 @@ fn build_jsapi_bindings(build_dir: &Path) {
}

builder = builder.clang_arg("-include");
builder = builder.clang_arg(build_dir.join("js/src/js-confdefs.h").to_str().expect("UTF-8"));

println!("Generting bindings {:?} {}.", builder.command_line_flags(), bindgen::clang_version().full);
builder = builder.clang_arg(
build_dir
.join("js/src/js-confdefs.h")
.to_str()
.expect("UTF-8"),
);

println!(
"Generting bindings {:?} {}.",
builder.command_line_flags(),
bindgen::clang_version().full
);

for ty in UNSAFE_IMPL_SYNC_TYPES {
builder = builder.raw_line(format!("unsafe impl Sync for root::{} {{}}", ty));
Expand Down Expand Up @@ -308,10 +320,12 @@ fn build_jsapi_bindings(build_dir: &Path) {
builder = builder.module_raw_line(module, raw_line);
}

let bindings = builder.generate()
let bindings = builder
.generate()
.expect("Should generate JSAPI bindings OK");

bindings.write_to_file(build_dir.join("jsapi.rs"))
bindings
.write_to_file(build_dir.join("jsapi.rs"))
.expect("Should write bindings to file OK");
}

Expand All @@ -326,11 +340,7 @@ const UNSAFE_IMPL_SYNC_TYPES: &'static [&'static str] = &[

/// Types which we want to generate bindings for (and every other type they
/// transitively use).
const WHITELIST_TYPES: &'static [&'static str] = &[
"JS.*",
"js::.*",
"mozilla::.*",
];
const WHITELIST_TYPES: &'static [&'static str] = &["JS.*", "js::.*", "mozilla::.*"];

/// Global variables we want to generate bindings to.
const WHITELIST_VARS: &'static [&'static str] = &[
Expand All @@ -348,7 +358,7 @@ const WHITELIST_VARS: &'static [&'static str] = &[

/// Functions we want to generate bindings to.
const WHITELIST_FUNCTIONS: &'static [&'static str] = &[
"ExceptionStackOrNull",
"ExceptionStackOrNull",
"glue::.*",
"JS::.*",
"js::.*",
Expand Down Expand Up @@ -416,6 +426,8 @@ fn ignore(path: &Path) -> bool {
let ignored_extensions = ["pyc", "o", "so", "dll", "dylib"];

path.extension().map_or(false, |extension| {
ignored_extensions.iter().any(|&ignored| extension == ignored)
ignored_extensions
.iter()
.any(|&ignored| extension == ignored)
})
}
37 changes: 0 additions & 37 deletions etc/patches/0021-darwin-static-timestamp.patch

This file was deleted.

2 changes: 0 additions & 2 deletions etc/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ def extract_tarball(tarball):

def apply_patches():
print("Applying patches.")

patch_dir = os.path.abspath(os.path.join("etc", "patches"))
patches = sorted(
os.path.join(patch_dir, p)
for p in os.listdir(patch_dir)
if p.endswith(".patch")
)

for p in patches:
print(" Applying patch: %s." % p)
subprocess.check_call(["git", "apply", "--reject", "--directory=" + TARGET, p], stdout=subprocess.DEVNULL)
Expand Down
34 changes: 17 additions & 17 deletions mozjs/.cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
# It was generated by `mach vendor rust`.
# Please do not edit.

[source."https://github.com/zakarumych/gpu-descriptor"]
git = "https://github.com/zakarumych/gpu-descriptor"
replace-with = "vendored-sources"
rev = "831460c4b5120d9a74744d542f39a95b9816b5ab"

[source."https://github.com/zakarumych/gpu-alloc"]
git = "https://github.com/zakarumych/gpu-alloc"
replace-with = "vendored-sources"
rev = "d07be73f9439a37c89f5b72f2500cbf0eb4ff613"

[source."https://github.com/shravanrn/nix/"]
git = "https://github.com/shravanrn/nix/"
replace-with = "vendored-sources"
Expand All @@ -20,17 +10,17 @@ rev = "4af6c367603869a30fddb5ffb0aba2b9477ba92e"
[source."https://github.com/msirringhaus/minidump_writer_linux.git"]
git = "https://github.com/msirringhaus/minidump_writer_linux.git"
replace-with = "vendored-sources"
rev = "9191af36343846b2c7ada65b9602b481b717c4d8"
rev = "01c7a0da8d34059f7dae8ab9e7512529ff16347a"

[source."https://github.com/mozilla/neqo"]
git = "https://github.com/mozilla/neqo"
replace-with = "vendored-sources"
tag = "v0.4.21"
tag = "v0.4.23"

[source."https://github.com/mozilla/mp4parse-rust"]
git = "https://github.com/mozilla/mp4parse-rust"
replace-with = "vendored-sources"
rev = "3011a2b923c8b0f1b392bcdd008cd8b95ffd846b"
rev = "94c3b1f368c82aefcbf51967f6aa296a9ccceb69"

[source."https://github.com/mozilla/cubeb-pulse-rs"]
git = "https://github.com/mozilla/cubeb-pulse-rs"
Expand All @@ -40,7 +30,7 @@ rev = "c87b50aebfa088c1ad30c74819d4e9829f88b2e3"
[source."https://github.com/mozilla/cubeb-coreaudio-rs"]
git = "https://github.com/mozilla/cubeb-coreaudio-rs"
replace-with = "vendored-sources"
rev = "3d071d733d13bde0af033e7973e53938b2ab53e6"
rev = "ad56ea14ac915f1e7ecbcf6ac38182443b0dd29e"

[source."https://github.com/mozilla/audioipc-2"]
git = "https://github.com/mozilla/audioipc-2"
Expand Down Expand Up @@ -73,7 +63,7 @@ replace-with = "vendored-sources"
rev = "d5d8c00ebd3281d12e0be5dfddbb69f791f836f1"

[source."https://github.com/kvark/spirv_cross"]
branch = "wgpu4"
branch = "wgpu5"
git = "https://github.com/kvark/spirv_cross"
replace-with = "vendored-sources"

Expand Down Expand Up @@ -105,12 +95,22 @@ rev = "fd4ed671ef495af4dcda4c4cba3ef8d426db8af1"
[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
replace-with = "vendored-sources"
rev = "96c80738650822de35f77ab6a589f309460c8f39"
tag = "gfx-12"

[source."https://github.com/gfx-rs/metal-rs"]
git = "https://github.com/gfx-rs/metal-rs"
replace-with = "vendored-sources"
rev = "439c986eb7a9b91e88b61def2daa66e4043fcbef"

[source."https://github.com/gfx-rs/gfx"]
git = "https://github.com/gfx-rs/gfx"
replace-with = "vendored-sources"
rev = "1d14789011cb892f4c1a205d3f8a87d479c2e354"
rev = "0a201d1c406b5119ec11068293a40e50ec0be4c8"

[source."https://github.com/gfx-rs/d3d12-rs"]
git = "https://github.com/gfx-rs/d3d12-rs"
replace-with = "vendored-sources"
rev = "be19a243b86e0bafb9937d661fc8eabb3e42b44e"

[source."https://github.com/badboy/failure"]
git = "https://github.com/badboy/failure"
Expand Down
3 changes: 1 addition & 2 deletions mozjs/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ browser/extensions/formautofill/phonenumberutils/PhoneNumberMetaData.jsm
# See https://github.com/firefox-devtools/debugger/blob/master/package.json#L24
devtools/client/debugger/configs/
devtools/client/debugger/dist/
devtools/client/debugger/flow-typed/
devtools/client/debugger/images/
devtools/client/debugger/test/
devtools/client/debugger/index.html
Expand Down Expand Up @@ -159,7 +158,7 @@ python/

# These are (mainly) imported code that we don't want to lint to make imports easier.
remote/cdp/Protocol.jsm
remote/test/browser/chrome-remote-interface.js
remote/cdp/test/browser/chrome-remote-interface.js

# services/ exclusions

Expand Down
15 changes: 2 additions & 13 deletions mozjs/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ module.exports = {
"dom/security/test/general/**",
"dom/security/test/https-only/**",
"dom/security/test/mixedcontentblocker/**",
"dom/security/test/sec-fetch/**",
"dom/security/test/sri/**",
"dom/security/test/referrer-policy/**",
"dom/serviceworkers/**",
Expand Down Expand Up @@ -378,25 +379,13 @@ module.exports = {
"docshell/test/chrome/test_viewsource_forbidden_in_iframe.xhtml",
],
rules: {
"dot-notation": "off",
"no-global-assign": "off",
"no-octal": "off",
"object-shorthand": "off",
"mozilla/consistent-if-bracing": "off",
"mozilla/no-compare-against-boolean-literals": "off",
"mozilla/no-useless-parameters": "off",
"mozilla/no-useless-removeEventListener": "off",
"mozilla/use-cc-etc": "off",
"mozilla/use-services": "off",
"mozilla/use-chromeutils-generateqi": "off",
"consistent-return": "off",
"no-delete-var": "off",
"no-redeclare": "off",
"no-sequences": "off",
"no-shadow": "off",
"no-undef": "off",
"no-unused-vars": "off",
"no-useless-call": "off",
},
},
{
Expand Down Expand Up @@ -519,7 +508,7 @@ module.exports = {
"browser/components/customizableui/test/browser_989338_saved_placements_not_resaved.js",
"browser/components/customizableui/test/browser_currentset_post_reset.js",
"browser/components/customizableui/test/browser_panel_keyboard_navigation.js",
"browser/components/customizableui/test/browser_proton_toolbar_hide_home_and_library_buttons.js",
"browser/components/customizableui/test/browser_proton_toolbar_hide_toolbarbuttons.js",
"browser/components/enterprisepolicies/tests/browser/browser_policies_setAndLockPref_API.js",
"browser/components/enterprisepolicies/tests/browser/head.js",
"browser/components/enterprisepolicies/tests/xpcshell/head.js",
Expand Down
1 change: 1 addition & 0 deletions mozjs/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ exclude =
testing/marionette/harness/marionette_harness/tests,
testing/mochitest/pywebsocket3,
testing/mozharness/configs/test/test_malformed.py,
testing/web-platform/mozilla/tests/tools/wptserve_py2,
testing/web-platform/tests,
tools/lint/test/files,
tools/infer/test/*.configure,
Expand Down
Loading

0 comments on commit d68e072

Please sign in to comment.