mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1764836: Mercurial update is now compatible with MozillaBuild 4.0 r=ahal
MozillaBuild 4.0 now uses `hg` with Python 3, so use Python 3's `pip` accordingly. Differential Revision: https://phabricator.services.mozilla.com/D143921
This commit is contained in:
parent
4f436e2298
commit
d1eb9a0470
@ -143,7 +143,27 @@ class MozillaBuildBootstrapper(BaseBootstrapper):
|
||||
# Mercurial upstream sometimes doesn't upload wheels, and building
|
||||
# from source requires MS Visual C++ 9.0. So we force pip to install
|
||||
# the last version that comes with wheels.
|
||||
self.pip_install("mercurial", "--only-binary", "mercurial")
|
||||
with open(Path(os.environ["MOZILLABUILD"]) / "VERSION") as f:
|
||||
major, minor = (int(v) for v in f.read().split("."))
|
||||
|
||||
if major >= 4:
|
||||
pip_dir = (
|
||||
Path(os.environ["MOZILLABUILD"]) / "python3" / "Scripts" / "pip.exe"
|
||||
)
|
||||
else:
|
||||
pip_dir = (
|
||||
Path(os.environ["MOZILLABUILD"]) / "python" / "Scripts" / "pip.exe"
|
||||
)
|
||||
|
||||
command = [
|
||||
str(pip_dir),
|
||||
"install",
|
||||
"--upgrade",
|
||||
"mercurial",
|
||||
"--only-binary",
|
||||
"mercurial",
|
||||
]
|
||||
self.run(command)
|
||||
|
||||
def install_browser_packages(self, mozconfig_builder):
|
||||
pass
|
||||
@ -246,10 +266,3 @@ class MozillaBuildBootstrapper(BaseBootstrapper):
|
||||
|
||||
def run(self, command):
|
||||
subprocess.check_call(command, stdin=sys.stdin)
|
||||
|
||||
def pip_install(self, *packages):
|
||||
pip_dir = Path(os.environ["MOZILLABUILD"]) / "python" / "Scripts" / "pip.exe"
|
||||
|
||||
command = [str(pip_dir), "install", "--upgrade"]
|
||||
command.extend(packages)
|
||||
self.run(command)
|
||||
|
Loading…
Reference in New Issue
Block a user