I see.. thanks:) btw- just wondering if in v2 usin...
# general
c
I see.. thanks:) btw- just wondering if in v2 using to subprocess pex, I see pex tool doesn't have "support" to add files into the pex, only directories or packages with setup.py. but Pants does adding just like that files, how would v2 will manage to copy that behavior?
h
Good question! We use what’s called a chroot to copy over all the relevant source files into a temporary directory, and then we put them all in a directory
source_files
, and finally tell Pex
--sources-directory=source_files/
. The chroot means that we will only copy the files we actually care about.
By the way, the V2 implementation of
./pants binary
and
./pants run
is ready to use 🙂 To try it out, run
./pants --no-v1 --backend-packages2='pants.backend.python' binary path/to:python_binary_target
c
Thanks, is this ready to be used from version 1.25.0 ? Seems that it doesn't creates the dist folder. you don't mean you actually use the chroot system call right? just as a concept?
h
Yes, chroot just as a concept. Ah, I didn’t realize you’re on 1.25.0. You will need to add
--v2
then for it to work. We turned on
--v2
by default in 1.26.0.
./pants --no-v1 --v2 --backend-packages2='pants.backend.python' binary path/to:python_binary_target
(FYI, the
--no-v1
means don’t use the V1 implementation of
binary
too. If you had
--v1 --v2 binary
, then you would create it both with V1 and V2, which you probably don’t want because it’s a waste of time to create the same binary twice.)
is this ready to be used from version 1.25.0
Yes, the one current limitation is that we ignore some fields like
zip_safe
in your BUILD file. I’m working on fixing that as we speak and the next weekly dev release should have full feature parity to V1. Some of the upsides for using V2 binary are: * smarter caching * less verbose output * avoids irrelevant work that V1 does - should be faster * works more ergonomically with custom target types
c
Nice!, thanks @hundreds-father-404 :)
h
You’re welcome! Let us know if you try it out and any suggestions to improve things! We’re pouring a lot of resources into V2 and are thrilled with its benefits in internal usage, and are working to get it into the hands of users 🙂