Closed Bug 1656403 Opened 4 years ago Closed 4 years ago

configure should reject rust nightlies that have the "right" version

Categories

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

defect

Tracking

(firefox-esr68 unaffected, firefox-esr78 unaffected, firefox79 unaffected, firefox80 wontfix, firefox81 fixed)

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- unaffected
firefox80 --- wontfix
firefox81 --- fixed

People

(Reporter: daoshengmu, Assigned: mhentges)

References

(Regression)

Details

(Keywords: in-triage, regression)

Attachments

(3 files)

Building GeckoView failed, when building m-c changeset c34351a5fd6c6bfb76ffd7b86b8757d6d95b581c on Mac OS

error[E0658]: use of unstable library feature 'assoc_int_consts': recently added
 0:26.65    --> /gecko-dev/third_party/rust/cranelift-codegen/src/isa/aarch64/lower.rs:325:36
 0:26.65     |
 0:26.65 325 |                 if shiftee_bits <= u8::MAX as usize {
 0:26.65     |                                    ^^^^^^^
 0:26.65     |
 0:26.66     = note: see issue #68490 <https://github.com/rust-lang/rust/issues/68490> for more information
 0:26.66     = help: add `#![feature(assoc_int_consts)]` to the crate attributes to enable
Component: General → Javascript: WebAssembly
Product: Firefox Build System → Core
Regressed by: 1653502
Has Regression Range: --- → yes

That said... u8::MAX is supposed to be stable as of 1.43, and 1.43 is required to build Firefox 80+, so... how exactly are you getting this error?

Are you using a rustc nightly from the 1.43 era, but pre-dating the stabilization?

Sorry about this! I caught this post-hoc over on the Cranelift side and fixed it up (u8::MAX -> std::u8::MAX), as another user also tripped over it:

https://github.com/bytecodealliance/wasmtime/pull/2047

So, the next re-vendoring of Cranelift should pick up this fix; I can do a dedicated patch on this bug for that, though we re-vendor fairly regularly and the next update will probably happen within a week.

(In reply to Mike Hommey [:glandium] from comment #1)

That said... u8::MAX is supposed to be stable as of 1.43, and 1.43 is required to build Firefox 80+, so... how exactly are you getting this error?

Are you using a rustc nightly from the 1.43 era, but pre-dating the stabilization?

I am using rustc 1.43.0-nightly (18c275b42 2020-03-02).

There you go. We should avoid this at the root, rejecting nightlies that have the right version but are not stable. You'd still be able to use a nightly, but it would have be at least the first one from the following cycle (which, when configure wants 1.43, as it does now, would be 1.44).

Component: Javascript: WebAssembly → General
Product: Core → Firefox Build System
Summary: error[E0658]: use of unstable library feature 'assoc_int_consts': recently added → configure should reject rust nightlies that have the "right" version

Set release status flags based on info from the regressing bug 1653502

Severity: -- → S3
Keywords: in-triage
Priority: -- → P3
Assignee: nobody → mhentges
Status: NEW → ASSIGNED

We have a minimum rust version required for compilations. For both stable and beta rust compilers, we can trust that they will have all the stabilized features we're expecting.

However, for nightlies, they may "match" our minimum version, but may have been released in the version window before a certain feature we need has been stabilized.

So, when validating rustc version in configure, ensure that the nightly is at least one version newer than our expected version.

We have version boundaries around enabling OOM hooking for gkrust-shared. Due to the nature of nightlies, those released on the edge of these boundaries make it difficult to tell whether or not they have the API we're expecting.
To resolve this, gkrust-shared now enables OOM hooking for nightlies on these boundaries, but prints a build warning accordingly.

The Firefox build requires features of Rust 1.43. However, a given Rust 1.43 nightly might be missing components that exist in the stable release.

By bumping the nightly version in the toolchain to 1.44 (first released on March 18), we ensure that we won't run into an unexpected missing feature.

Depends on D87650

Attachment #9169734 - Attachment description: Bug 1656403: configure rejects potentially-out-of-date nightlies → Bug 1656403: Configure should reject potentially-out-of-date nightlies

While digging into this issue, I uncovered some other details which left us with the following list of notes:

  1. configure requires the rust version to be >= 1.43. Technically, nightly-1.43 < stable-1.43, so configure shouldn't silently accept such nightlies.
  2. gkrust-shared requires the rust version to be >= 1.28 and < 1.44 to enable OOM hooking, and also requires OOM hooking to be enabled in automation.
  3. The rust nightly currently provided by our CI toolchain is 1.43.

The configure and gkrust-shared requirements will conflict if they're both applied strictly, so I opted for the following solution:

  1. Rather than silently accepting potentially-too-old nightlies, configure will now fail if a nightly-1.43 is provided.
  2. Our CI toolchain rust nightly is now the first possible nightly-1.44
  3. gkrust-shared now eagerly enables OOM hooking when potentially-incompatible nightlies are provided. To avoid surprises, a warning is printed if a potentially-incompatible nightly is in use.

I think this solution is sufficient, though it feels inconsistent that configure strictly checks the rust version, while gkrust-shared is more fuzzy and warning-heavy. My reasoning is that configure warnings are easy to miss among the verbosity, but rust compiler warnings are a little more loud an noticeable.
However, if we'd prefer that configure is also fuzzy and warning-heavy, let me know.

Attachment #9171035 - Attachment description: Bug 1656403: gkrust-shared should attempt to enable OOM hook for 1.28 and 1.44 nightlies → Bug 1656403: bump maximum gkrust-shared rust version to 1.47
Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/169abf6f4f65
bump maximum gkrust-shared rust version to 1.47 r=glandium
https://hg.mozilla.org/integration/autoland/rev/470f5653793e
Bump rust nightly toolchain version to 1.44 r=glandium
https://hg.mozilla.org/integration/autoland/rev/1e0fdb58ab95
Configure should reject potentially-out-of-date nightlies r=firefox-build-system-reviewers,froydnj
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: