Closed Bug 1730397 Opened 3 years ago Closed 3 years ago

firefox-91.1.0 fails to compile with rust-1.56

Categories

(Firefox Build System :: General, defect, P3)

Firefox 91
defect

Tracking

(firefox-esr91 fixed, firefox94 fixed)

RESOLVED FIXED
94 Branch
Tracking Status
firefox-esr91 --- fixed
firefox94 --- fixed

People

(Reporter: herrtimson, Assigned: glandium)

References

Details

Attachments

(6 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

hey there, I installed rust-1.56-beta2 for testing and tried to compile firefox with it on a linux amd64 box. The compile is broken.

Actual results:

Actual results:

the compile failed with these errors:

1:56.73 error: [u32; 2] is forbidden as the type of a const generic parameter
1:56.73 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:20:44
1:56.73 |
1:56.73 20 | pub unsafe fn __shuffle_vector2<const IDX: [u32; 2], T, U>(x: T, y: T) -> U
1:56.73 | ^^^^^^^^
1:56.73 |
1:56.73 = note: the only supported types are integers, bool and char
1:56.73 = help: more complex types are supported with #![feature(adt_const_params)]
1:56.73 error: [u32; 4] is forbidden as the type of a const generic parameter
1:56.73 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:30:44
1:56.73 |
1:56.73 30 | pub unsafe fn __shuffle_vector4<const IDX: [u32; 4], T, U>(x: T, y: T) -> U
1:56.73 | ^^^^^^^^
1:56.73 |
1:56.73 = note: the only supported types are integers, bool and char
1:56.73 = help: more complex types are supported with #![feature(adt_const_params)]
1:56.73 error: [u32; 8] is forbidden as the type of a const generic parameter
1:56.73 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:40:44
1:56.73 |
1:56.73 40 | pub unsafe fn __shuffle_vector8<const IDX: [u32; 8], T, U>(x: T, y: T) -> U
1:56.73 | ^^^^^^^^
1:56.73 |
1:56.73 = note: the only supported types are integers, bool and char
1:56.73 = help: more complex types are supported with #![feature(adt_const_params)]
1:56.73 error: [u32; 16] is forbidden as the type of a const generic parameter
1:56.73 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:50:45
1:56.73 |
1:56.73 50 | pub unsafe fn __shuffle_vector16<const IDX: [u32; 16], T, U>(x: T, y: T) -> U
1:56.73 | ^^^^^^^^^
1:56.73 |
1:56.73 = note: the only supported types are integers, bool and char
1:56.73 = help: more complex types are supported with #![feature(adt_const_params)]
1:56.73 error: [u32; 32] is forbidden as the type of a const generic parameter
1:56.73 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:60:45
1:56.73 |
1:56.73 60 | pub unsafe fn __shuffle_vector32<const IDX: [u32; 32], T, U>(x: T, y: T) -> U
1:56.73 | ^^^^^^^^^
1:56.73 |
1:56.73 = note: the only supported types are integers, bool and char
1:56.73 = help: more complex types are supported with #![feature(adt_const_params)]
1:56.73 error: [u32; 64] is forbidden as the type of a const generic parameter
1:56.74 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:70:45
1:56.74 |
1:56.74 70 | pub unsafe fn __shuffle_vector64<const IDX: [u32; 64], T, U>(x: T, y: T) -> U
1:56.74 | ^^^^^^^^^
1:56.74 |
1:56.74 = note: the only supported types are integers, bool and char
1:56.74 = help: more complex types are supported with #![feature(adt_const_params)]

Expected results:

compile should have passed

I will attach the compressed build log, as of now I was unable to find a specific rust pullrequst that broke this.

It seems I wasn't grepping correctly, here are some missing but interesting bits:

1:52.57 error[E0557]: feature has been removed
1:52.57 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/lib.rs:203:5
1:52.57 |
1:52.57 203 | const_generics,
1:52.57 | ^^^^^^^^^^^^^^ feature has been removed
1:52.57 |

1:55.31 mkdir -p '.deps/'
1:55.31 caps/BasePrincipal.o

1:54.80 error: type parameters must be declared prior to const parameters
1:54.80 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:20:54
1:54.80 |
1:54.80 20 | pub unsafe fn __shuffle_vector2<const IDX: [u32; 2], T, U>(x: T, y: T) -> U
1:54.80 | ----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 2]>
1:54.80 error: type parameters must be declared prior to const parameters
1:54.80 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:30:54
1:54.81 |
1:54.81 30 | pub unsafe fn __shuffle_vector4<const IDX: [u32; 4], T, U>(x: T, y: T) -> U
1:54.81 | ----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 4]>
1:54.81 error: type parameters must be declared prior to const parameters
1:54.81 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:40:54
1:54.81 |
1:54.81 40 | pub unsafe fn __shuffle_vector8<const IDX: [u32; 8], T, U>(x: T, y: T) -> U
1:54.81 | ----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 8]>
1:54.81 error: type parameters must be declared prior to const parameters
1:54.81 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:50:56
1:54.81 |
1:54.81 50 | pub unsafe fn __shuffle_vector16<const IDX: [u32; 16], T, U>(x: T, y: T) -> U
1:54.81 | -----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 16]>
1:54.81 error: type parameters must be declared prior to const parameters
1:54.81 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:60:56
1:54.81 |
1:54.81 60 | pub unsafe fn __shuffle_vector32<const IDX: [u32; 32], T, U>(x: T, y: T) -> U
1:54.81 | -----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 32]>
1:54.81 error: type parameters must be declared prior to const parameters
1:54.81 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/packed_simd/src/codegen/llvm.rs:70:56
1:54.81 |
1:54.81 70 | pub unsafe fn __shuffle_vector64<const IDX: [u32; 64], T, U>(x: T, y: T) -> U
1:54.81 | -----------------------^--^- help: reorder the parameters: lifetimes, then types, then consts: <T, U, const IDX: [u32; 64]>
1:54.93 Compiling fallible_collections v0.4.2

