Summary:
Needs to be enabled by option PYTHON_VENV in the config.
shell_builder.py sets up the venv and uses it once; calling activate
For docker we set ENV; resulting in the virtual environment being present
when the resulting container is run as well as at build time. This is also cleaner
and easier to follow than re-asserting on each RUN step.
For Lego builder we need to source activate on each command as environment
will not persist between commands.
While man on the posts say it makes no sense to use virtualenv within docker
container, this method simplifies the process considerably as we can rely on the
name pip being valid and we don't need to either ensure we are root or pass the
--user flag to pip and setuptools.
Pull Request resolved: https://github.com/facebookincubator/LogDevice/pull/76
Reviewed By: wez
Differential Revision: D14875633
Pulled By: calebmarchent
fbshipit-source-id: aabbcdd509d2a59fa36f8004032a052f014ce1ba
Summary:
These were failing in the watchman build
```
$ cd build && python fbcode_builder/shell_builder.py > ~/run.sh && bash ~/run.sh
Traceback (most recent call last):
File "fbcode_builder/shell_builder.py", line 110, in <module>
steps = make_steps(builder)
File "/home/travis/build/facebook/watchman/build/fbcode_builder/utils.py", line 94, in <lambda>
steps_for_spec(builder, config['fbcode_builder_spec'](builder))
File "/home/travis/build/facebook/watchman/build/fbcode_builder/fbcode_builder.py", line 144, in build
return [self.setup(), self.diagnostics()] + steps
File "fbcode_builder/shell_builder.py", line 61, in setup
).format(ccache_dir=ccache_dir)
File "/home/travis/build/facebook/watchman/build/fbcode_builder/shell_quoting.py", line 64, in format
(k, shell_quote(v).do_not_use_raw_str) for k, v in kwargs.items()
KeyError: u'CC'
```
Reviewed By: snarkmaster
fbshipit-source-id: 614723e631a82f277739765a920731c872700c45
Summary:
`shell_builder.py` allows running the fbcode_builder logic
on the host rather than in a container.
It emits a bash script with `set -exo pipefail` configured such that
any failing step will cause the script to exit with failure.
Refs: https://github.com/facebook/watchman/pull/639
Reviewed By: simpkins
Differential Revision: D9552411
fbshipit-source-id: c7835deedf07ea342dcb3de61d576a4fb5439985