Re-enable mach's autocorrect + execute feature
Categories
(Firefox Build System :: Mach Core, defect, P3)
Tracking
(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.
Reporter | ||
Comment 1•5 years ago
|
||
(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...
Reporter | ||
Comment 2•5 years ago
|
||
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.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Reporter | ||
Comment 4•5 years ago
|
||
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.
Comment 5•5 years ago
|
||
bugherder |
Comment 6•5 years ago
|
||
I ran into such a problem when running ./mach clobber --help
Reporter | ||
Comment 7•5 years ago
|
||
You are likely hitting bug 1578198.
Comment 8•5 years ago
|
||
The priority flag is not set for this bug.
:kmoir, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:rstewart, maybe it's time to close this bug?
Reporter | ||
Comment 11•4 years ago
|
||
Yeah, I'd say this is still relevant. Not done the Python 2 migration yet, so nothing to be done quite yet.
Assignee | ||
Comment 13•4 years ago
|
||
Used to be heavy user of this, need it back asap ;)
Assignee | ||
Comment 14•4 years ago
|
||
Depends on D110066
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Description
•