Wow, this one was fun to debug. I was attempting to write some Python
tests that wrap around mach.run and then validate the output (in order
to get rid of our cramtest framework). But I had an issue where any
tests that ran after an earlier test, would have the wrong arguments
set. It turns out that the earlier test hits a code path that calls into
Registrar.dispatch(). And this method is supposed to temporarily mutate
the defaults of the argument parser:
https://searchfox.org/mozilla-central/rev/0d0eef18ea91e38ddfb82a1ac5d6560a146da5c0/python/mach/mach/registrar.py#185
The problem is that it doesn't properly restore state. This is because
ArgumentParser.set_defaults mutates both, parser._defaults as well as
parser._actions (which themselves can have a default). So we need to
restore both of those. We also need to use deepcopy rather than copy or
it doesn't work. And for good measure I threw both of them into a
finally block in case parsing the arguments raises an exception that
would get caught and handled downstream (e.g a test that is testing
invalid arguments).
Differential Revision: https://phabricator.services.mozilla.com/D227679
Commands added:
`mach test fenix` runs all tests for fenix
`mach test focus` runs all tests for focus
`mach test mobile/android/fenix/app/src/test/java/org/mozilla/fenix/translations/TranslationsDialogBindingTest.kt` will run all tests in the file.
`mach test mobile/android/fenix/app/src/test/java/org/mozilla/fenix/translations/` will run all tests in the directory.
Differential Revision: https://phabricator.services.mozilla.com/D224885
The vendoring steps are the same. Instead of using 'poetry' to handle
dependency resolution and creating a lock file, we now use 'uv'. That
lock file is then used to create a cross-platform 'requirements.txt'
file by 'uv'.
How the 'requirements.txt' file is consumed by 'pip' to download the
dependencies is unchanged.
Differential Revision: https://phabricator.services.mozilla.com/D222989
First and foremost, this undoes the patch for bug 1845125, which causes
other problems (e.g. output being dropped past a certain point).
The rest of the patch addresses bug 1845125 at the root: Ultimately, this
is a similar problem to bug 1863675.
wait is blocked on joining the stream reader thread, but the stream
reader thread is blocked on readline because the process is finished but
hasn't been waited on yet.
So joining the stream reader thread after the process is known to have
been finished is expected to work more reliably... except when a child
has been spun up that keeps it alive. In this case, we just keep the
reader thread working in the background, which is a similar strategy to
what was done in bug 1863675.
Differential Revision: https://phabricator.services.mozilla.com/D218389
Added one field:
- The `--target` of a build.
Re-added `python/mach/metrics.yaml` to `./mach doc mach-telemetry` generation (Not sure why it was missing).
Re-generated the associated docs. (It looks like this was not done for previously when other fields were added.
Differential Revision: https://phabricator.services.mozilla.com/D208811
Mach can currently only run on Python version 3.8 or higher, so it
doesn't make sense to continue having dead code that provides support
for Python2.
Differential Revision: https://phabricator.services.mozilla.com/D209030
Mitch has been inactive for ~2 years now. I don't necessarily needs to
add myself in his stead, but I think it makes sense to have me on there
as the current triage owner.
Differential Revision: https://phabricator.services.mozilla.com/D209031
This new command will make it easier to work with the JSON source of
truth for our design tokens. Unfortunately the noisy output when
building the tokens is expected. We can fix this issue by upgrading
to Style Dictionary v4 when it is available and changing the logging
level.[1]
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1889645
Differential Revision: https://phabricator.services.mozilla.com/D206561
Looks like this command didn't get added to the MACH_COMMANDS list which
means 'addstory' will throw an error when you try and use it.
Differential Revision: https://phabricator.services.mozilla.com/D206548
* Initial tools/ts setup.
* Mach commands for buidling xpcom related typelibs.
* Mach command for updating the typelib references.
* Mach command for type-checking js projects.
Also included the dom typelib for reference.
Differential Revision: https://phabricator.services.mozilla.com/D197620
This should make it easier for a user to troubleshoot the problem,
instead of trying to decipher a subsequent exception from a function
call being attempted on the `None` returned by this function.
Differential Revision: https://phabricator.services.mozilla.com/D200496
While this message was sometimes useful to help troubleshoot for end
users, it's causing issues parsing `stdout` (since it can't use the mach
logging infrastructure due to being too early in the startup). We also
can't use `stderr` since some mozharness scripts treat any `stderr`
output as a full error.
Differential Revision: https://phabricator.services.mozilla.com/D198451
It's not technically an error, but we can't make it debug level output
since the mach logging isn't available this early on startup. There's
precedent for using `stderr` output elsewhere in `site.py`, though it
usually precedes an exception being raised.
Differential Revision: https://phabricator.services.mozilla.com/D198307
If this is not done, the next person to vendor will also make all of the changes in this commit, which is unnecessary noise.
Differential Revision: https://phabricator.services.mozilla.com/D183450