https://pantsbuild.org/ logo
c

curved-television-6568

09/16/2022, 6:57 PM
Hi :
bah, kbd slip.. 😛
… well, I’m considering the
--changed-since
flag which is one of the (many) most awesome features in Pants, and realize that I’m missing a dependency on a targets lockfile for each resolve it is a part of.
There is a dependency to the
requirements.txt
file, which is all well and good, but it is actually the lockfile that is relevant.
as the contents of the lockfile may change without touching the requiremnts file.
b

busy-vase-39202

09/16/2022, 7:00 PM
Haha for a second I thought "gee I've gotten so out of practice with knit and crochet lately that I forget which stitch
bah, kbd, slip
is" which tells you how close my brain is to weekend mode...
c

curved-television-6568

09/16/2022, 7:00 PM
🤣
b

busy-vase-39202

09/16/2022, 7:01 PM
Also I was distracted by the thought "Andreas! Yay!" I assumed you'd be kept busy by imanage for a good while.
c

curved-television-6568

09/16/2022, 7:02 PM
cc @hundreds-father-404 may have some thoughts on the matter perhaps 😉 ?
I assumed you’d be kept busy by imanage for a good while.
I am 🙂 😄
h

hundreds-father-404

09/16/2022, 7:07 PM
Hola. That would be tricky to pull off because no "target generators" can synthesize a
_generator_sources_helper
target for the lockfile. There is no natural place to generate that. Whereas
python_requirements
can generate it for its
source
field
e

enough-analyst-54434

09/16/2022, 7:14 PM
Is this a generic issue with any configuration we allow that bypasses targets? I'm thinking of the proposed evolution of complete_platforms away from requiring a target. It seems like a generic big gotcha / bug in existing rules and when going to write a new one.
I want targets gone as much as possible, but if they are required for the current implementation of --changed then that seems to need fixing 1st.
h

hundreds-father-404

09/16/2022, 7:16 PM
Yeah it's a generic problem. For example, changing
.isort.cfg
should invalidate all Python targets where
skip_isort=False
, but it doesn't.
--changed-since
is imperfect and we say that in the docs
c

curved-television-6568

09/17/2022, 12:45 AM
Hah, bummer. OK, I’ll put a pin on that for a while then. Thx
OK, got an idea how to potentially solve this, I’ll just need to find some time to test it see how it falls out 🙂
But, in the mean time is there a way to manually add this dependency link? like adding a
file
target for the lock file and a dependency from the
python_requirements
to that, but I don’t want the lock file to actually be pulled into anything package wise, only used as a means to get targets to work on for the changed since option.
Aha! maybe an
experimental_shell_command
could work as go between, as a filter..
h

hundreds-father-404

09/19/2022, 3:12 PM
yep! Use the
_generator_sources_helper
target type, which has a
source
field
💯 1
c

curved-television-6568

09/19/2022, 3:48 PM
Oh, right I could just put that in the BUILD file of course. cool! Thx Eric ❤️
❤️ 1
h

hundreds-father-404

09/19/2022, 3:49 PM
I don't think we have a ticket for this general problem btw, if you want to create one to track it
I still have no idea how we'd solve it, but at least worth documenting as an issue
c

curved-television-6568

09/19/2022, 3:56 PM
I can create a ticket later tonight (It’s a hassle to switch between GH accounts, as I have another one for iManage work)
👍 1
That would be tricky to pull off because no “target generators” can synthesize a
_generator_sources_helper
target for the lockfile. There is no natural place to generate that. Whereas
python_requirements
can generate it for its
source
field
What if the
python_requirements
generator also generates a
_generator_sources_helper
for each
resolve
as a resolve requires a lockfile, that should be fine! (and skip that if resolves are not enabled, naturally) It’s just a matter of looking up the lockfile path for the each resolve.
(as was concluded in another thread, it wasn’t as easy to “abuse” the
_generator_sources_helper
explicitly in the BUILD file, as I can’t add the dependency in a clean way)
> I still have no idea how we’d solve it, but at least worth documenting as an issue
I can create a ticket later tonight (It’s a hassle to switch between GH accounts, as I have another one for iManage work)
https://github.com/pantsbuild/pants/pull/16934 @hundreds-father-404 I’d love some 👀 on this (when convenient), and would like picking to 2.14.x if at all possible 😉
h

hundreds-father-404

09/21/2022, 5:08 PM
thanks for working on this! that's really good polish
❤️ 1