Граф коммитов

163 Коммитов

Автор SHA1 Сообщение Дата
Connor Sheehan 1e603661c4 Bug 1506759: remove `try-except` block which swallows `OSError` r=ted
We have a few bugs filed as intermittent failures all relating
to an `AssertionError` on the return value of this block, which
seems to have a relevant value when `OSError` is thrown. Removing
this will not fix the problem but will at least let us see the
true cause of the failure for debugging and stabilization.

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

--HG--
extra : moz-landing-system : lando
2018-11-14 16:33:22 +00:00
Ted Mielczarek 54b3bbd1ce bug 1505205 - don't write telemetry for recursive mach command invocations. r=firefox-build-system-reviewers,chmanchester
This change tries to ensure that we don't write telemetry data for mach
commands invoked recursively as part of other mach commands. The intent of
build system telemetry is to only collect data about commands that users are
invoking directly.

There are two ways that we found mach commands can be recursively invoked:
* By running a python subprocess to recursively invoke mach (used in
  `mach bootstrap` to call `mach artifact toolchain`)
* By using `Registrar.dispatch` to delegate to a sub-command (used by many
  build system commands to invoke `mach build`).

The subprocess case is handled here by having mach set a `MACH_MAIN_PID`
environment variable whose value is the current process' pid on startup if it
does not already exist in the environment. Telemetry code then checks that the
value of that variable matches the current pid and skips writing telemetry data
if not.

The dispatch case is handled by making `MachRegistrar` store the current depth
of the command stack and pass it to the `post_dispatch_handler` which will skip
writing telemetry data if depth != 1.

Additionally the `should_skip_dispatch` function in mach_bootstrap is renamed
to `should_skip_telemetry_submission`, which was its original intent. The
combination of checks added in this change should be sufficient for deciding
when to write telemetry data, and we were not collecting telemetry for the set
of mach commands in that function (which included `mach bootstrap`).

In order to facilitate writing a test for the dispatch case this change adds a
`mach python --exec-file` option to execute Python code directly in the context
of the `mach python` command.

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

--HG--
extra : moz-landing-system : lando
2018-11-10 19:04:30 +00:00
Ted Mielczarek e85df1cdc8 bug 1505325 - fix build telemetry path filtering when cwd is outside of topsrcdir/objdir. r=firefox-build-system-reviewers,chmanchester
The build telemetry code attempts to filter paths to avoid PII from usernames
and other things. It does this by converting every commandline argument to
an absolute path and then making them relative to topsrcdir or topobjdir and
omitting any that fail. This meant that running a mach command with a cwd
outside of the topsrcdir or objdir would omit all arguments since they were
converted to absolute paths from the cwd.

This change fixes this by adding the cwd to the list of paths used to create
relative paths. Additionally we add the user's home directory to that list
to try to avoid usernames sneaking through. Finally, instead of simply
removing these path prefixes, we replace them with sigils: $topsrcdir,
$objdir, $HOME.

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

--HG--
extra : moz-landing-system : lando
2018-11-10 19:14:44 +00:00
Ted Mielczarek 8e018fdef0 bug 1505325 - add a basic test for build telemetry. r=firefox-build-system-reviewers,chmanchester
This change adds python/mach/mach/test/test_telemetry.py which contains
a simple test that running mach with the build telemetry setting enabled
causes us to write a telemetry file. The test fixture in the file should
make it easy to write additional tests.

