Closed Bug 1666585 Opened 4 years ago Closed 4 years ago

|mach bootstrap| unable to identify rustc.EXE on Windows

Categories

(Firefox Build System :: Mach Core, defect)

defect

Tracking

(firefox-esr78 unaffected, firefox81 unaffected, firefox82 fixed, firefox83 fixed)

RESOLVED FIXED
83 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox81 --- unaffected
firefox82 --- fixed
firefox83 --- fixed

People

(Reporter: mhentges, Assigned: mhentges)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

To reproduce:

  1. Use Windows
  2. ./mach bootstrap, choose "Firefox for Desktop"
...
ERROR! Unable to identify rustc.EXE version.
ERROR! Unable to identify rustup.EXE version.

We found an executable called `rustup` which we normally use to install
and upgrade Rust programming language support, but we didn't understand
its output. It may be an old version, or not be the installer from
https://rustup.rs/

Please move it out of the way and run the bootstrap script again.
Or if you prefer and know how, use the current rustup to install
a compatible version of the Rust programming language yourself.
Regressed by: 1663748
Has Regression Range: --- → yes

Does this patch fix it? When I've seen this error (it's sporadic and I was never able to repro consistently), this fixed it:

diff --git a/python/mozboot/mozboot/base.py b/python/mozboot/mozboot/base.py
index 730f40ca5b68..8bd3ab33c3a9 100644
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -654,7 +654,7 @@ class BaseBootstrapper(object):
             print('Could not find a Rust compiler.')
             return False, None
 
-        our = self._parse_version(rustc)
+        our = self._parse_version(rustc, 'rustc')
         if not our:
             return False, None
 
@@ -708,7 +708,7 @@ class BaseBootstrapper(object):
 
         rustup = which('rustup', extra_search_dirs=[cargo_bin])
         if rustup:
-            rustup_version = self._parse_version(rustup)
+            rustup_version = self._parse_version(rustup, 'rustup')
             if not rustup_version:
                 print(RUSTUP_OLD)
                 sys.exit(1)

If so we should just make the change finally.

Flags: needinfo?(mhentges)

That solution works, but the root cause is because this isn't case-insensitive.
Should we make that line instead be:

if name.lower().endswith('.exe'):

?

Flags: needinfo?(mhentges) → needinfo?(rstewart)

👍, ship it

Flags: needinfo?(rstewart)

Windows handles files in a case-insensitive way. So, when checking if a
file matches a certain extension, that check needs to be
case-insensitive as well.

Assignee: nobody → mhentges
Status: NEW → ASSIGNED
Attachment #9177225 - Attachment is obsolete: true

Snuck my patch in just in time 😉
Thanks for attaching this to mach-busted :aklotz :)

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e21a40705f5d
bootstrap version parsing supports case insensitive fs r=firefox-build-system-reviewers,rstewart
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch

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

Whiteboard: [checkin-needed-beta]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: