https://pantsbuild.org/ logo
#development
Title
# development
w

wide-midnight-78598

04/10/2023, 7:00 PM
@curved-television-6568 While this may become moot in a couple weeks/months, was there a way to extract the BUILD file where a target is defined, via peek?
c

curved-television-6568

04/10/2023, 7:07 PM
you can deduce it somewhat reliably off of the target address I believe.. but that’s a bit hacky at best
the code that added the BUILD file source origin for a target is not yet merged. There’s merge conflicts on my PR for that which I’ve begun looking into..
w

wide-midnight-78598

04/10/2023, 7:09 PM
you can deduce it somewhat reliably off of the target address I believe
I think that only works in the 111
the code that added the BUILD file source origin for a target is not yet merged.
Ah okay, this is what I had in my head, wasn't sure whether I was rememebring this
c

curved-television-6568

04/10/2023, 7:10 PM
I think you get
src/foo/bar/baz.py:../../target-name
in case you have a greedy glob at a root.
where the number of
../
will be indicative of where the BUILD file is
👀 1
w

wide-midnight-78598

04/10/2023, 7:12 PM
where the number of
../
will be indicative of where the BUILD file is
Oh wow, those were sitting in front of me, and my brain didn't even register the dots 🤯
😄 1
Ah, wait, that’s right - I think I tried using the relative target name in suspenders, but one of the hiccups came from build file naming
DOes the new PR include the file name?
c

curved-television-6568

04/11/2023, 3:28 PM
yep, the filename is in there. also made a change so the filename is kept separate from the line number for use in peek output
w

wide-midnight-78598

04/11/2023, 3:40 PM
Ooooh, line number, you say…. 😋
Would be great to be able to jump straight to the correct target in the build file
👍 1
c

curved-television-6568

04/11/2023, 3:48 PM
just need that PR 18366 reviewed so we can proceed with the peek changes
w

wide-midnight-78598

04/11/2023, 4:05 PM
That’s a hefty PR. I’ll be free to look at some PRs this weekend, but that’s also entirely out of my knowledge base
😁 1