buck
buck copied to clipboard
Adding prebuilt_python_library to deps does not rebuild pex
When adding or removing prebuilt_python_library to the transitive deps of a python_binary, the pex does not get rebuilt. This causes me to have to rm -rf buck-out to get the correct output.
Steps to reproduce:
- Check out the example bug repository:
git clone https://github.com/evanj/buckbug - Build the binary that is missing a dependency:
buck run //somebin:
[-] PROCESSING BUCK FILES...FINISHED 0.1s [100%] 🐳 New buck daemon
[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)
[-] BUILDING...FINISHED 1.7s [100%] (3/3 JOBS, 3 UPDATED, 1 [33.3%] CACHE MISS)
Traceback (most recent call last):
... TRUNCATED ...
ImportError: No module named pycparser
- Edit the
python_libraryrule insomebin/BUCKto depend on//third_party:pycparser - Re-run
buck run //somebin(which should re-build the pex and execute it correctly):
[-] PROCESSING BUCK FILES...FINISHED 0.1s [100%] 🐳 New buck daemon
[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)
[-] BUILDING...FINISHED 1.3s [100%] (4/4 JOBS, 1 UPDATED, 0 [0.0%] CACHE MISS)
Traceback (most recent call last):
... TRUNCATED ...
ImportError: No module named pycparser
- If you inspect the pex with
unzip -lor runbuck run --verbose 10you will see the pex has not been rebuilt. - Clear the build state:
rm -rf buck-out - Re-run the target:
buck run //somebin
[-] DOWNLOADING... (0.00 B/S AVG, TOTAL: 0.00 B, 0 Artifacts)
[-] BUILDING...FINISHED 1.9s [100%] (4/4 JOBS, 4 UPDATED, 1 [25.0%] CACHE MISS)
pycparser: <module 'pycparser' from '/Users/ej/.pex/install/pycparser-2.17-py2.py3-none-any.whl.23f5bf5c584e3052492053082449b44eb9e5053e/pycparser-2.17-py2.py3-none-any.whl/pycparser/__init__.pyc'>
(this is the correct output)
- Remove the rule from deps and re-run: It will still work, indicating that removing the
depsdoesn't force a rebuild either.
If you follow these steps with a python_library dependency, it works as expected.
Buck version: 8ad7e8dfe1c6af5e608608ddef677836652dda0a System: Mac OS X 10.11.6
cc @andrewjcg
Got the same issue:
buck version v2017.10.01.01