Closed Bug 1719674 Opened 3 years ago Closed 3 years ago

firefox-90.0_rc1 fails to compile with rust-1.54 (esr also affected)

Categories

(Firefox Build System :: General, defect)

Firefox 90
defect

Tracking

(firefox-esr78 fixed, firefox90 wontfix, firefox91 fixed, firefox92 fixed)

RESOLVED FIXED
92 Branch
Tracking Status
firefox-esr78 --- fixed
firefox90 --- wontfix
firefox91 --- fixed
firefox92 --- fixed

People

(Reporter: herrtimson, Assigned: hsivonen)

Details

Attachments

(4 files, 1 obsolete file)

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.54-beta2 for testing and tried to compile firefox with it on a linux amd64 box. It didn't went well.

Actual results:

the compile failed with these errors:

4:06.18 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:43:7
4:06.18 |
4:06.18 43 | #[rustc_args_required_const(2)]
4:06.18 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.18 error: attributes starting with rustc are reserved for use by the rustc compiler
4:06.18 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:37:7
4:06.18 |
4:06.18 37 | #[rustc_args_required_const(2)]
4:06.18 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.18 error: attributes starting with rustc are reserved for use by the rustc compiler
4:06.18 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:31:7
4:06.18 |
4:06.18 31 | #[rustc_args_required_const(2)]
4:06.18 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.19 error: attributes starting with rustc are reserved for use by the rustc compiler
4:06.19 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:25:7
4:06.19 |
4:06.19 25 | #[rustc_args_required_const(2)]
4:06.19 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.19 error: attributes starting with rustc are reserved for use by the rustc compiler
4:06.19 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:19:7
4:06.19 |
4:06.19 19 | #[rustc_args_required_const(2)]
4:06.19 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.19 error: attributes starting with rustc are reserved for use by the rustc compiler
4:06.19 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:13:7
4:06.19 |
4:06.19 13 | #[rustc_args_required_const(2)]
4:06.19 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.33 error: cannot find attribute rustc_args_required_const in this scope
4:06.33 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:43:7
4:06.33 |
4:06.33 43 | #[rustc_args_required_const(2)]
4:06.33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.33 error: cannot find attribute rustc_args_required_const in this scope
4:06.33 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:37:7
4:06.33 |
4:06.33 37 | #[rustc_args_required_const(2)]
4:06.33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.33 error: cannot find attribute rustc_args_required_const in this scope
4:06.33 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:31:7
4:06.33 |
4:06.33 31 | #[rustc_args_required_const(2)]
4:06.33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.33 error: cannot find attribute rustc_args_required_const in this scope
4:06.33 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:25:7
4:06.33 |
4:06.33 25 | #[rustc_args_required_const(2)]
4:06.33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.34 error: cannot find attribute rustc_args_required_const in this scope
4:06.34 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:19:7
4:06.34 |
4:06.34 19 | #[rustc_args_required_const(2)]
4:06.34 | ^^^^^^^^^^^^^^^^^^^^^^^^^
4:06.34 error: cannot find attribute rustc_args_required_const in this scope
4:06.34 --> /var/tmp/portage/www-client/firefox-90.0_rc1/work/firefox-90.0/third_party/rust/packed_simd/src/codegen/llvm.rs:13:7
4:06.34 |
4:06.34 13 | #[rustc_args_required_const(2)]
4:06.34 | ^^^^^^^^^^^^^^^^^^^^^^^^^

this happens, since in rust-1.54 rustc_args_required_const was removed, the corresponding bug/pullrequest is: https://github.com/rust-lang/rust/pull/85110

so even though this is a beta version, my assumption is that this is not a bug in rust itself.

firefox-esr branch is also affected, and I guess nightly should also be affected since llvm.rs hasn't been touched recently, but I haven't tested that yet to confirm it safely.

the full build log is attached, grep for rustc_args_required_const

Expected results:

compile should have passed

Attached file build.log.gz

compressed build log is attached now

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
Flags: needinfo?(hsivonen)

