From 33651a94ed1f05e0501a799fed9e54292a538a11 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Mon, 25 Jan 2021 20:44:54 +0100 Subject: [PATCH 1/3] Upgrade Xargo to v0.3.22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This includes a “Fix for changed rustc directory layout.” change: https://github.com/japaric/xargo/blob/master/CHANGELOG.md#v0322---2020-07-29 We use Xargo to compile rust-std for Windows UWP targets. I built `xargo.exe` on Taskcluster with task https://community-tc.services.mozilla.com/tasks/IHwGq_ViRpGuomBx82XmpQ created through https://community-tc.services.mozilla.com/tasks/create with this definition: ```yaml provisionerId: proj-servo workerType: win2016 schedulerId: taskcluster-github created: '2021-01-25T19:39:29.952Z' deadline: '2021-01-26T19:39:29.952Z' expires: '2022-01-25T19:39:29.952Z' payload: mounts: - file: rustup-init.exe content: url: https://win.rustup.rs/x86_64 command: - '%HOMEDRIVE%%HOMEPATH%\rustup-init.exe --profile=minimal -y' - set PATH=%HOMEDRIVE%%HOMEPATH%\.cargo\bin;%PATH% - |- cargo install xargo --version 0.3.22 copy %HOMEDRIVE%%HOMEPATH%\.cargo\bin\xargo.exe . artifacts: - name: public/xargo.exe path: xargo.exe type: file expires: '2022-01-25T15:07:23.782706Z' maxRunTime: 5400 metadata: name: Xargo build for Windows description: '' owner: infra@servo.org source: https://community-tc.services.mozilla.com/tasks/create ``` (Note the "update timestamps" button in the bottom-right menu.) I then created a ZIP file that contains `xargo-v0.3.22/xargo.exe` and uploaded it with `aws s3 cp ./xargo-v0.3.22.zip s3://servo-deps-2/msvc-deps/` where our build system can find it. --- python/servo/packages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/servo/packages.py b/python/servo/packages.py index ea903a3913b..cab8af5fae8 100644 --- a/python/servo/packages.py +++ b/python/servo/packages.py @@ -11,5 +11,5 @@ WINDOWS_MSVC = { "openssl": "111.3.0+1.1.1c-vs2017-2019-09-18", "gstreamer-uwp": "1.16.0.5", "openxr-loader-uwp": "1.0", - "xargo": "v0.3.17", + "xargo": "v0.3.22", } From 173123a768528a06a133db9c73e5bb388c13dbf6 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sat, 29 Aug 2020 11:58:33 +0200 Subject: [PATCH 2/3] Upgrade to rustc 1.48.0-nightly (623fb90b5 2020-09-26) --- components/script_plugins/lib.rs | 20 ++++++++++++-------- rust-toolchain | 2 +- tests/unit/script/size_of.rs | 16 ++++++++-------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/components/script_plugins/lib.rs b/components/script_plugins/lib.rs index 79d1a5282ef..5259366c7fd 100644 --- a/components/script_plugins/lib.rs +++ b/components/script_plugins/lib.rs @@ -110,7 +110,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function continue; }, }; - let recur_into_subtree = match t.kind { + let recur_into_subtree = match t.kind() { ty::Adt(did, substs) => { let has_attr = |did, name| has_lint_attr(sym, &cx.tcx.get_attrs(did), name); if has_attr(did.did, sym.must_root) { @@ -121,7 +121,7 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function } else if match_def_path(cx, did.did, &[sym.alloc, sym.rc, sym.Rc]) { // Rc is okay let inner = substs.type_at(0); - if let ty::Adt(did, _) = inner.kind { + if let ty::Adt(did, _) = inner.kind() { if has_attr(did.did, sym.allow_unrooted_in_rc) { false } else { @@ -132,8 +132,12 @@ fn is_unrooted_ty(sym: &Symbols, cx: &LateContext, ty: &ty::TyS, in_new_function } } else if match_def_path(cx, did.did, &[sym::core, sym.cell, sym.Ref]) || match_def_path(cx, did.did, &[sym::core, sym.cell, sym.RefMut]) || - match_def_path(cx, did.did, &[sym::core, sym.slice, sym.Iter]) || - match_def_path(cx, did.did, &[sym::core, sym.slice, sym.IterMut]) || + match_def_path(cx, did.did, &[sym::core, sym::slice, sym::iter, sym.Iter]) || + match_def_path( + cx, + did.did, + &[sym::core, sym::slice, sym::iter, sym.IterMut], + ) || match_def_path(cx, did.did, &[sym.accountable_refcell, sym.Ref]) || match_def_path(cx, did.did, &[sym.accountable_refcell, sym.RefMut]) || match_def_path( @@ -383,13 +387,14 @@ impl<'a, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'tcx> { /// usage e.g. with /// `match_def_path(cx, id, &["core", "option", "Option"])` fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { - let krate = &cx.tcx.crate_name(def_id.krate); + let def_path = cx.tcx.def_path(def_id); + let krate = &cx.tcx.crate_name(def_path.krate); if krate != &path[0] { return false; } let path = &path[1..]; - let other = cx.tcx.def_path(def_id).data; + let other = def_path.data; if other.len() != path.len() { return false; @@ -398,7 +403,7 @@ fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool { other .into_iter() .zip(path) - .all(|(e, p)| e.data.as_symbol() == *p) + .all(|(e, p)| e.data.get_opt_name().as_ref() == Some(p)) } fn in_derive_expn(span: Span) -> bool { @@ -438,7 +443,6 @@ symbols! { accountable_refcell Ref RefMut - slice Iter IterMut collections diff --git a/rust-toolchain b/rust-toolchain index 40973dae63e..5bc8eb6009c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-07-27 +nightly-2020-09-27 diff --git a/tests/unit/script/size_of.rs b/tests/unit/script/size_of.rs index e46848e5cf1..c6849956124 100644 --- a/tests/unit/script/size_of.rs +++ b/tests/unit/script/size_of.rs @@ -29,11 +29,11 @@ macro_rules! sizeof_checker ( ); // Update the sizes here -sizeof_checker!(size_event_target, EventTarget, 56); -sizeof_checker!(size_node, Node, 192); -sizeof_checker!(size_element, Element, 368); -sizeof_checker!(size_htmlelement, HTMLElement, 384); -sizeof_checker!(size_div, HTMLDivElement, 384); -sizeof_checker!(size_span, HTMLSpanElement, 384); -sizeof_checker!(size_text, Text, 224); -sizeof_checker!(size_characterdata, CharacterData, 224); +sizeof_checker!(size_event_target, EventTarget, 48); +sizeof_checker!(size_node, Node, 184); +sizeof_checker!(size_element, Element, 360); +sizeof_checker!(size_htmlelement, HTMLElement, 376); +sizeof_checker!(size_div, HTMLDivElement, 376); +sizeof_checker!(size_span, HTMLSpanElement, 376); +sizeof_checker!(size_text, Text, 216); +sizeof_checker!(size_characterdata, CharacterData, 216); From ee74a64f537f0899f4913ab7d3907889f37b1150 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 26 Jan 2021 07:50:11 +0100 Subject: [PATCH 3/3] Silence the warning about `rustup --version` v.s. `rustc --version` --- python/servo/command_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 7430247a2e3..2146a46693a 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -1028,7 +1028,12 @@ install them, let us know by filing a bug!") def ensure_rustup_version(self): try: - version_line = subprocess.check_output(["rustup" + BIN_SUFFIX, "--version"]) + version_line = subprocess.check_output( + ["rustup" + BIN_SUFFIX, "--version"], + # Silence "info: This is the version for the rustup toolchain manager, + # not the rustc compiler." + stderr=open(os.devnull, "wb") + ) except OSError as e: if e.errno == NO_SUCH_FILE_OR_DIRECTORY: print("It looks like rustup is not installed. See instructions at "