|
@@ -0,0 +1,303 @@
|
|
|
|
+# HG changeset patch
|
|
|
|
+# User Mitchell Hentges <mhentges@mozilla.com>
|
|
|
|
+# Date 1623941896 0
|
|
|
|
+# Node ID 030a489e51f5dc8cd00c6c33c0d1148491ef2c70
|
|
|
|
+# Parent 32a5c1954a9d659249510cb2b846d24e28cef6dc
|
|
|
|
+Bug 1712133: Remove "pth" name customization r=ahal
|
|
|
|
+
|
|
|
|
+Having separate `<name>.pth` files in the virtual environments
|
|
|
|
+isn't providing an advantage. We can simplify configuration
|
|
|
|
+by putting all `pth` adjustments into a single file: `mach.pth`.
|
|
|
|
+
|
|
|
|
+Differential Revision: https://phabricator.services.mozilla.com/D117710
|
|
|
|
+
|
|
|
|
+diff --git a/build/common_virtualenv_packages.txt b/build/common_virtualenv_packages.txt
|
|
|
|
+--- a/build/common_virtualenv_packages.txt
|
|
|
|
++++ b/build/common_virtualenv_packages.txt
|
|
|
|
+@@ -1,78 +1,78 @@
|
|
|
|
+ thunderbird:packages.txt:comm/build/virtualenv_packages.txt
|
|
|
|
+-mozilla.pth:build
|
|
|
|
+-mozilla.pth:config
|
|
|
|
+-mozilla.pth:config/mozunit
|
|
|
|
+-mozilla.pth:dom/bindings
|
|
|
|
+-mozilla.pth:dom/bindings/parser
|
|
|
|
+-mozilla.pth:layout/tools/reftest
|
|
|
|
+-mozilla.pth:python/mach
|
|
|
|
+-mozilla.pth:python/mozboot
|
|
|
|
+-mozilla.pth:python/mozbuild
|
|
|
|
+-mozilla.pth:python/mozlint
|
|
|
|
+-mozilla.pth:python/mozperftest
|
|
|
|
+-mozilla.pth:python/mozrelease
|
|
|
|
+-mozilla.pth:python/mozterm
|
|
|
|
+-mozilla.pth:python/mozversioncontrol
|
|
|
|
+-mozilla.pth:testing
|
|
|
|
+-mozilla.pth:testing/firefox-ui/harness
|
|
|
|
+-mozilla.pth:testing/marionette/client
|
|
|
|
+-mozilla.pth:testing/marionette/harness
|
|
|
|
+-mozilla.pth:testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
|
|
|
|
+-mozilla.pth:testing/marionette/puppeteer/firefox
|
|
|
|
++pth:build
|
|
|
|
++pth:config
|
|
|
|
++pth:config/mozunit
|
|
|
|
++pth:dom/bindings
|
|
|
|
++pth:dom/bindings/parser
|
|
|
|
++pth:layout/tools/reftest
|
|
|
|
++pth:python/mach
|
|
|
|
++pth:python/mozboot
|
|
|
|
++pth:python/mozbuild
|
|
|
|
++pth:python/mozlint
|
|
|
|
++pth:python/mozperftest
|
|
|
|
++pth:python/mozrelease
|
|
|
|
++pth:python/mozterm
|
|
|
|
++pth:python/mozversioncontrol
|
|
|
|
++pth:testing
|
|
|
|
++pth:testing/firefox-ui/harness
|
|
|
|
++pth:testing/marionette/client
|
|
|
|
++pth:testing/marionette/harness
|
|
|
|
++pth:testing/marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py
|
|
|
|
++pth:testing/marionette/puppeteer/firefox
|
|
|
|
+ packages.txt:testing/mozbase/packages.txt
|
|
|
|
+-mozilla.pth:testing/talos
|
|
|
|
+-mozilla.pth:testing/web-platform/tests/tools/six
|
|
|
|
+-mozilla.pth:testing/web-platform/tests/tools/wptrunner
|
|
|
|
+-mozilla.pth:testing/web-platform/tests/tools/wptserve
|
|
|
|
+-mozilla.pth:testing/xpcshell
|
|
|
|
+-mozilla.pth:third_party/python/appdirs
|
|
|
|
+-mozilla.pth:third_party/python/atomicwrites
|
|
|
|
+-mozilla.pth:third_party/python/attrs/src
|
|
|
|
+-mozilla.pth:third_party/python/blessings
|
|
|
|
+-mozilla.pth:third_party/python/cbor2
|
|
|
|
+-mozilla.pth:third_party/python/chardet
|
|
|
|
+-mozilla.pth:third_party/python/Click
|
|
|
|
+-mozilla.pth:third_party/python/compare-locales
|
|
|
|
+-mozilla.pth:third_party/python/cookies
|
|
|
|
+-mozilla.pth:third_party/python/cram
|
|
|
|
+-mozilla.pth:third_party/python/distro
|
|
|
|
+-mozilla.pth:third_party/python/dlmanager
|
|
|
|
+-mozilla.pth:third_party/python/ecdsa/src
|
|
|
|
+-mozilla.pth:third_party/python/fluent.migrate
|
|
|
|
+-mozilla.pth:third_party/python/fluent.syntax
|
|
|
|
+-mozilla.pth:third_party/python/funcsigs
|
|
|
|
+-mozilla.pth:third_party/python/gyp/pylib
|
|
|
|
+-mozilla.pth:third_party/python/idna
|
|
|
|
+-mozilla.pth:third_party/python/importlib_metadata
|
|
|
|
+-mozilla.pth:third_party/python/jsmin
|
|
|
|
+-mozilla.pth:third_party/python/json-e
|
|
|
|
+-mozilla.pth:third_party/python/mock-1.0.0
|
|
|
|
+-mozilla.pth:third_party/python/more-itertools
|
|
|
|
+-mozilla.pth:third_party/python/pathspec
|
|
|
|
+-mozilla.pth:third_party/python/pluggy
|
|
|
|
+-mozilla.pth:third_party/python/ply
|
|
|
|
+-mozilla.pth:third_party/python/py
|
|
|
|
+-mozilla.pth:third_party/python/pyasn1
|
|
|
|
+-mozilla.pth:third_party/python/pyasn1-modules
|
|
|
|
+-mozilla.pth:third_party/python/pylru
|
|
|
|
+-mozilla.pth:third_party/python/pystache
|
|
|
|
+-mozilla.pth:third_party/python/pytest/src
|
|
|
|
+-mozilla.pth:third_party/python/python-hglib
|
|
|
|
+-mozilla.pth:third_party/python/pytoml
|
|
|
|
+-mozilla.pth:third_party/python/PyYAML/lib3/
|
|
|
|
+-mozilla.pth:third_party/python/redo
|
|
|
|
+-mozilla.pth:third_party/python/requests
|
|
|
|
+-mozilla.pth:third_party/python/requests-unixsocket
|
|
|
|
+-mozilla.pth:third_party/python/responses
|
|
|
|
+-mozilla.pth:third_party/python/rsa
|
|
|
|
+-mozilla.pth:third_party/python/six
|
|
|
|
+-mozilla.pth:third_party/python/slugid
|
|
|
|
+-mozilla.pth:third_party/python/typing_extensions/src_py3
|
|
|
|
+-mozilla.pth:third_party/python/urllib3/src
|
|
|
|
+-mozilla.pth:third_party/python/voluptuous
|
|
|
|
+-mozilla.pth:third_party/python/yamllint
|
|
|
|
+-mozilla.pth:third_party/python/zipp
|
|
|
|
+-mozilla.pth:tools
|
|
|
|
+-mozilla.pth:tools/docs
|
|
|
|
+-mozilla.pth:xpcom/idl-parser
|
|
|
|
+-mozilla.pth:xpcom/typelib/xpt/tools
|
|
|
|
++pth:testing/talos
|
|
|
|
++pth:testing/web-platform/tests/tools/six
|
|
|
|
++pth:testing/web-platform/tests/tools/wptrunner
|
|
|
|
++pth:testing/web-platform/tests/tools/wptserve
|
|
|
|
++pth:testing/xpcshell
|
|
|
|
++pth:third_party/python/appdirs
|
|
|
|
++pth:third_party/python/atomicwrites
|
|
|
|
++pth:third_party/python/attrs/src
|
|
|
|
++pth:third_party/python/blessings
|
|
|
|
++pth:third_party/python/cbor2
|
|
|
|
++pth:third_party/python/chardet
|
|
|
|
++pth:third_party/python/Click
|
|
|
|
++pth:third_party/python/compare-locales
|
|
|
|
++pth:third_party/python/cookies
|
|
|
|
++pth:third_party/python/cram
|
|
|
|
++pth:third_party/python/distro
|
|
|
|
++pth:third_party/python/dlmanager
|
|
|
|
++pth:third_party/python/ecdsa/src
|
|
|
|
++pth:third_party/python/fluent.migrate
|
|
|
|
++pth:third_party/python/fluent.syntax
|
|
|
|
++pth:third_party/python/funcsigs
|
|
|
|
++pth:third_party/python/gyp/pylib
|
|
|
|
++pth:third_party/python/idna
|
|
|
|
++pth:third_party/python/importlib_metadata
|
|
|
|
++pth:third_party/python/jsmin
|
|
|
|
++pth:third_party/python/json-e
|
|
|
|
++pth:third_party/python/mock-1.0.0
|
|
|
|
++pth:third_party/python/more-itertools
|
|
|
|
++pth:third_party/python/pathspec
|
|
|
|
++pth:third_party/python/pluggy
|
|
|
|
++pth:third_party/python/ply
|
|
|
|
++pth:third_party/python/py
|
|
|
|
++pth:third_party/python/pyasn1
|
|
|
|
++pth:third_party/python/pyasn1-modules
|
|
|
|
++pth:third_party/python/pylru
|
|
|
|
++pth:third_party/python/pystache
|
|
|
|
++pth:third_party/python/pytest/src
|
|
|
|
++pth:third_party/python/python-hglib
|
|
|
|
++pth:third_party/python/pytoml
|
|
|
|
++pth:third_party/python/PyYAML/lib3/
|
|
|
|
++pth:third_party/python/redo
|
|
|
|
++pth:third_party/python/requests
|
|
|
|
++pth:third_party/python/requests-unixsocket
|
|
|
|
++pth:third_party/python/responses
|
|
|
|
++pth:third_party/python/rsa
|
|
|
|
++pth:third_party/python/six
|
|
|
|
++pth:third_party/python/slugid
|
|
|
|
++pth:third_party/python/typing_extensions/src_py3
|
|
|
|
++pth:third_party/python/urllib3/src
|
|
|
|
++pth:third_party/python/voluptuous
|
|
|
|
++pth:third_party/python/yamllint
|
|
|
|
++pth:third_party/python/zipp
|
|
|
|
++pth:tools
|
|
|
|
++pth:tools/docs
|
|
|
|
++pth:xpcom/idl-parser
|
|
|
|
++pth:xpcom/typelib/xpt/tools
|
|
|
|
+diff --git a/build/mach_bootstrap.py b/build/mach_bootstrap.py
|
|
|
|
+--- a/build/mach_bootstrap.py
|
|
|
|
++++ b/build/mach_bootstrap.py
|
|
|
|
+@@ -118,17 +118,17 @@ def search_path(mozilla_dir, packages_tx
|
|
|
|
+ with open(os.path.join(mozilla_dir, packages_txt)) as f:
|
|
|
|
+ packages = [line.rstrip().split(":", maxsplit=1) for line in f]
|
|
|
|
+
|
|
|
|
+ def handle_package(action, package):
|
|
|
|
+ if action == "packages.txt":
|
|
|
|
+ for p in search_path(mozilla_dir, package):
|
|
|
|
+ yield os.path.join(mozilla_dir, p)
|
|
|
|
+
|
|
|
|
+- if action.endswith(".pth"):
|
|
|
|
++ if action == "pth":
|
|
|
|
+ yield os.path.join(mozilla_dir, package)
|
|
|
|
+
|
|
|
|
+ for current_action, current_package in packages:
|
|
|
|
+ for path in handle_package(current_action, current_package):
|
|
|
|
+ yield path
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ def mach_sys_path(mozilla_dir):
|
|
|
|
+diff --git a/python/mozbuild/mozbuild/test/test_vendor.py b/python/mozbuild/mozbuild/test/test_vendor.py
|
|
|
|
+--- a/python/mozbuild/mozbuild/test/test_vendor.py
|
|
|
|
++++ b/python/mozbuild/mozbuild/test/test_vendor.py
|
|
|
|
+@@ -24,17 +24,17 @@ def test_up_to_date_vendor():
|
|
|
|
+ # Create empty virtualenv_packages file
|
|
|
|
+ with open(
|
|
|
|
+ os.path.join(work_dir, "build", "build_virtualenv_packages.txt"), "a"
|
|
|
|
+ ) as file:
|
|
|
|
+ # Since VendorPython thinks "work_dir" is the topsrcdir,
|
|
|
|
+ # it will use its associated virtualenv and package configuration.
|
|
|
|
+ # Since it uses "pip-tools" within, and "pip-tools" needs
|
|
|
|
+ # the "Click" library, we need to make it available.
|
|
|
|
+- file.write("mozilla.pth:third_party/python/Click")
|
|
|
|
++ file.write("pth:third_party/python/Click")
|
|
|
|
+
|
|
|
|
+ # Copy existing "third_party/python/" vendored files
|
|
|
|
+ existing_vendored = os.path.join(topsrcdir, "third_party", "python")
|
|
|
|
+ work_vendored = os.path.join(work_dir, "third_party", "python")
|
|
|
|
+ shutil.copytree(existing_vendored, work_vendored)
|
|
|
|
+
|
|
|
|
+ # Run the vendoring process
|
|
|
|
+ vendor = VendorPython(
|
|
|
|
+diff --git a/python/mozbuild/mozbuild/virtualenv.py b/python/mozbuild/mozbuild/virtualenv.py
|
|
|
|
+--- a/python/mozbuild/mozbuild/virtualenv.py
|
|
|
|
++++ b/python/mozbuild/mozbuild/virtualenv.py
|
|
|
|
+@@ -274,17 +274,17 @@ class VirtualenvManager(VirtualenvHelper
|
|
|
|
+ action. The following actions are supported:
|
|
|
|
+
|
|
|
|
+ filename.pth -- Adds the path given as argument to filename.pth under
|
|
|
|
+ the virtualenv site packages directory.
|
|
|
|
+
|
|
|
|
+ thunderbird -- This denotes the action as to only occur for Thunderbird
|
|
|
|
+ checkouts. The initial "thunderbird" field is stripped, then the
|
|
|
|
+ remaining line is processed like normal. e.g.
|
|
|
|
+- "thunderbird:comms.pth:python/foo"
|
|
|
|
++ "thunderbird:pth:python/foo"
|
|
|
|
+
|
|
|
|
+ packages.txt -- Denotes that the specified path is a child manifest. It
|
|
|
|
+ will be read and processed as if its contents were concatenated
|
|
|
|
+ into the manifest being read.
|
|
|
|
+
|
|
|
|
+ set-variable -- Set the given environment variable; e.g.
|
|
|
|
+ `set-variable FOO=1`.
|
|
|
|
+
|
|
|
|
+@@ -304,23 +304,23 @@ class VirtualenvManager(VirtualenvHelper
|
|
|
|
+ def handle_package(action, package):
|
|
|
|
+ if action == "packages.txt":
|
|
|
|
+ src = os.path.join(self.topsrcdir, package)
|
|
|
|
+ assert os.path.isfile(src), "'%s' does not exist" % src
|
|
|
|
+ submanager = VirtualenvManager(
|
|
|
|
+ self.topsrcdir, self.virtualenv_root, self.log_handle, src,
|
|
|
|
+ populate_local_paths=self.populate_local_paths)
|
|
|
|
+ submanager.populate()
|
|
|
|
+- elif action.endswith(".pth"):
|
|
|
|
++ elif action == "pth":
|
|
|
|
+ if not self.populate_local_paths:
|
|
|
|
+ return
|
|
|
|
+
|
|
|
|
+ path = os.path.join(self.topsrcdir, package)
|
|
|
|
+
|
|
|
|
+- with open(os.path.join(python_lib, action), "a") as f:
|
|
|
|
++ with open(os.path.join(python_lib, "mach.pth"), "a") as f:
|
|
|
|
+ # This path is relative to the .pth file. Using a
|
|
|
|
+ # relative path allows the srcdir/objdir combination
|
|
|
|
+ # to be moved around (as long as the paths relative to
|
|
|
|
+ # each other remain the same).
|
|
|
|
+ f.write("%s\n" % os.path.relpath(path, python_lib))
|
|
|
|
+ elif action == "thunderbird":
|
|
|
|
+ if is_thunderbird:
|
|
|
|
+ handle_package(*package.split(":", maxsplit=1))
|
|
|
|
+diff --git a/testing/mozbase/packages.txt b/testing/mozbase/packages.txt
|
|
|
|
+--- a/testing/mozbase/packages.txt
|
|
|
|
++++ b/testing/mozbase/packages.txt
|
|
|
|
+@@ -1,18 +1,18 @@
|
|
|
|
+-manifestparser.pth:testing/mozbase/manifestparser
|
|
|
|
+-mozcrash.pth:testing/mozbase/mozcrash
|
|
|
|
+-mozdebug.pth:testing/mozbase/mozdebug
|
|
|
|
+-mozdevice.pth:testing/mozbase/mozdevice
|
|
|
|
+-mozfile.pth:testing/mozbase/mozfile
|
|
|
|
+-mozhttpd.pth:testing/mozbase/mozhttpd
|
|
|
|
+-mozinfo.pth:testing/mozbase/mozinfo
|
|
|
|
+-mozinstall.pth:testing/mozbase/mozinstall
|
|
|
|
+-mozleak.pth:testing/mozbase/mozleak
|
|
|
|
+-mozlog.pth:testing/mozbase/mozlog
|
|
|
|
+-moznetwork.pth:testing/mozbase/moznetwork
|
|
|
|
+-mozprocess.pth:testing/mozbase/mozprocess
|
|
|
|
+-mozprofile.pth:testing/mozbase/mozprofile
|
|
|
|
+-mozrunner.pth:testing/mozbase/mozrunner
|
|
|
|
+-mozsystemmonitor.pth:testing/mozbase/mozsystemmonitor
|
|
|
|
+-mozscreenshot.pth:testing/mozbase/mozscreenshot
|
|
|
|
+-moztest.pth:testing/mozbase/moztest
|
|
|
|
+-mozversion.pth:testing/mozbase/mozversion
|
|
|
|
++pth:testing/mozbase/manifestparser
|
|
|
|
++pth:testing/mozbase/mozcrash
|
|
|
|
++pth:testing/mozbase/mozdebug
|
|
|
|
++pth:testing/mozbase/mozdevice
|
|
|
|
++pth:testing/mozbase/mozfile
|
|
|
|
++pth:testing/mozbase/mozhttpd
|
|
|
|
++pth:testing/mozbase/mozinfo
|
|
|
|
++pth:testing/mozbase/mozinstall
|
|
|
|
++pth:testing/mozbase/mozleak
|
|
|
|
++pth:testing/mozbase/mozlog
|
|
|
|
++pth:testing/mozbase/moznetwork
|
|
|
|
++pth:testing/mozbase/mozprocess
|
|
|
|
++pth:testing/mozbase/mozprofile
|
|
|
|
++pth:testing/mozbase/mozrunner
|
|
|
|
++pth:testing/mozbase/mozsystemmonitor
|
|
|
|
++pth:testing/mozbase/mozscreenshot
|
|
|
|
++pth:testing/mozbase/moztest
|
|
|
|
++pth:testing/mozbase/mozversion
|