Open Bug 1335620 Opened 7 years ago Updated 2 years ago

Don't assume "uninstall" means "install"

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: pep, Unassigned)

References

Details

Attachments

(1 file)

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.
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
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
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: