Closed Bug 2053518 Opened 1 month ago Closed 1 month ago

Rust target detection fails to translate the host triple with rustc nightly >= 2026-07-02 (new *-oe-linux-* targets)

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect

Tracking

(firefox155 fixed)

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: truber, Assigned: truber)

References

Details

Attachments

(1 file)

Building Firefox with a Rust nightly toolchain from 2026-07-02 or later fails at configure time:

checking for rust host triplet...
ERROR: Don't know how to translate x86_64-pc-linux-gnu for rustc

This is a latent bug in detect_rustc_target() (build/moz.configure/rust.configure), triggered by rust-lang/rust#157650, which added OpenEmbedded/Yocto Linux targets to rustc --print target-list: x86_64-oe-linux-gnu, aarch64-oe-linux-gnu, i686-oe-linux-gnu, armv7-oe-linux-gnueabihf, and riscv64-oe-linux-gnu.

detect_rustc_target() correlates the autoconf host/target alias against rustc --print target-list. The new oe-vendor targets collide with the generic unknown-vendor targets after OS-based narrowing, and the final vendor tiebreaker only accepts an exact vendor == host.vendor match. The standard config.guess output for x86_64/i686 Linux uses vendor pc, which matches neither oe nor unknown, so detection falls through and calls die().

Impact of the new targets:

  • x86_64 / i686 hosts (vendor pc) fail configure outright.
  • riscv64 hosts would silently mis-select riscv64-oe-linux-gnu (whose raw_cpu is riscv64, matching the host, where the correct generic target is riscv64gc-unknown-linux-gnu).
  • armv7 hard-float Linux would pick armv7-oe-linux-gnueabihf in the arm-specific branch.

Fix: when disambiguating rust target candidates, prefer rust's generic unknown vendor. This restores the pre-regression behavior for pc hosts and keeps riscv64/armv7 selecting the generic target.

The severity field is not set for this bug.
:ahochheiden, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(ahochheiden)
Pushed by jdschwa@gmail.com: https://github.com/mozilla-firefox/firefox/commit/1ecaa12836a6 https://hg.mozilla.org/integration/autoland/rev/8df170d41a0b Handle the *-oe-linux-* rust targets added in rustc 1.98 in rust target detection. r=firefox-build-system-reviewers,glandium
Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
Flags: needinfo?(ahochheiden)

Hi, would it be possible to uplift this to 153esr?

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

Attachment

General

Created:
Updated:
Size: