From 6ed875ba67ecab4906bf0a969b94d511c85a4f2e Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Jun 08 2023 12:38:15 +0000 Subject: Add mp4parse-rust patch to build with rust 1.70 Discovered as https://github.com/mozilla/mp4parse-rust/commit/8b5b652d38e007e736bb442ccd5aa5ed699db100 apparently its commit summary "Fix unstable-name-collisions warning by using fully qualified path" being completely unrelated to this confusing error message: error[E0277]: the trait bound `u64: Mul` is not satisfied --> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3188:62 | 3188 | static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX); | ^ no implementation for `u64 * NonZeroU8` ... 3198 | impl_mul!((U8, std::num::NonZeroU8) => (U16, u16)); | -------------------------------------------------- in this macro invocation | = help: the trait `~const Mul` is not implemented for `u64` = help: the following other types implement trait `Mul`: <&'a u64 as Mul> <&u64 as Mul<&u64>> > = note: this error originates in the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant used --> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3198:1 | 3198 | impl_mul!((U8, std::num::NonZeroU8) => (U16, u16)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this note originates in the macro `static_assertions::const_assert` which comes from the expansion of the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `u64: Mul` is not satisfied --> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3188:62 | 3188 | static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX); | ^ no implementation for `u64 * NonZeroU8` ... 3199 | impl_mul!((U32, std::num::NonZeroU8) => (U32MulU8, u64)); | -------------------------------------------------------- in this macro invocation | = help: the trait `~const Mul` is not implemented for `u64` = help: the following other types implement trait `Mul`: <&'a u64 as Mul> <&u64 as Mul<&u64>> > = note: this error originates in the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info) note: erroneous constant used --> /builddir/build/BUILD/thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs:3199:1 | 3199 | impl_mul!((U32, std::num::NonZeroU8) => (U32MulU8, u64)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this note originates in the macro `static_assertions::const_assert` which comes from the expansion of the macro `impl_mul` (in Nightly builds, run with -Z macro-backtrace for more info) For more information about this error, try `rustc --explain E0277`. error: could not compile `mp4parse` (lib) due to 2 previous errors --- diff --git a/mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100.patch b/mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100.patch new file mode 100644 index 0000000..fd7a09e --- /dev/null +++ b/mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100.patch @@ -0,0 +1,18 @@ +--- thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs.mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100 2023-05-24 00:50:52.000000000 +0200 ++++ thunderbird-102.11.1/third_party/rust/mp4parse/src/lib.rs 2023-06-08 14:17:40.193695212 +0200 +@@ -3184,8 +3184,13 @@ macro_rules! impl_mul { + type Output = $output; + + fn mul(self, rhs: $rhs) -> Self::Output { +- static_assertions::const_assert!(<$output>::MAX <= <$inner>::MAX as u64); +- static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX); ++ static_assertions::const_assert!( ++ <$output as UpperBounded>::MAX <= <$inner>::MAX as u64 ++ ); ++ static_assertions::const_assert!( ++ <$lhs as UpperBounded>::MAX * <$rhs as UpperBounded>::MAX ++ <= <$output as UpperBounded>::MAX ++ ); + + let lhs: $inner = self.get().into(); + let rhs: $inner = rhs.get().into(); diff --git a/thunderbird.spec b/thunderbird.spec index 488a626..29de379 100644 --- a/thunderbird.spec +++ b/thunderbird.spec @@ -140,6 +140,10 @@ Patch426: gcc13-header-dependencies.patch # https://github.com/rust-lang/rust-bindgen/pull/2339 Patch427: rust-bindgen-2319-2339.patch +# Needed with rust 1.70 +# https://github.com/mozilla/mp4parse-rust/commit/8b5b652d38e007e736bb442ccd5aa5ed699db100 +Patch428: mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100.patch + # PPC fix Patch304: mozilla-1245783.patch @@ -339,6 +343,8 @@ popd # MUST ONLY be applied for building against clang LLVM 16. # Would crash with earlier clang. %patch -P 427 -p1 -b .rust-bindgen-2319-2339 +# Needed with rust 1.70 +%patch -P 428 -p1 -b .mp4parse-rust-8b5b652d38e007e736bb442ccd5aa5ed699db100 %endif %patch -P 501 -p1 -b .expat-CVE-2022-25235