Fix build with rust 1.51
This commit is contained in:
parent
3a719fac38
commit
7b80a627b9
57
Fix-build-with-rust-nightly.patch
Normal file
57
Fix-build-with-rust-nightly.patch
Normal file
@ -0,0 +1,57 @@
|
||||
From 99c71d0db95b3626552a1375d5dfba22dc82ebfd Mon Sep 17 00:00:00 2001
|
||||
From: lingsheng <lingsheng@huawei.com>
|
||||
Date: Fri, 30 Apr 2021 17:11:51 +0800
|
||||
Subject: [PATCH] Fix build with rust nightly
|
||||
|
||||
---
|
||||
.cargo/config.in | 2 +-
|
||||
Cargo.lock | 2 +-
|
||||
Cargo.toml | 4 ++--
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/.cargo/config.in b/.cargo/config.in
|
||||
index a40e667b5a..c95e6e016b 100644
|
||||
--- a/.cargo/config.in
|
||||
+++ b/.cargo/config.in
|
||||
@@ -3,9 +3,9 @@
|
||||
# Please do not edit.
|
||||
|
||||
[source."https://github.com/shravanrn/nix/"]
|
||||
-branch = "r0.13.1"
|
||||
git = "https://github.com/shravanrn/nix/"
|
||||
replace-with = "vendored-sources"
|
||||
+rev = "4af6c367603869a30fddb5ffb0aba2b9477ba92e"
|
||||
|
||||
[source."https://github.com/mozilla/rkv"]
|
||||
git = "https://github.com/mozilla/rkv"
|
||||
diff --git a/Cargo.lock b/Cargo.lock
|
||||
index 0b61796d7d..e97e8d080b 100644
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -3196,7 +3196,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.13.1"
|
||||
-source = "git+https://github.com/shravanrn/nix/?branch=r0.13.1#4af6c367603869a30fddb5ffb0aba2b9477ba92e"
|
||||
+source = "git+https://github.com/shravanrn/nix/?rev=4af6c367603869a30fddb5ffb0aba2b9477ba92e#4af6c367603869a30fddb5ffb0aba2b9477ba92e"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
diff --git a/Cargo.toml b/Cargo.toml
|
||||
index 0b7ec008b8..910a62ee57 100644
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -67,8 +67,8 @@ panic = "abort"
|
||||
libudev-sys = { path = "dom/webauthn/libudev-sys" }
|
||||
packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="3541e3818fdc7c2a24f87e3459151a4ce955a67a" }
|
||||
rlbox_lucet_sandbox = { git = "https://github.com/PLSysSec/rlbox_lucet_sandbox/", rev="d510da5999a744c563b0acd18056069d1698273f" }
|
||||
-nix = { git = "https://github.com/shravanrn/nix/", branch = "r0.13.1", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
|
||||
-spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3", rev = "20191ad2f370afd6d247edcb9ff9da32d3bedb9c" }
|
||||
+nix = { git = "https://github.com/shravanrn/nix/", rev="4af6c367603869a30fddb5ffb0aba2b9477ba92e" }
|
||||
+spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu3" }
|
||||
# failure's backtrace feature might break our builds, see bug 1608157.
|
||||
failure = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }
|
||||
failure_derive = { git = "https://github.com/badboy/failure", rev = "64af847bc5fdcb6d2438bec8a6030812a80519a5" }
|
||||
--
|
||||
2.23.0
|
||||
|
||||
@ -0,0 +1,211 @@
|
||||
|
||||
# HG changeset patch
|
||||
# User Emilio Cobos Álvarez <emilio@crisal.io>
|
||||
# Date 1594925481 0
|
||||
# Node ID da77d5528a0819c4e61a92f642542b55da81183e
|
||||
# Parent 5e9a7815de712ddc8ab5bb784b644a03e5f2e6b4
|
||||
Bug 1653339 - Teach style_derive's map_type_params about mapping self correctly. r=boris
|
||||
|
||||
Consider the following:
|
||||
|
||||
struct Complex<T> {
|
||||
something: T,
|
||||
#[compute(field_bound)]
|
||||
something_else: Generic<Self, T>,
|
||||
}
|
||||
|
||||
That will generate:
|
||||
|
||||
impl<T> ToComputedValue for Complex<T>
|
||||
where
|
||||
T: ToComputedValue,
|
||||
Generic<Self, T>: ToComputedValue<ComputedValue = Generic<Self, <T as ToComputedValue>::ComputedValue>>,
|
||||
{
|
||||
// ...
|
||||
}
|
||||
|
||||
That last clause is obviously incorrect. map_type_params correctly maps
|
||||
the T, but it should know also about Self.
|
||||
|
||||
Ideally we could just do the same as for T and do:
|
||||
|
||||
<Self as ToComputedValue>::ComputedValue
|
||||
|
||||
But that doesn't quite work, because we are in that implementation of
|
||||
the trait, and the compiler rightfully complains about we don't yet
|
||||
knowing the computed type. So we need to pass it explicitly, which is
|
||||
simple enough, if a bit annoying.
|
||||
|
||||
Differential Revision: https://phabricator.services.mozilla.com/D83816
|
||||
|
||||
diff --git a/servo/components/derive_common/cg.rs b/servo/components/derive_common/cg.rs
|
||||
--- a/servo/components/derive_common/cg.rs
|
||||
+++ b/servo/components/derive_common/cg.rs
|
||||
@@ -149,79 +149,85 @@ pub fn fmap_trait_output(input: &DeriveI
|
||||
colon2_token: Default::default(),
|
||||
gt_token: Default::default(),
|
||||
lt_token: Default::default(),
|
||||
}),
|
||||
};
|
||||
segment.into()
|
||||
}
|
||||
|
||||
-pub fn map_type_params<F>(ty: &Type, params: &[&TypeParam], f: &mut F) -> Type
|
||||
+pub fn map_type_params<F>(ty: &Type, params: &[&TypeParam], self_type: &Path, f: &mut F) -> Type
|
||||
where
|
||||
F: FnMut(&Ident) -> Type,
|
||||
{
|
||||
match *ty {
|
||||
Type::Slice(ref inner) => Type::from(TypeSlice {
|
||||
- elem: Box::new(map_type_params(&inner.elem, params, f)),
|
||||
+ elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
|
||||
..inner.clone()
|
||||
}),
|
||||
Type::Array(ref inner) => {
|
||||
//ref ty, ref expr) => {
|
||||
Type::from(TypeArray {
|
||||
- elem: Box::new(map_type_params(&inner.elem, params, f)),
|
||||
+ elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
|
||||
..inner.clone()
|
||||
})
|
||||
},
|
||||
ref ty @ Type::Never(_) => ty.clone(),
|
||||
Type::Tuple(ref inner) => Type::from(TypeTuple {
|
||||
elems: inner
|
||||
.elems
|
||||
.iter()
|
||||
- .map(|ty| map_type_params(&ty, params, f))
|
||||
+ .map(|ty| map_type_params(&ty, params, self_type, f))
|
||||
.collect(),
|
||||
..inner.clone()
|
||||
}),
|
||||
Type::Path(TypePath {
|
||||
qself: None,
|
||||
ref path,
|
||||
}) => {
|
||||
if let Some(ident) = path_to_ident(path) {
|
||||
if params.iter().any(|ref param| ¶m.ident == ident) {
|
||||
return f(ident);
|
||||
}
|
||||
+ if ident == "Self" {
|
||||
+ return Type::from(TypePath {
|
||||
+ qself: None,
|
||||
+ path: self_type.clone(),
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
Type::from(TypePath {
|
||||
qself: None,
|
||||
- path: map_type_params_in_path(path, params, f),
|
||||
+ path: map_type_params_in_path(path, params, self_type, f),
|
||||
})
|
||||
},
|
||||
Type::Path(TypePath {
|
||||
ref qself,
|
||||
ref path,
|
||||
}) => Type::from(TypePath {
|
||||
qself: qself.as_ref().map(|qself| QSelf {
|
||||
- ty: Box::new(map_type_params(&qself.ty, params, f)),
|
||||
+ ty: Box::new(map_type_params(&qself.ty, params, self_type, f)),
|
||||
position: qself.position,
|
||||
..qself.clone()
|
||||
}),
|
||||
- path: map_type_params_in_path(path, params, f),
|
||||
+ path: map_type_params_in_path(path, params, self_type, f),
|
||||
}),
|
||||
Type::Paren(ref inner) => Type::from(TypeParen {
|
||||
- elem: Box::new(map_type_params(&inner.elem, params, f)),
|
||||
+ elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
|
||||
..inner.clone()
|
||||
}),
|
||||
Type::Group(ref inner) => Type::from(TypeGroup {
|
||||
- elem: Box::new(map_type_params(&inner.elem, params, f)),
|
||||
+ elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
|
||||
..inner.clone()
|
||||
}),
|
||||
ref ty => panic!("type {:?} cannot be mapped yet", ty),
|
||||
}
|
||||
}
|
||||
|
||||
-fn map_type_params_in_path<F>(path: &Path, params: &[&TypeParam], f: &mut F) -> Path
|
||||
+fn map_type_params_in_path<F>(path: &Path, params: &[&TypeParam], self_type: &Path, f: &mut F) -> Path
|
||||
where
|
||||
F: FnMut(&Ident) -> Type,
|
||||
{
|
||||
Path {
|
||||
leading_colon: path.leading_colon,
|
||||
segments: path
|
||||
.segments
|
||||
.iter()
|
||||
@@ -231,21 +237,21 @@ where
|
||||
PathArguments::AngleBracketed(ref data) => {
|
||||
PathArguments::AngleBracketed(AngleBracketedGenericArguments {
|
||||
args: data
|
||||
.args
|
||||
.iter()
|
||||
.map(|arg| match arg {
|
||||
ty @ &GenericArgument::Lifetime(_) => ty.clone(),
|
||||
&GenericArgument::Type(ref data) => {
|
||||
- GenericArgument::Type(map_type_params(data, params, f))
|
||||
+ GenericArgument::Type(map_type_params(data, params, self_type, f))
|
||||
},
|
||||
&GenericArgument::Binding(ref data) => {
|
||||
GenericArgument::Binding(Binding {
|
||||
- ty: map_type_params(&data.ty, params, f),
|
||||
+ ty: map_type_params(&data.ty, params, self_type, f),
|
||||
..data.clone()
|
||||
})
|
||||
},
|
||||
ref arg => panic!("arguments {:?} cannot be mapped yet", arg),
|
||||
})
|
||||
.collect(),
|
||||
..data.clone()
|
||||
})
|
||||
diff --git a/servo/components/style_derive/to_computed_value.rs b/servo/components/style_derive/to_computed_value.rs
|
||||
--- a/servo/components/style_derive/to_computed_value.rs
|
||||
+++ b/servo/components/style_derive/to_computed_value.rs
|
||||
@@ -42,22 +42,25 @@ pub fn derive_to_value(
|
||||
BindStyle::Ref | BindStyle::RefMut => false,
|
||||
};
|
||||
|
||||
let params = input.generics.type_params().collect::<Vec<_>>();
|
||||
for param in ¶ms {
|
||||
cg::add_predicate(&mut where_clause, parse_quote!(#param: #trait_path));
|
||||
}
|
||||
|
||||
+ let computed_value_type = cg::fmap_trait_output(&input, &trait_path, &output_type_name);
|
||||
+
|
||||
let mut add_field_bound = |binding: &BindingInfo| {
|
||||
let ty = &binding.ast().ty;
|
||||
|
||||
let output_type = cg::map_type_params(
|
||||
ty,
|
||||
¶ms,
|
||||
+ &computed_value_type,
|
||||
&mut |ident| parse_quote!(<#ident as #trait_path>::#output_type_name),
|
||||
);
|
||||
|
||||
cg::add_predicate(
|
||||
&mut where_clause,
|
||||
parse_quote!(
|
||||
#ty: #trait_path<#output_type_name = #output_type>
|
||||
),
|
||||
@@ -137,17 +140,16 @@ pub fn derive_to_value(
|
||||
}
|
||||
};
|
||||
|
||||
(to_body, from_body)
|
||||
};
|
||||
|
||||
input.generics.where_clause = where_clause;
|
||||
let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl();
|
||||
- let computed_value_type = cg::fmap_trait_output(&input, &trait_path, &output_type_name);
|
||||
|
||||
let impl_ = trait_impl(from_body, to_body);
|
||||
|
||||
quote! {
|
||||
impl #impl_generics #trait_path for #name #ty_generics #where_clause {
|
||||
type #output_type_name = #computed_value_type;
|
||||
|
||||
#impl_
|
||||
|
||||
File diff suppressed because one or more lines are too long
11
firefox.spec
11
firefox.spec
@ -88,7 +88,7 @@
|
||||
Summary: Mozilla Firefox Web browser
|
||||
Name: firefox
|
||||
Version: 79.0
|
||||
Release: 5
|
||||
Release: 6
|
||||
URL: https://www.mozilla.org/firefox/
|
||||
License: MPLv1.1 or GPLv2+ or LGPLv2+
|
||||
Source0: https://archive.mozilla.org/pub/firefox/releases/%{version}/source/firefox-%{version}.source.tar.xz
|
||||
@ -175,6 +175,9 @@ Patch629: CVE-2020-26963-2.patch
|
||||
Patch630: CVE-2020-26965.patch
|
||||
Patch631: CVE-2020-26966.patch
|
||||
Patch632: CVE-2020-26967.patch
|
||||
Patch633: Fix-build-with-rust-nightly.patch
|
||||
Patch634: Teach-style_derives-map_type_params-about-mapping-self-correctly.patch
|
||||
Patch635: Update-syn-and-proc-macro2-so-that-Firefox-can-build-on-Rust-nightly-again.patch
|
||||
|
||||
%if %{?system_nss}
|
||||
BuildRequires: pkgconfig(nspr) >= %{nspr_version} pkgconfig(nss) >= %{nss_version}
|
||||
@ -342,6 +345,9 @@ tar -xf %{SOURCE3}
|
||||
%patch630 -p1
|
||||
%patch631 -p1
|
||||
%patch632 -p1
|
||||
%patch633 -p1
|
||||
%patch634 -p1
|
||||
%patch635 -p1
|
||||
%{__rm} -f .mozconfig
|
||||
%{__cp} %{SOURCE10} .mozconfig
|
||||
echo "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland" >> .mozconfig
|
||||
@ -783,6 +789,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri May 14 2021 lingsheng <lingsheng@huawei.com> - 79.0-6
|
||||
- Fix build with rust 1.51
|
||||
|
||||
* Thu Jan 07 2021 wangxiao <wangxiao65@huawei.com> - 79.0-5
|
||||
- Fix CVE-2020-15969 CVE-2020-15999 CVE-2020-16012 CVE-2020-26951
|
||||
CVE-2020-26953 CVE-2020-26956 CVE-2020-26957 CVE-2020-26958
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user