Closed Bug 1577908 Opened 5 years ago Closed 4 years ago

Re-enable mach's autocorrect + execute feature

Categories

(Firefox Build System :: Mach Core, defect, P3)

defect

Tracking

(firefox-esr78 wontfix, firefox87 wontfix, firefox88 wontfix, firefox89 wontfix, firefox90 fixed)

RESOLVED FIXED
90 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox87 --- wontfix
firefox88 --- wontfix
firefox89 --- wontfix
firefox90 --- fixed

People

(Reporter: ahal, Assigned: championshuttler)

References

(Blocks 3 open bugs, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

This is a side-effect of bug 1473498.

STR

$ ./mach mochitset
We're assuming the 'mochitset' command is 'mochitest' and we're executing it for you.

Error running mach:

    ['mochitset']

The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ModuleNotFoundError: No module named 'urllib2'

This happens because the driver doesn't find "mochitset" in the py2commands whitelist, so runs it with Python 3. Then mach's auto-correction feature kicks in and corrects "mochitset" to "mochitest", however running under the wrong Python.

I think the simplest solution here is to turn off auto-correction when we're under Python 2. We can still suggest the proper command name, but instead of running it, we exit. This is mildly inconvenient, but as commands are converted we'll start gaining this feature back.

(In reply to Andrew Halberstadt [:ahal] from comment #0)

I think the simplest solution here is to turn off auto-correction when we're under Python 2. We can still suggest the proper command name, but instead of running it, we exit. This is mildly inconvenient, but as commands are converted we'll start gaining this feature back.

Oops, got this backwards. It's Python 3 we'll want to not execute. And since all misspellings will run with Python 3, that means this feature will be disabled until the migration completes. Unless we can find a way to check the suggested command against the list in the mach driver...

The mach driver will now run all misspelled commands with Python 3. That means
we can't automatically execute the suggested command anymore, as it may need to
run against Python 2.

Ideally we could figure out a way to check the command against the 'mach'
whitelist, but until then, let's just disable automatic execution. Worst case
scenario we can turn it back on after the migration has finished.

Assignee: nobody → ahal
Status: NEW → ASSIGNED
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/df07b4127275 [mach] Disable suggested command execution until Python 3 migration is finished, r=glandium

Leaving this open to track either reading the whitelist from the mach driver and turning auto-fixing back on, or worst case turning it back on once we don't have a whitelist anymore.

Keywords: leave-open

I ran into such a problem when running ./mach clobber --help

You are likely hitting bug 1578198.

The priority flag is not set for this bug.
:kmoir, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(kmoir)
Flags: needinfo?(kmoir)
Priority: -- → P3
Assignee: ahal → nobody
Status: ASSIGNED → NEW
Summary: Mach driver runs misspelled commands with Python 3 and mach then corrects + executes it → Re-enable mach's autocorrect + execute feature
Severity: normal → S4

The leave-open keyword is there and there is no activity for 6 months.
:rstewart, maybe it's time to close this bug?

Flags: needinfo?(rstewart)

ahal ^

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

Yeah, I'd say this is still relevant. Not done the Python 2 migration yet, so nothing to be done quite yet.

Flags: needinfo?(ahal)

We can fix this now

Blocks: goodbye-py2

Used to be heavy user of this, need it back asap ;)

Assignee: nobody → shivams2799
Status: NEW → ASSIGNED
Pushed by shivams2799@gmail.com: https://hg.mozilla.org/integration/autoland/rev/d643898244c2 Re-enable mach's autocorrect/excution feature.r=glandium
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: