Don't assume "uninstall" means "install"

UNCONFIRMED
Unassigned

Status

UNCONFIRMED
2 years ago
8 months ago

People

(Reporter: pep, Unassigned)

Tracking

Trunk

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170122162409

Steps to reproduce:

`./mach uninstall`


Actual results:

"We're assuming the 'uninstall' command is 'install' and we're executing it for you." happened.


Expected results:

An error telling me uninstall doesn't exist, or actually uninstalling files.

I understand "guessing" feature can be handy, but there are probably commands you don't want to run this way.
Comment hidden (mozreview-request)
This patch explicitly prevents "uninstall" from looking up suggested alternatives. Maybe this should be a list of banned unknown commands?

If you accidentally type `mach uinstall`, it'll still suggest and auto-run `install`, which may or may not be desirable.
Thoughts?
Assignee: nobody → wkocher
Duplicate of this bug: 1247597

Comment 4

a year ago
mozreview-review
Comment on attachment 8909063 [details]
Bug 1335620 - Don't assume "uninstall" means "install"

https://reviewboard.mozilla.org/r/180666/#review186162

It is a layering violation for mach's dispatch layer to know about the existence of any custom commands. This code is generic and is used by projects like Servo as well. We can't make assumptions about desired behavior.

The proper solution is to somehow declare which commands cannot match other similarly named commands. This could be an argument to @Command decorators. This could be a data structure that is somehow loaded into the mach driver (probably in mach_bootstrap.py). Either way, specific command names shouldn't be added to python/mach/.
Attachment #8909063 - Flags: review?(gps) → review-
Assignee: kwierso → nobody

Updated

8 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.