so this is solved upstream:

https://github.com/rust-lang/packed_simd/commit/45d5347a0d2187c046a546a477d2a53111cd7713

maybe consider to cherry pick it?

The Bugbug bot thinks this bug should belong to the 'Firefox Build System::General' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → General
Product: Firefox → Firefox Build System

I pulled in the packed-simd update locally (need to refresh checksums), this uncovers another error. Upstream issue: https://github.com/tokio-rs/prost/issues/526

3:09.40 error[E0034]: multiple applicable items in scope
3:09.40 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/prost-derive/src/lib.rs:111:14
3:09.40 |
3:09.40 111 | .intersperse(quote!(|));
3:09.40 | ^^^^^^^^^^^ multiple intersperse found
3:09.40 |
3:09.40 = note: candidate #1 is defined in an impl of the trait Iterator for the type Map<I, F>
3:09.40 = note: candidate #2 is defined in an impl of the trait Itertools for the type T
3:09.40 help: disambiguate the associated function for candidate #1
3:09.40 |
3:09.40 107 ~ let tags = Iterator::intersperse(field
3:09.40 108 + .tags()
3:09.40 109 + .into_iter()
3:09.40 110 + .map(|tag| quote!(#tag)), {
3:09.40 111 + let mut _s = $crate::__private::TokenStream::new();
3:09.40 112 + $crate::quote_each_token!(_s $($tt));
3:09.40 ...
3:09.40 help: disambiguate the associated function for candidate #2
3:09.40 |
3:09.40 107 ~ let tags = Itertools::intersperse(field
3:09.40 108 + .tags()
3:09.40 109 + .into_iter()
3:09.40 110 + .map(|tag| quote!(#tag)), {
3:09.40 111 + let mut _s = $crate::__private::TokenStream::new();
3:09.40 112 + $crate::quote_each_token!(_s $($tt)
);
3:09.40 ...
3:09.48 warning: unused import: itertools::Itertools
3:09.48 --> /var/tmp/portage/www-client/firefox-91.1.0/work/firefox-91.1.0/third_party/rust/prost-derive/src/lib.rs:11:5
3:09.48 |
3:09.48 11 | use itertools::Itertools;
3:09.48 | ^^^^^^^^^^^^^^^^^^^^
3:09.48 |
3:09.48 = note: #[warn(unused_imports)] on by default
3:09.48 For more information about this error, try rustc --explain E0034.
3:09.49 warning: prost-derive (lib) generated 1 warning
3:09.49 error: could not compile prost-derive due to previous error; 1 warning emitted

compressed log is attached

Priority: -- → P3

packed_simd_2 0.3.6 is out as of Sept 9th, which will make that update easier, good find tt.
I'll keep an eye on that prost issue.

We're not using packed_simd_2, we're using a fork. And the upstream change will break building with older versions.

Assignee: nobody → mh+mozilla

Our copy of mio is already self-vendored, so we don't need a Cargo.toml
change to be able to apply in-tree changes.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/7ade904df34a
Remove unnecessary semi-colons in some macros. r=emilio
https://hg.mozilla.org/integration/autoland/rev/1f96f89c6fc8
Apply prost-derive fix for function name collision. r=emilio
https://hg.mozilla.org/integration/autoland/rev/0a7c0bdb2c19
Fix unstable-name-collisions in mio. r=emilio
https://hg.mozilla.org/integration/autoland/rev/9af854b99136
Update packed_simd to a version that supports rustc >= 1.56. r=hsivonen

Backed out changeset 9af854b99136 (Bug 1730397) as requested by the dev for causing SM bustages.
Backout link
Push with failures
Failure Log

Flags: needinfo?(mh+mozilla)
Keywords: leave-open

We'll need a more fine-grained test in packed_simd.

Flags: needinfo?(mh+mozilla)
Depends on: 1730851
Keywords: leave-open

Looks like a new release of prost is out that fixes the issue - though, it may introduce new ones until 0.9 is out.

Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/74e579530088
Update packed_simd to a version that supports rustc >= 1.56. r=hsivonen

Backed out as requested by Glandium.

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(mh+mozilla)
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/ad06d68fed2c
Update packed_simd to a version that supports rustc >= 1.56. r=hsivonen
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

since this seems to stick, can I ask here for the backports to the esr91 branch?

Comment on attachment 9241059 [details]
Bug 1730397 - Apply prost-derive fix for function name collision.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Build failure with rust 1.56.
  • User impact if declined: See above
  • Fix Landed on Version: 94
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Trivial rust fixes. We don't need all the patches for a default build, though. The remaining ones only matter for --enable-warnings-as-errors, which we recommend not using.
  • String or UUID changes made by this patch:
Attachment #9241059 - Flags: approval-mozilla-esr91?
Attachment #9241223 - Flags: approval-mozilla-esr91?

Comment on attachment 9241059 [details]
Bug 1730397 - Apply prost-derive fix for function name collision.

Approved for 91.2esr.

Attachment #9241059 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
Attachment #9241223 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+

thanks, can confirm working compile with rustc-1.56-beta3

there will be no backport to 93.0, no?

Rust 1.56 is due to release after Firefox 93, so I figured it's not worth. Firefox 94 will be out just a few weeks after rust 1.56.

Blocks: 1736459
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: