fune/python
Ricky Stewart e6d1d2a4dd Bug 1656614 - Delete existing virtualenv before re-creating it r=mhentges,ahal
I wrote this patch because I noticed that the `.pth` files in my `objdir` `virtualenv`s were extremely repetitive, containing multiple references to the same directories. This happens because we [append](https://searchfox.org/mozilla-central/rev/03794edd6edcc3fc1e222de966cb27256ce08998/python/mozbuild/mozbuild/virtualenv.py#366) to the in-`virtualenv` `.pth` files when calling `populate()`, but we don't ever clean up the old ones, meaning that whenever we determine that the `virtualenv`s are out of date and need to be recreated, we actually leave A LOT of state lying around on-disk that is going to go on to impact further uses of the `virtualenv`. Concretely, how this manifested is that when I erroneously removed an entry from `virtualenv_packages.txt`, the build actually succeeded because that entry was still in the `.pth` file in the `virtualenv`; instead of "creating" a new `virtualenv` with the correct `.pth` files, it just appended the new `.pth` data to the old, stale data.

I've chosen to address this by completely deleting the entire `virtualenv` when we try to re-create it. Another way you might solve this problem is by doing a `find $VIRTUALENV -name '*.pth' | xargs rm` before doing the `virtualenv` re-creation, but I'm suggesting we do it this way because we have had a long history of difficulty with `virtualenv` persistence. Bug 1628498 is an obvious example; note that we would never have encountered that bug if we always unconditionally deleted the `virtualenv` before creating a new one, as in this patch. A patch that is laser-targeted at handling the issue with `.pth` files might be fine for now but this is more foolproof and future-proof.

Differential Revision: https://phabricator.services.mozilla.com/D85636
2020-08-07 15:35:27 +00:00
..
devtools/migrate-l10n
docs
gdbpp/gdbpp
l10n Bug 1654177 - Remove Fluent migration recipes for Firefox 78, r=Pike 2020-07-23 08:03:48 +00:00
lldbutils Bug 1637130 - Rename visual overflow to ink overflow. r=dbaron 2020-07-20 20:17:36 +00:00
mach Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
mozboot Bug 1657650 - Require that Mach command providers subclass MachCommandBase. r=remote-protocol-reviewers,marionette-reviewers,maja_zf,mhentges,froydnj 2020-08-07 18:24:59 +00:00
mozbuild Bug 1656614 - Delete existing virtualenv before re-creating it r=mhentges,ahal 2020-08-07 15:35:27 +00:00
mozlint Bug 1657604 - [mozlint] Support multiple linters per yaml file, r=linter-reviewers,sylvestre 2020-08-07 07:12:41 +00:00
mozperftest Bug 1650363 - Performance testing of HTTP3 in Firefox using only xpcshell tests r=michal,sparky 2020-08-10 06:26:39 +00:00
mozrelease Bug 1653662: [mozrelease] Update mozrelease subcommands to python 3; r=aki 2020-07-18 01:36:36 +00:00
mozterm
mozversioncontrol Bug 1645196: Tune git settings to improve performance r=rstewart 2020-07-10 12:54:24 +00:00
safety Bug 1656611 - Remove objdir support from virtualenv_packages.txt handling r=mhentges,froydnj 2020-08-07 16:03:36 +00:00
mach_commands.py Bug 1657719: Don't create init_py3_py3 venv in python-test r=firefox-build-system-reviewers,rstewart 2020-08-07 22:11:41 +00:00
moz.build Bug 925350 - Remove dumbmake r=nalexander 2020-07-10 18:12:07 +00:00
README

This directory contains common Python code.

The basic rule is that if Python code is cross-module (that's "module" in the
Mozilla meaning - as in "module ownership") and is MPL-compatible, it should
go here.

What should not go here:

* Vendored python modules (use third_party/python instead)
* Python that is not MPL-compatible (see other-licenses/)
* Python that has good reason to remain close to its "owning" (Mozilla)
  module (e.g. it is only being consumed from there).

Historical information can be found at
https://bugzilla.mozilla.org/show_bug.cgi?id=775243
https://bugzilla.mozilla.org/show_bug.cgi?id=1346025