Use MozTools 4 and update mozjs (#30326)

* Update mozjs

* moztools4 in bootstrap

* no autoconf

* tidy

* switch to servo-build-deps

* update mozjs for real

* glue mozjs

* fmt

* move to servo/mozjs
This commit is contained in:
Samson 2023-09-11 10:23:05 +02:00 committed by GitHub
parent 9b1247b20f
commit 59d134133f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 46 additions and 20 deletions

36
Cargo.lock generated
View file

@ -382,6 +382,27 @@ dependencies = [
"which",
]
[[package]]
name = "bindgen"
version = "0.66.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
dependencies = [
"bitflags 2.4.0",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
"syn 2.0.29",
"which",
]
[[package]]
name = "bit-set"
version = "0.5.3"
@ -1527,9 +1548,9 @@ dependencies = [
[[package]]
name = "encoding_c"
version = "0.9.7"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1891d977f814fd638c3b964987778665b5d1dc8690f46c4c7adc91466ad1c78a"
checksum = "9af727805f3b0d79956bde5b35732669fb5c5d45a94893798e7b7e70cfbf9cc1"
dependencies = [
"encoding_rs",
]
@ -3692,8 +3713,9 @@ checksum = "903970ae2f248d7275214cf8f387f8ba0c4ea7e3d87a320e85493db60ce28616"
[[package]]
name = "mozjs"
version = "0.14.1"
source = "git+https://github.com/servo/mozjs#8dcf64e1dd1c362b2af3abb735f100bdff8a627d"
source = "git+https://github.com/servo/mozjs#d7f6f30cb9bfd3e7e4d1ff7d605059369acdf25d"
dependencies = [
"bindgen 0.66.1",
"cc",
"lazy_static",
"libc",
@ -3705,9 +3727,9 @@ dependencies = [
[[package]]
name = "mozjs_sys"
version = "0.68.2"
source = "git+https://github.com/servo/mozjs#8dcf64e1dd1c362b2af3abb735f100bdff8a627d"
source = "git+https://github.com/servo/mozjs#d7f6f30cb9bfd3e7e4d1ff7d605059369acdf25d"
dependencies = [
"bindgen",
"bindgen 0.66.1",
"cc",
"encoding_c",
"encoding_c_mem",
@ -5800,7 +5822,7 @@ dependencies = [
"app_units",
"arrayvec 0.7.4",
"atomic_refcell",
"bindgen",
"bindgen 0.62.0",
"bitflags 1.3.2",
"byteorder",
"cssparser",
@ -6925,7 +6947,7 @@ version = "0.0.1"
source = "git+https://github.com/servo/webxr#b29816a530a7519e30124c6e636511857c32433d"
dependencies = [
"android_injected_glue",
"bindgen",
"bindgen 0.62.0",
"crossbeam-channel",
"euclid",
"gl_generator 0.13.1",

View file

@ -356,7 +356,7 @@ pub fn is_dom_proxy(obj: *mut JSObject) -> bool {
use js::glue::IsProxyHandlerFamily;
unsafe {
let clasp = get_object_class(obj);
((*clasp).flags & js::JSCLASS_IS_PROXY) != 0 && IsProxyHandlerFamily(obj) != 0
((*clasp).flags & js::JSCLASS_IS_PROXY) != 0 && IsProxyHandlerFamily(obj)
}
}
@ -422,7 +422,7 @@ pub(crate) unsafe fn private_from_proto_check(
let dom_class = get_dom_class(obj).or_else(|_| {
if IsWrapper(obj) {
trace!("found wrapper");
obj = UnwrapObjectDynamic(obj, cx, /* stopAtWindowProxy = */ 0);
obj = UnwrapObjectDynamic(obj, cx, /* stopAtWindowProxy = */ false);
if obj.is_null() {
trace!("unwrapping security wrapper failed");
Err(())

View file

@ -113,7 +113,7 @@ unsafe fn html_constructor(
// The new_target might be a cross-compartment wrapper. Get the underlying object
// so we can do the spec's object-identity checks.
rooted!(in(*cx) let new_target_unwrapped = UnwrapObjectDynamic(call_args.new_target().to_object(), *cx, 1));
rooted!(in(*cx) let new_target_unwrapped = UnwrapObjectDynamic(call_args.new_target().to_object(), *cx, true));
if new_target_unwrapped.is_null() {
throw_dom_exception(cx, global, Error::Type("new.target is null".to_owned()));
return Err(());

View file

@ -431,7 +431,7 @@ pub fn define_guarded_properties(
/// be exposed in the global object `obj`.
pub fn is_exposed_in(object: HandleObject, globals: Globals) -> bool {
unsafe {
let unwrapped = UncheckedUnwrapObject(object.get(), /* stopAtWindowProxy = */ 0);
let unwrapped = UncheckedUnwrapObject(object.get(), /* stopAtWindowProxy = */ false);
let dom_class = get_dom_class(unwrapped).unwrap();
globals.contains(dom_class.global)
}

View file

@ -278,7 +278,7 @@ pub unsafe fn find_enum_value<'a, T>(
/// <https://heycam.github.io/webidl/#dfn-platform-object>
pub fn is_platform_object_dynamic(obj: *mut JSObject, cx: *mut JSContext) -> bool {
is_platform_object(obj, &|o| unsafe {
UnwrapObjectDynamic(o, cx, /* stopAtWindowProxy = */ 0)
UnwrapObjectDynamic(o, cx, /* stopAtWindowProxy = */ false)
})
}

View file

@ -2174,7 +2174,7 @@ impl GlobalScope {
cx: *mut JSContext,
) -> DomRoot<Self> {
if IsWrapper(obj) {
obj = UnwrapObjectDynamic(obj, cx, /* stopAtWindowProxy = */ 0);
obj = UnwrapObjectDynamic(obj, cx, /* stopAtWindowProxy = */ false);
assert!(!obj.is_null());
}
GlobalScope::from_object(obj)

View file

@ -37,6 +37,7 @@ use crate::script_thread::trace_thread;
use crate::task::TaskBox;
use crate::task_source::networking::NetworkingTaskSource;
use crate::task_source::{TaskSource, TaskSourceName};
use core::ffi::c_char;
use js::glue::{CollectServoSizes, CreateJobQueue, DeleteJobQueue, DispatchableRun};
use js::glue::{JobQueueTraps, RUST_js_GetErrorMessage, SetBuildId, StreamConsumerConsumeChunk};
use js::glue::{
@ -836,7 +837,7 @@ unsafe extern "C" fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_
#[allow(unsafe_code)]
unsafe extern "C" fn servo_build_id(build_id: *mut BuildIdCharVector) -> bool {
let servo_id = b"Servo\0";
SetBuildId(build_id, &servo_id[0], servo_id.len())
SetBuildId(build_id, servo_id[0] as *const c_char, servo_id.len())
}
#[allow(unsafe_code)]

View file

@ -25,7 +25,7 @@ clangStdenv.mkDerivation rec {
llvmPackages.bintools # provides lld
# Build utilities
cmake dbus gcc git pkg-config which llvm autoconf213 perl yasm m4
cmake dbus gcc git pkg-config which llvm perl yasm m4
(python3.withPackages (ps: with ps; [virtualenv pip dbus]))
# This pins gnumake to 4.3 since 4.4 breaks jobserver
# functionality in mozjs and causes builds to be extremely

View file

@ -17,14 +17,14 @@ from .. import util
from .base import Base
# Please keep these in sync with the packages in README.md
APT_PKGS = ['git', 'curl', 'autoconf', 'libx11-dev', 'libfreetype6-dev',
APT_PKGS = ['git', 'curl', 'libx11-dev', 'libfreetype6-dev',
'libgl1-mesa-dri', 'libglib2.0-dev', 'xorg-dev', 'gperf', 'g++',
'build-essential', 'cmake', 'liblzma-dev', 'libxmu6', 'libxmu-dev',
"libxcb-render0-dev", "libxcb-shape0-dev", "libxcb-xfixes0-dev",
'libgles2-mesa-dev', 'libegl1-mesa-dev', 'libdbus-1-dev',
'libharfbuzz-dev', 'ccache', 'clang', 'libunwind-dev',
'libgstreamer1.0-dev', 'libgstreamer-plugins-base1.0-dev',
'libgstreamer-plugins-bad1.0-dev', 'autoconf2.13',
'libgstreamer-plugins-bad1.0-dev',
'libunwind-dev', 'llvm-dev']
DNF_PKGS = ['libtool', 'gcc-c++', 'libXi-devel', 'freetype-devel',
'libunwind-devel', 'mesa-libGL-devel', 'mesa-libEGL-devel',
@ -32,7 +32,7 @@ DNF_PKGS = ['libtool', 'gcc-c++', 'libXi-devel', 'freetype-devel',
'fontconfig-devel', 'cabextract', 'ttmkfdir', 'expat-devel',
'rpm-build', 'cmake', 'libXcursor-devel', 'libXmu-devel',
'dbus-devel', 'ncurses-devel', 'harfbuzz-devel', 'ccache',
'clang', 'clang-libs', 'llvm', 'autoconf213', 'python3-devel',
'clang', 'clang-libs', 'llvm', 'python3-devel',
'gstreamer1-devel', 'gstreamer1-plugins-base-devel',
'gstreamer1-plugins-bad-free-devel', 'libjpeg-turbo-devel',
'zlib', 'libjpeg']
@ -42,7 +42,7 @@ XBPS_PKGS = ['libtool', 'gcc', 'libXi-devel', 'freetype-devel',
'fontconfig-devel', 'cabextract', 'expat-devel', 'cmake',
'cmake', 'libXcursor-devel', 'libXmu-devel', 'dbus-devel',
'ncurses-devel', 'harfbuzz-devel', 'ccache', 'glu-devel',
'clang', 'gstreamer1-devel', 'autoconf213',
'clang', 'gstreamer1-devel',
'gst-plugins-base1-devel', 'gst-plugins-bad1-devel']
GSTREAMER_URL = \

View file

@ -19,7 +19,7 @@ from .base import Base
DEPS_URL = "https://github.com/servo/servo-build-deps/releases/download/msvc-deps/"
DEPENDENCIES = {
"moztools": "3.2",
"moztools": "4.0",
}
URL_BASE = "https://gstreamer.freedesktop.org/data/pkg/windows/1.16.0/"

View file

@ -73,6 +73,9 @@ packages = [
# Duplicated by servo-media.
"uuid",
# style/webxr (0.62) vs. mozjs_sys (0.66)
"bindgen",
]
# Files that are ignored for all tidy and lint checks.
files = [