gecko-dev/python/mach
Andrew Halberstadt 333ffc4bcf Bug 1473498 - [mach] Support running mach commands with python 3 r=glandium,mars
Credit: mars for making the shell POSIX compliant

This embeds a blacklist of every mach command that needs to run with Python 2
directly in the mach driver itself. Initially this is every mach command. We
then use a bit of shell to determine whether the command being run needs Python
2 or 3.

While this approach may seem a bit hacky, it has several benefits:

1. No need to add complex machinery in mach's registration code.
2. No need to spawn two separate Python interpreters in the event a different
   Python from the original interpreter is needed.
3. Perf impact is negligible.
4. New commands are Python 3 by default.

It is also only a temporary hack. Once all commands are running with Python 3,
we can revert back to the original mach driver.

Differential Revision: https://phabricator.services.mozilla.com/D36103

--HG--
extra : moz-landing-system : lando
2019-08-27 03:08:08 +00:00
..
docs Bug 1519968 - [mach] Minor improvements to autocomplete docs, r=jmaher 2019-01-14 19:43:53 +00:00
mach Bug 1473498 - [mach] Support running mach commands with python 3 r=glandium,mars 2019-08-27 03:08:08 +00:00
README.rst
bash-completion.sh Bug 1518586 - [mach] Implement bash completion for subcommands and arguments r=nalexander 2019-01-11 15:28:49 +00:00
setup.py Bug 1559975 - Make python/mach lint with 'py2' and 'py3' r=catlee 2019-07-05 14:24:58 +00:00

README.rst

====
mach
====

Mach (German for *do*) is a generic command dispatcher for the command
line.

To use mach, you install the mach core (a Python package), create an
executable *driver* script (named whatever you want), and write mach
commands. When the *driver* is executed, mach dispatches to the
requested command handler automatically.

To learn more, read the docs in ``docs/``.