diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-11 16:43:54 -0500 |
---|---|---|
committer | Aneesh Agrawal <aneeshusa@gmail.com> | 2017-01-17 11:01:09 -0500 |
commit | b4f508630510c1fc96f6f3245bfb29dd0e16dcf4 (patch) | |
tree | df1bce31c7bec9c07bf656cf1d1dc7ed9ec805b7 /python/mach_bootstrap.py | |
parent | 60a1503b2997b05e3f36f4ce92d688df44fdeae7 (diff) | |
download | servo-b4f508630510c1fc96f6f3245bfb29dd0e16dcf4.tar.gz servo-b4f508630510c1fc96f6f3245bfb29dd0e16dcf4.zip |
Add a Salt bootstrapper
The Salt bootstrapper invokes Salt during `./mach bootstrap`
to install Servo's build dependencies.
It uses salt-call pinned to the same version of Salt as used in saltfs.
Currently, the implementation uses gitfs and reads directly from
the master branch of the saltfs repo;
in the future this should be changed when the relevant Salt states
are moved in-tree as part of Dockerization for TaskCluster.
We have not Salted our Windows machines, so the existing Windows
bootstrappers are retained. Currently this is only tested on
Ubuntu Trusty.
Salt uses various system python libraries,
including `python-apt` on Debian-based OSes to interact with apt.
`python-apt` does not seem to be installable via a requirements.txt
file, and the versions available on PyPI are far behind the versions
installed on actual Ubuntu machines.
Additionally, adding `python-apt` as an unconditional python dependency
would add bloat for users of other OSes, and lead to more churn
as additional OSes are supported.
However, as `python-apt` is already installed via apt on these machines,
we can allow Salt to instead use the module by using
`--system-site-packages` for the python virtualenv.
We also add the `-I` flag to `pip install` to ensure we have a local,
untouched copy of any other python packages used.
However, because this prints system-level Python packages in scope,
it slightly breaks isolation, so it is important to always pin
all dependencies in the requirements files.
Diffstat (limited to 'python/mach_bootstrap.py')
-rw-r--r-- | python/mach_bootstrap.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/python/mach_bootstrap.py b/python/mach_bootstrap.py index d41bb1f5099..fa612ddd868 100644 --- a/python/mach_bootstrap.py +++ b/python/mach_bootstrap.py @@ -118,7 +118,11 @@ def _activate_virtualenv(topdir): if not virtualenv: sys.exit("Python virtualenv is not installed. Please install it prior to running mach.") - process = Popen([virtualenv, "-p", python, virtualenv_path], stdout=PIPE, stderr=PIPE) + process = Popen( + [virtualenv, "-p", python, "--system-site-packages", virtualenv_path], + stdout=PIPE, + stderr=PIPE + ) process.wait() if process.returncode: out, err = process.communicate() @@ -153,7 +157,7 @@ def _activate_virtualenv(topdir): if not pip: sys.exit("Python pip is either not installed or not found in virtualenv.") - process = Popen([pip, "install", "-q", "-U", "pip"], stdout=PIPE, stderr=PIPE) + process = Popen([pip, "install", "-q", "-I", "-U", "pip"], stdout=PIPE, stderr=PIPE) process.wait() if process.returncode: out, err = process.communicate() @@ -175,7 +179,7 @@ def _activate_virtualenv(topdir): if not pip: sys.exit("Python pip is either not installed or not found in virtualenv.") - process = Popen([pip, "install", "-q", "-r", req_path], stdout=PIPE, stderr=PIPE) + process = Popen([pip, "install", "-q", "-I", "-r", req_path], stdout=PIPE, stderr=PIPE) process.wait() if process.returncode: out, err = process.communicate() |