A necessary precursor to make the tests work was to change mach_bootstrap's
`should_skip_dispatch` function, which would refuse to write telemetry data
if stdout was not a terminal (which it isn't in the tests) and also in
automation. The latter test is moved to ensure that we don't *submit*
telemetry data from automation, but we can still write it to disk. Machines
in automation should never have the telemetry setting enabled outside of
these tests anyway, so this should not change anything in practice.

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

--HG--
extra : moz-landing-system : lando
2018-11-10 19:04:05 +00:00
Edwin Gao 9ffeff17f0 Bug 1504550 - error running ./mach wpt --debugger rr --headless --no-manifest-update r=gbrown
Changes:
- under a specific code path such as:
`./mach <test_type> --debugger`
there exists now additional checks for IndexError when attempting to parse the debugger program name.
- print a nicer error message if user failed to properly specify the debugger program name.
- raise exit code of 1 if IndexError is raised.

Others:
- code comments updated to better reflect/describe what the section does.

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

--HG--
extra : moz-landing-system : lando
2018-11-07 12:47:34 +00:00
Chris Manchester 9b3b733a84 Bug 1497638 - Gather telemetry for mach commands other than build. r=ted,firefox-build-system-reviewers,nalexander
Differential Revision: https://phabricator.services.mozilla.com/D10177

--HG--
extra : moz-landing-system : lando
2018-10-31 20:03:56 +00:00
Edwin Gao 4c107f8236 Bug 1291335 - Check mozconfig for --disable-tests when running mach test commands r=gbrown
Behavior changes:

- instead of reading the mozconfig file, it now instantiates an instance of the build object.
- safe checking methods are used to access attributes to prevent errors on automation environment.
- better mach command parsing is performed with handler category instead of error-prone argv parsing.


Other changes:

- docstring for testing/xpcshell/runxpcshelltests.py::buildTestList() added and modernized.
- added clause that if length of tests gathered is 0, mach exits with an error code of 1.

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

--HG--
extra : moz-landing-system : lando
2018-10-03 15:40:48 +00:00
Jay Kamat 245ac54f65 Bug 1493345 Fix improper usage of blessings.tigetstr r=ted,firefox-build-system-reviewers
blessings.tigetstr is not part of its API. It happens to work because
blessings imports curses using 'from curses import tigetstr'.

Instead, we can just use terminal.normal, which contains the string we were
going to get anyway.

See https://github.com/erikrose/blessings/pull/138 for more information.

Let me know if there's a better way of resolving this. Hopefully with this +
the patch I submitted to blessings (https://github.com/erikrose/blessings/pull/137)
firefox will build fine with TERM improperly set.

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

--HG--
extra : moz-landing-system : lando
2018-10-02 18:36:30 +00:00
Edwin Gao d7986ad99a Bug 1305695 - ./mach test --debugger=<debugger> doesn't fail if <debugger> isn't available r=gbrown
- added checkers in python/mach/mach/main.py prior to calling registrar.py.
- added internal function to check if specified debugger is installed.
- support both ./mach test <test_name> and ./mach <test_category> styles.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 22:06:54 +00:00
shindli 6ba91671cb Backed out changeset 05df95ba3a98 (bug 1305695) for ES lint failures CLOSED TREE 2018-10-02 00:00:23 +03:00
Edwin Gao 63180f5b60 Bug 1305695 - ./mach test --debugger=<debugger> doesn't fail if <debugger> isn't available r=gbrown
- added checkers in python/mach/mach/main.py prior to calling registrar.py.
- added internal function to check if specified debugger is installed.
- support both ./mach test <test_name> and ./mach <test_category> styles.

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

--HG--
extra : moz-landing-system : lando
2018-10-01 18:03:06 +00:00
Ted Mielczarek 3028fb8bdb bug 1237610 - don't call post_dispatch_handler when using debug-command. r=gps
MozReview-Commit-ID: 4UG6RH4b6tZ

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

--HG--
extra : rebase_source : a06ef350840b059b2ef9eaea8010085e41d5dd50
2018-05-16 12:56:39 -04:00
Chris Manchester 7edeeaa646 Bug 1475058 - Send SIGINT when interrupting interactive in mach before sending SIGKILL. r=mshal
MozReview-Commit-ID: 2XxLyNi1ZuS

--HG--
extra : rebase_source : d91eed728446219da6be78e310b1a12b597a0d99
2018-07-12 11:50:48 -07:00
Andrew Halberstadt 9435736ade Bug 1471620 - Skip python-tests locally that don't run with python 3 in CI r=davehunt
This will make sure that when running |mach python-test --python 3| locally,
we only run the tests that also run in CI with python 3 (and therefore pass
presumably).

MozReview-Commit-ID: 3OBr9yLSlSq

--HG--
extra : rebase_source : 456340d0ecdddf1078f2b5b4ebb1eddf3813b26a
2018-06-27 11:10:02 -04:00
Dave Hunt c65268bd7a Bug 1388013 - Support running |mach python-test| against Python 3 using pipenv; r=ahal
This patch allows executing |mach python-test| against Python 3 by specifying the optional |--three| command line option. When this option is present, pipenv will be used to manage a virtual environment using Python 3 and attempt to run the tests. When it is not present, pipenv will not be used, and everything will work as it did before this patch.

My original plan was to use pipenv regardless of the target version of Python, however I encountered several issues running some of the tests against our Python packages. Once all tests have been patched to run against Python 3, then we should be able to use pipenv when running them against Python 2.

Note that this patch allows tests to run against Python 3, but there are plenty of issues preventing them from passing. With this patch in place we can start to add Python 3 support to our packages and have the tests running in CI to ensure we don't regress back to just supporting Python 2.

MozReview-Commit-ID: BuU5gZK83hL


IHG: changed taskcluster/ci/source-test/python.yml

--HG--
extra : rebase_source : ca2b15d905f7a5c895a2fd8916144841f5d205de
2018-05-03 10:34:22 +01:00
Andreea Pavel dd5cd1d832 Backed out 3 changesets (bug 1388013) for build bustages e.g. ../python/mozbuild/mozpack/test/test_files.py on a CLOSED TREE
Backed out changeset eea857170a41 (bug 1388013)
Backed out changeset c55bfefbd4e1 (bug 1388013)
Backed out changeset 3a163da2b21b (bug 1388013)
2018-05-31 11:48:19 +03:00
Dave Hunt 18568a8c94 Bug 1388013 - Support running |mach python-test| against Python 3 using pipenv; r=ahal
This patch allows executing |mach python-test| against Python 3 by specifying the optional |--three| command line option. When this option is present, pipenv will be used to manage a virtual environment using Python 3 and attempt to run the tests. When it is not present, pipenv will not be used, and everything will work as it did before this patch.

My original plan was to use pipenv regardless of the target version of Python, however I encountered several issues running some of the tests against our Python packages. Once all tests have been patched to run against Python 3, then we should be able to use pipenv when running them against Python 2.

Note that this patch allows tests to run against Python 3, but there are plenty of issues preventing them from passing. With this patch in place we can start to add Python 3 support to our packages and have the tests running in CI to ensure we don't regress back to just supporting Python 2.

MozReview-Commit-ID: BuU5gZK83hL


IHG: changed taskcluster/ci/source-test/python.yml

--HG--
extra : rebase_source : e1a64c0ffa8fe5cce71a041579601d4a72e37779
2018-05-03 10:34:22 +01:00
Chris Manchester 3722bcaf82 Bug 1453426 - Kill invoked process on keyboard interrupt in mach build. r=mshal
MozReview-Commit-ID: IdnVrK6Gqtk

--HG--
extra : rebase_source : 2599a6c236b2c624d74f399ff3b5af3e7a574dc8
2018-04-17 15:30:27 -07:00
David Major 9b78fd3f22 Bug 1447750 - Point MACH_ERROR's URL at the new Bugzilla component r=nalexander 2018-03-21 11:09:00 +02:00
Tarek Ziadé 0081c14e07 Bug 1401879 - sort mach-commands output - r=gps
MozReview-Commit-ID: KgocEmTy4wR

--HG--
extra : rebase_source : 211c03cd533abd1325f6e671523fdd7b5ee8b824
2018-03-21 20:27:42 +01:00
Andrew Halberstadt f354075c7a Bug 1434430 - [flake8] Fix blank 'except' statements r=rwood
This is a new issue that gets linted with flake8 3.5.0. Basically you should
never use a blank except: statement.

This will catch all exceptions, including KeyboardInterrupt and SystemExit
(which is likely not intended). If a catch all is needed, use
`except: Exception`.  If you *really* mean to also catch KeyboardInterrupt et
al, use `except: BaseException`.

Of course, being specific is often better than a catch all.

MozReview-Commit-ID: FKx80MLO4RN

--HG--
extra : rebase_source : 7c74a7d0d81f2c984b47aff3a0ee3448b791177b
2018-01-31 14:32:08 -05:00
Gregory Szorc b3b7dfcfef Bug 1415614 - Add an API to log all structured messages; r=mshal
Currently, marking a logger as a structured logger will require a
subsequent function call in order for the logger to be hooked up
to active handlers. This behavior is not intuitive and makes it
easy to not have handlers for newly-registered loggers. This means
messages may not be logged anywhere.

In addition, we have to manually specify which named loggers to
enable structured logging for. This can be annoying.

We change the behavior of register_structured_logger() to
automatically add existing terminal and json handlers to the
logger being marked as structured.

We also introduce an API to enable structured logging for all
loggers. Existing consumers of registered_structured_logger()
in mozbuild have been updated to use this API. A new consumer
has been added for the `mach configure` command because it should
have been there before.

We stop short of making enable_all_structured_loggers() the default.
This is because various commands interact with the log manager in
ways that will result in duplicate logging of messages and
dropping of structured messages. There is a bit of a rabbit hole
here and addressing it can be done as a follow-up.

MozReview-Commit-ID: 1aU6eJvTSMP

--HG--
extra : rebase_source : 2a0a569b378cc3083b55fc7076b291abdfb7453f
2017-11-09 15:09:52 -08:00
Gregory Szorc 6c9c35a19d Bug 1415614 - Don't assign mach logger to instance variable; r=nalexander
We don't use this attribute outside of this function. Besides, you can
easily obtain a handle on the logger by calling
``logging.getLogger('mach')``.

MozReview-Commit-ID: 41vdn6McowW

--HG--
extra : rebase_source : dca383e5f5b770fa3adb09d753897633258302a1
2017-11-08 14:28:19 -08:00
Steve Armand d11ffd18db Bug 1399989 - Add python/mach to flake8 linter. r=gps
MozReview-Commit-ID: KKnBgYFwpfT

--HG--
extra : rebase_source : 4e4b3453a91970366dba0073853ad3ab62738c81
2017-09-17 22:41:17 -04:00
Andrew Halberstadt d3806e8077 Bug 1289444 - Forward extra arguments in |mach test| to the underlying test commands, r=chmanchester
MozReview-Commit-ID: 631K2n0wB1a

--HG--
extra : rebase_source : d5aa8c59e16e811915ff24100fd1fe7a49604304
2017-08-29 16:20:47 -04:00
Dustin J. Mitchell 53df6a181b Bug 1390968: python-3 compatibility for python/**/*.py; r=Alex_Gaynor,gps
This passes `python3 -mcompileall`.  Changes:

 * use `0o` prefix for octal literals
 * print as a function
 * except .. as
 * use six.reraise to replace a multi-argument raise statement
 * use six.string_types and six.moves.configparser
 * remove uses of `L` suffix for long integers

MozReview-Commit-ID: KLaYRNHGpay

--HG--
extra : rebase_source : 6ca1b5447cd28eff8d9f2805add6a0f07e8b4c63
2017-08-28 21:31:30 +00:00
Andrew Halberstadt 508e9aad6b Bug 1393590 - [mach] Use description field for settings instead of gettext locales, r=gps
This preserves ./mach settings' --list option. If --list is passed in, we call splitlines()
on the description and print only the first line. The full multi-line description will be
printed otherwise.

This also displays the type and/or choices of the option as appropriate.

MozReview-Commit-ID: 7UMsN9qslWt

--HG--
extra : rebase_source : 4bc9554d8652e02e290c6a190634f1a72cdbadc3
2017-08-24 16:17:40 -04:00
Andrew Halberstadt b8511feb50 Bug 1391675 - [mach] Allow commands to have both a parser and subcommands, r=gps
We currently raise if we detect a command has both the `parser` attribute and a subcommand
at the same time, but as far as I can tell, there's no good reason to do this. Handling a
parser + subcommands seems to work exactly how you would expect. Furthermore, it isn't an
error to have subcommands + @CommandArgument, so it doesn't make sense that we're allowing
one but not the other.

This change solves an (admittedly unique) use case I'm trying to build into |mach try|. There
are N subcommands that all support a --save and --load style argument. So, e.g, we might have:

./mach try syntax --save foo
./mach try fuzzy --save bar

The main command will have the ability to detect which subcommand a saved value was generated
from and automatically dispatch to it. So this will work:

./mach try --load foo  # dispatches to the syntax subcommand
./mach try --load bar  # dispatches to the fuzzy subcommand

In order to share the --save/--load arguments across the main command + subcommands, we need
to set the parser attribute.



MozReview-Commit-ID: KmXRj8TBvYK

--HG--
extra : rebase_source : cbf1e402a080913709a34430274ae3191821dd72
2017-08-17 11:10:48 -04:00
Gregory Szorc 3088419b32 Bug 1392886 - Explicit error type when a mach command file doesn't exist; r=mshal
This will facilitate handling this error condition specially.

Some unused imports were also removed.

MozReview-Commit-ID: 4zxVDgE7NxU

--HG--
extra : rebase_source : c4d0dd96629e028ce8a83215564a8d865e4b4b3d
2017-08-22 20:29:01 -07:00
Jonas Finnemann Jensen 25d89ec12e Bug 1387307 - Add FailedCommandError to mach r=gps
MozReview-Commit-ID: 8brtYHruEi4
***
Fix ups mach error

MozReview-Commit-ID: 5mqQNqZqLzc

--HG--
extra : rebase_source : 4fb587e8eb9441f2857c8960c8f6b9ce841c6e55
2017-08-08 12:10:10 -07:00
Brian Grinstead d22141a17f Bug 1172574 - Allow for setting prefs in mach run for scratch_user;r=gps
Prefs can be set with `./mach run --setpref foo=bar` or in the ~/.mozbuild/machrc file as:

  [runprefs]
  foo=bar

MozReview-Commit-ID: HO3tdFi9ffi

--HG--
extra : rebase_source : 3c2e6f33567448c19defafb656e6cb9f3a729391
2017-07-28 15:38:22 -07:00
Andrew Halberstadt 2f253251a9 Bug 1381802 - [mach] Allow subcommands to use the 'parser' argument, r=gps
This allows subcommands to use external argument parsers.

MozReview-Commit-ID: 7TkbTff0Tv8

--HG--
extra : rebase_source : a1c245efa7ac7b28b974534b4cd2727c96f9219d
2017-07-18 08:53:13 -04:00
Andrew Halberstadt f64710a364 Bug 1381802 - [mach] Ensure subcommand help is displayed whenever a subcommand and --help are specified, r=gps
After this patch, the following will all display the subcommand help where they previously displayed
the command help:

    $ mach help <command> <subcommand>
    $ mach <command> --help <subcommand>
    $ mach <command> <subcommand> --help

The command help will still be shown for:

    $ mach help <command>
    $ mach <command> --help

MozReview-Commit-ID: 7EsVblnCaFM

--HG--
extra : rebase_source : 2a1d289d56164366ce140fa653adec93f56be067
2017-07-18 08:42:41 -04:00
Michael Layzell fb7949544e Bug 1347290 - Set sgr0 to '' if blessings.tigetstr('sgr0') returns None, r=gps
MozReview-Commit-ID: vP4izM2RwP
2017-04-06 17:44:30 -07:00
Gregory Szorc 4174483eb1 Bug 1318044 - Issue sgr0 after printing every line; r=froydnj
The sgr0 terminal capabity defines the byte sequence needed to reset
terminal text to its default state. For reasons documented inline in
this commit, we now print this sequence after every line printed by
mach's terminal logger.

MozReview-Commit-ID: 3RukP0QXtqy

--HG--
extra : rebase_source : 5e4b7d001300ec1059b53423b310ac9fdd514c72
2016-12-12 10:23:02 -08:00
Andrew Halberstadt 6adcf5b456 Bug 1317970 - Use manifestparser manifests for python unit tests, r=chmanchester
This deprecates PYTHON_UNIT_TESTS and replaces it with PYTHON_UNITTEST_MANIFESTS.
In the build system, this means python unittests will be treated the same as all
other test suites that use manifestparser. New manifests called 'python.ini' have
been created for all test directories containing python unittests.

MozReview-Commit-ID: IBHG7Thif2D

--HG--
extra : rebase_source : 11a92a2bc544d067946bbd774975140147458caa
2016-11-16 09:59:22 -05:00
Gregory Szorc cc764ee794 Bug 1315785 - Set an environment variable when mach is attached to a TTY; r=glandium
The way it works now, `mach` commands often invoke subprocesses where
the subprocesses' stdio file descriptors are pipes so the mach command
can e.g. parse output.

Processes like clang, gcc, and cargo determine if they can send color
codes to {stderr, stdout} by seeing if those file descriptors are TTYs.
When e.g. `make` is executed via `mach`, this test fails because those
descriptors are pipes (even though they eventually end up on a TTY).

We can't wire the file descriptors to the TTY because `mach` needs
to analyze output. We don't want users defining process flags to force
color in their mozconfigs because color codes would still be sent
if stdout was not a TTY.

This patch sets the MACH_STDOUT_ISATTY environment variable in all mach
commands when stdout is a TTY. Subsequent processes can then look for
this variable to determine whether to override color settings, print
terminal control codes, etc.

MozReview-Commit-ID: GxXP2mQssjC

--HG--
extra : rebase_source : 4b99547b453cb7dd5cb590a71ed554ce2bc4759d
2016-11-08 12:15:13 -08:00
Gregory Szorc 0f12e2d300 Bug 1315785 - Restore environment variables after running command; r=glandium
Currently, environment variables set when running mach commands will
propagate after the command is finished. This can allow unwanted state
to bleed through.

This likely isn't an issue today, but isolating state during code
execution is generally a good practice. So do that.

MozReview-Commit-ID: AdaomGub5EF

--HG--
extra : rebase_source : ce81987a1f6de3a16bce6a9e45b9dc8e8eb29b4b
2016-11-08 12:15:07 -08:00
Andrew Halberstadt fae591ac2b Bug 1304593 - Fix broken test_entry_point.py in mach, r=gps
Fix and enable python/mach/mach/test/test_entry_poiny.py.

MozReview-Commit-ID: FtMpt8Nmq3g

--HG--
extra : rebase_source : 73755266b7d9570065c0ab18e0b50e074559914c
2016-09-27 17:11:00 -04:00
Nathan Hakkakzadeh cf3b86a327 Bug 1100925 - Mach now detects msys2. r=gps
Before, mach would only detect MINGW32 (used with msys). Now it also detects MINGW64 (used with msys2).

MozReview-Commit-ID: 6IrNNmkLKgB

--HG--
extra : rebase_source : e84ee16b5bbc1b6b113163ba5b61759f763645c1
2016-05-31 14:44:53 -07:00
Gregory Szorc cd0ac88627 NO BUG - Bump version of mach to 0.6
DONTBUILD (NPOTB)
2016-05-02 13:36:33 -07:00
Andrew Halberstadt e34562488e Bug 1255450 - mach settings documentation fix, DONTBUILD, r=me
MozReview-Commit-ID: AQ3w2oCPQeN

--HG--
extra : topic : bar
extra : rebase_source : 2e0de1688fca11bd62c88bd66ef9cf9ad97206f8
extra : amend_source : 45c025594d645a9252989c8f13387de05e49d4dd
2016-04-12 21:03:36 -04:00
Andrew Halberstadt 683014d78f Bug 1255450 - [mach] Create setting for defining command aliases, r=gps
These config options can be defined in ~/.mozbuild/machrc or topsrcdir/machrc.
Aliases work similar to the identically named option in an hgrc.

For example:

[alias]
browser-test = mochitest -f browser
mochitest = mochitest -f plain


MozReview-Commit-ID: CnOocEslRUI

--HG--
extra : rebase_source : 2a6fa154aca7fea8f159ed840728951a37bc52ec
2016-03-23 17:34:35 -04:00
Andrew Halberstadt fbc37fe116 Bug 1255450 - [mach] Enable runtime configuration files, r=gps
Runtime configs have been implemented for awhile, but disabled. This patch
enables configuration. Config files will be loaded in the following order
(later files override earlier ones):

1a. $MACHRC
1b. $MOZBUILD_STATE_PATH/machrc (if $MACHRC is unset)
2. topsrcdir/machrc
3. CLI via --settings

Note: .machrc may be used instead of machrc if desired.

MozReview-Commit-ID: IntONAZLGML

--HG--
extra : rebase_source : ff79b129eaea7cca5064d30fa6ddc76fceb9669b
2016-03-28 11:18:24 -04:00
Andrew Halberstadt e0018e5245 Bug 1255450 - [mach] Simplify managing of locale documentation for settings, r=gps
This adds a |mach settings locale-gen| subcommand to automatically generate locale
specific documentation for settings. It also refactors |mach settings-create| to
|mach settings| and moves |mach settings| to |mach settings -l|. Finally it performs
some misc cleanup mostly related to locales.

MozReview-Commit-ID: 1VWLcb9ehAH

--HG--
extra : rebase_source : 8f580217123d79e66323ca4be948a3297ae4ced3
2016-03-23 17:49:15 -04:00
Andrew Halberstadt c105e8a3b4 Bug 1255450 - [mach] Implement 'wildcard' settings for enabling sections with user-defined options, r=gps
Some sections should support user-defined options. For example, in an [alias] section, the option names
are not well-defined, rather specified by the user. This patch allows user-defined option names for any
section that has a 'section.*' option defined. Even with 'section.*', option types are still well-defined.

MozReview-Commit-ID: L34W9v9Fy28

--HG--
extra : rebase_source : 9333f552edead9bf1cf464e28ef8fbbb9bed5597
2016-03-28 10:52:16 -04:00
Andrew Halberstadt 5167efa8e4 Bug 1255450 - [mach] Replace ConfigProvider class with config_settings attribute, r=gps
Defining settings was a little complicated. First it required overriding a '_register_settings'
method, and then it required making N calls to a second 'register_setting' method within that.

This patch simplifies the process of defining settings by only requiring a
'config_settings' attribute. This attribute should be a list of tuples:

[
  ('<section>.<option>', '<type>', <default>, set(<choices)),
]

`default` and `choices` are optional. Alternatively, 'config_settings' can be a callable
that returns a list of tuples in the same format. This still allows for greater flexibility
for more advanced cases.

MozReview-Commit-ID: F4DTTNJdJsa

--HG--
extra : rebase_source : e3dd455ba559cd3992c9c1b3eaf021c9e0707cc1
2016-03-21 17:55:41 -04:00
Andrew Halberstadt 3098112a41 Bug 1262495 - [mach] Allow running root commands that have subcommands on their own, r=gps
For example, say there is a command 'foo' that has a subcommand 'bar'. Prior to this, it was not
possible to run:
./mach foo

as its own independent command. The above would instead print the subcommand help for 'bar'.

MozReview-Commit-ID: JU4dXoxnCyu

--HG--
extra : rebase_source : bb15532ad39456b270071bc60d7b15e15af04e48
2016-04-06 11:41:13 -04:00
Steve Fink 094469068b Bug 991343 - Suppress time output when running inside emacs, r=gps
Because I Care.

MozReview-Commit-ID: 9An5QwxnBpU

--HG--
extra : amend_source : 1c9f689d8aecb41debc0a657455c3c53ec219fa1
2016-03-11 16:51:24 -08:00
Andrew Halberstadt 7a0cb68d63 Bug 1255470 - [mach] don't raise if a subcommand exists and but wasn't found in args, r=gps
This is currently preventing a command from having both args and subcommands at the same
time.

MozReview-Commit-ID: 66frAqamGjv

--HG--
extra : rebase_source : 3bbd1cb508e5aab7ba7f9936c0c486ed8f626fe9
2016-03-10 11:51:43 -05:00