bazel_rules_pex icon indicating copy to clipboard operation
bazel_rules_pex copied to clipboard

Symlink runfiles tree so that you can do a dev/test iteration without rebuilding PEX

Open c4urself opened this issue 7 years ago • 1 comments

With py_test (PAR-based) rules I can dev/test iterate on an individual test by running the following:

  1. bazel test //foo:foo_tests
  2. find and update an issue in dependency bar.py
  3. run bazel test //foo:foo_tests without rebuilding the PAR because the runfiles are symlinked

The iteration cycle (1 and 2 above) is fast because it essentially lays out the zipfile in the runfiles directory and symlinks files that I may want to edit.

With the PEX rules I cannot do this as the only files that are symlinked are the srcs files from the test itself. This means that I have to rebuild the PEX each time I have to edit a dependent file which makes life quite tedious for any serious development.

What should happen is that the runfiles tree is created similarly to what PAR does.

c4urself avatar Apr 09 '18 14:04 c4urself

I agree that would be nice - the challenge lies in keeping all the wheels/eggs/setuptools-stuff dependencies available. We could make a script wrapper that sets PEX_PATH to have pex get dependencies from the previously-built .pex, but I'm not sure how to make it keep a path outside of the .pex in sys.path after pex initializes itself. Any suggestions?

benley avatar Apr 09 '18 17:04 benley