https://pantsbuild.org/ logo
#pex
Title
# pex
p

polite-garden-50641

05/13/2020, 9:36 PM
In pants v1, when a pex was created (for a binary target) it would add some build properties from run tracker: https://github.com/pantsbuild/pants/blob/master/src/python/pants/backend/python/tasks/python_binary_create.py#L171 I am mostly interested in the scm info (revision) which came thru here: https://github.com/pantsbuild/pants/blob/29cf9fc8b25a540f32e4a9e0aeeaaa6ea4dcc48f/src/python/pants/base/run_info.py#L103 Is there anyway to bring this back to v2 ? where would we do it ? It is helpful to know which git hash was used when building a specific pex file because it allows tools like sentry to trace back regressions to specific commits. (for example) https://docs.sentry.io/workflow/releases/?platform=python
h

hundreds-father-404

05/13/2020, 9:37 PM
The PEX CLI would need to have a mechanism to do this, which I don’t think it has, but maybe we could add to Pex. Or we would need to mutate the generated zip file, which isn’t ideal
We would want to leave off nondeterministic attributes like the timestamp, but SCM info seems useful
a

astonishing-jelly-60479

05/13/2020, 9:53 PM
+1, we also rely on this in a similar manner
👍 1
h

hundreds-father-404

05/13/2020, 9:53 PM
Good to know! @astonishing-jelly-60479 which attributes do you depend upon?
(The reason I said we’d want to leave off timestamp is that it will mess with caching.)
a

astonishing-jelly-60479

05/13/2020, 9:55 PM
just revision, though it's been nice to see the timestamp/cmdline/machine on rare occasions for debugging
👍 1
and, personally, i've always wished for the pants target itself, too
h

hundreds-father-404

05/13/2020, 9:56 PM
As in, the address to the
python_binary
target, right? Sounds very useful indeed.
a

astonishing-jelly-60479

05/13/2020, 9:56 PM
yeah
👍 2
p

polite-garden-50641

06/04/2020, 7:23 PM