Make `mach mach completion <command>` use the right Python
Categories
(Firefox Build System :: Mach Core, defect, P1)
Tracking
(firefox-esr68 unaffected, firefox75 unaffected, firefox76 wontfix, firefox77 fixed)
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox75 | --- | unaffected |
firefox76 | --- | wontfix |
firefox77 | --- | fixed |
People
(Reporter: kmag, Assigned: ahal)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(3 files, 1 obsolete file)
+++ This bug was initially created as a clone of Bug #1577501 +++
Reporter | ||
Comment 1•5 years ago
|
||
Comment 2•5 years ago
|
||
This is super annoying as it causes tab-completion to munge my existing input.
Pushed by maglione.k@gmail.com: https://hg.mozilla.org/integration/autoland/rev/311a7c41e9da Make sure ./mach mach-completion <command> uses the correct Python. r=ahal
Assignee | ||
Comment 5•4 years ago
|
||
This solves an edge case where tab completing a Python 2 command with global
arguments was using the wrong Python version.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 6•4 years ago
|
||
bugherder |
Comment 7•4 years ago
|
||
Looks like this regressed again in the last few days. Rough regression range: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=1d96f4423d16&tochange=6c6c67870c37
Assignee | ||
Comment 9•4 years ago
|
||
Sure I'll try and get it landed soon, though looks like Matt isn't hitting the edge case, this is broken for everything. Running python2 mach mach-completion task
results in this traceback:
AttributeError: 'functools.partial' object has no attribute '__name__'
File "/home/ahal/dev/mozilla-central/python/mach/mach/commands/commandinfo.py", line 62, in completion
all_commands = sorted(self.command_keys)
File "/home/ahal/dev/mozilla-central/python/mach/mach/commands/commandinfo.py", line 26, in <genexpr>
if not v.conditions or v.conditions[0].__name__ != 'REMOVED')
So looks like a regression from https://phabricator.services.mozilla.com/D67342.
Tarek, did you have a WIP somewhere to stop using functools
in the conditions function? Though we probably shouldn't be relying on conditions[0].__name__
in commandinfo.py anyway.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 10•4 years ago
|
||
Yeah nvm, I'll just fix this here. Have a working patch, will attempt to add a test as well.
Comment 11•4 years ago
|
||
Ah ok, thanks, I did add Bug 1626942 if you want to close it after you're done
Assignee | ||
Comment 12•4 years ago
|
||
Not all callables have a name attribute.
Assignee | ||
Comment 13•4 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #8)
Andrew, can you update the second patch and land it?
Unfortunately I still don't see a good way of implementing your comment, see my reply for more details. It's very possible I'm missing something obvious, but it's been taking up more time than I have to spend.
Comment 14•4 years ago
|
||
This solves an edge case where tab completing a Python 2 command with global
arguments was using the wrong Python version.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Pushed by ahalberstadt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/84c16bc42776 [mach] Fix regression to mach command completion, r=glandium
Comment 16•4 years ago
|
||
bugherder |
Comment 17•4 years ago
|
||
Pushed by mh@glandium.org: https://hg.mozilla.org/integration/autoland/rev/ef38e7c833c7 Fix `mach mach-completion mach -flag <command>` for python 2 commands. r=ahal
Comment 18•4 years ago
|
||
bugherder |
Comment 19•4 years ago
|
||
Should this bug be resolved now or was this still just a temporary solution?
Assignee | ||
Comment 20•4 years ago
|
||
Thanks, everything should be fixed now.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•