thanks for the quick answer - I tried to pull in the patch locally, but ran into problems with checksums when compiling. If you happen to know how to properly pull the patch in, and are either able to teach me how or attach a working split patch, I'm happy to test it.

Aside: I have ported encoding_rs to core_simd and am currently in the process of validating its performance relative to packed_simd, but since core_simd is not available on crates.io, it would in some ways be nicer to wait until core::simd is available in the standard library behind a feature gate.

Assignee: nobody → hsivonen
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(hsivonen)

Current nightly Rust suffers from https://github.com/rust-lang/rust/issues/86893 . To test nightly, go back to 2021-07-01.

(In reply to Henri Sivonen (:hsivonen) from comment #5)

Aside: I have ported encoding_rs to core_simd and am currently in the process of validating its performance relative to packed_simd, but since core_simd is not available on crates.io, it would in some ways be nicer to wait until core::simd is available in the standard library behind a feature gate.

Filed bug 1719896 for this.

Can't backport this to ESR within the bounds of the currently-documented MSRV for ESR.

Attached patch ESR backport (obsolete) — Splinter Review

I'm providing the ESR backport as a courtesy to people who wish to build ESR with Rust 1.54, but I don't expect us to take this patch into the ESR repo, since it would change the MSRV for ESR.

asan-fuzzing fails but I fail to see the relation to packed_simd:
https://treeherder.mozilla.org/logviewer?job_id=344811470&repo=try&lineNumber=76012

Attached patch 90 backportSplinter Review

MSRV isn't an issue in the case of 90, but, AFAICT, it wouldn't be within our other policies to take this to 90 at this point, so I'm providing this patch as a courtesy to people who wish to build Firefox 90 with Rust 1.54.

Cherry-pick upstream commits
https://github.com/rust-lang/packed_simd/commit/58ba720df859b8d8a4c685a7984266e6f237b75e
https://github.com/rust-lang/packed_simd/commit/728d47506fe3a2599818060bd6e02e4bd3e338d5
to update the shuffle API for const generics and to remove the unnecessary const_fn
feature gate.

Also, conditionally restore old-style shuffles in order to maintain the MSRV for ESR.

Attachment #9230521 - Attachment is obsolete: true

I've posted different patches for ESR and central. Only esr78 needs the MSRV-lowering conditional tweak. It's not needed for central and the upcoming esr91 and I don't want to have to revert it on esr91 or central if it causes future cherry-picks not to apply in the future.

Pushed by hsivonen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f597999c46c0
Make packed_simd compile with Rust 1.54. r=glandium
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch

Comment on attachment 9230517 [details]
Bug 1719674 - Make packed_simd compile with Rust 1.54.

Beta/Release Uplift Approval Request

  • User impact if declined: No impact to users who get their Firefox builds from Mozilla. This patch allows more flexibility in terms of upgrading Rust for others who compile Firefox.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This patch changes how a thing is communicated to the compiler while keeping everything else as-is and the result is known to compile.
  • String changes made/needed: None
Attachment #9230517 - Flags: approval-mozilla-beta?

Comment on attachment 9230680 [details]
Bug 1719674 - ESR version - Make packed_simd compile with Rust 1.54.

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Allows more Rust update flexibility for people who compile Firefox from source, including distro maintainers.
  • User impact if declined: No impact for users who get their builds from Mozilla. This change adds flexibility for others who compile Firefox.
  • Fix Landed on Version: 92
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This patch changes how a thing is communicated to the compiler while keeping everything else as-is and the result is known to compile.
  • String or UUID changes made by this patch: None
Attachment #9230680 - Flags: approval-mozilla-esr78?

Comment on attachment 9230517 [details]
Bug 1719674 - Make packed_simd compile with Rust 1.54.

Low risk in early betas, approved for uplift in 91 beta 4, thanks

Attachment #9230517 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9230680 [details]
Bug 1719674 - ESR version - Make packed_simd compile with Rust 1.54.

approved for 78.13esr

Attachment #9230680 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: