WIP: Use target ID instead of basename for bundle dist dir
Review Request #3250 - Created Dec. 14, 2015 and discarded
When "./pants bundle" runs for both root targets and dependencies, you might run into issue if you have a jvm_app depending on a jvm_binary and both use the same basename as the basename is use as the destination directory.
Instead of using basename for the destination directory for the bundle, use the target id as it will always be unique.
This is WIP. Sending this out now to get feedback on general approach and potential side effects. The potential side effects are best illustrated by the changes needed to make the tests in tests/python/pants_test/targets/test_jvm_app_integration.py pass.
./pants test tests/python/pants_test/targets:jvm_app_integration
Peiyu and Stu, sending this to you for general feedback on approach. I'm a little concerned about the changes needed to make the existing tests work.
I'll try to add a test where the option is off.
- use-basename instead of use-targetid
- added test
Please note the new test is currently failing. Still trying to figure out why but wanted to share this as I changed the option.
Revision 3 (+88 -9)
zips using basenames are everywhere, switching the default is a lot work for release.
tw-mbp-peiyu:source peiyu$ git grep -e 'dist/.*zip' -e 'dist/.*tgz' |wc -l 1310
On the other hand, using basename, is good enough when you only bundle just target_roots which is the main use case.
Having something like --transitive, default to False seems more appropriate, this decides
- whether to bundle target_roots or targets()
- which naming to use, basename if just target_roots, target.id if targets()