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

aloof-angle-91616

05/13/2019, 3:42 PM
@witty-crayon-22786 @average-vr-56795 any idea why a sources snapshot would return the empty digest on a target i've created with
self.add_to_build_file()
in a
ConsoleRuleTestBase
? i'm going to have to table working on this for now, but the
@console_rule
itself works, and the testing should too, i just haven't had time to dive into how to get my file contents into the sources snapshot. https://github.com/pantsbuild/pants/pull/7419
a

average-vr-56795

05/13/2019, 3:44 PM
Can you point me at a call to
.target
that’s the one that’s failing in that PR?
a

aloof-angle-91616

05/13/2019, 3:45 PM
the command line i posted with the
-k
will drop you into a pdb prompt which should show a mock target successfully created and accessible within a rule, but the sources snapshot is the empty digest
a

average-vr-56795

05/13/2019, 3:46 PM
Aha, there’s a comment on the PR!
a

aloof-angle-91616

05/13/2019, 3:46 PM
yes!
oh darn i meant to link to that
thank you
(i didn't mention the pdb prompt on the PR though oops)
a

average-vr-56795

05/13/2019, 3:52 PM
My guess is it’s because you’re using
create_workdir_file
to make the thrift file, where you want to be using
create_file
Because
workdir
means “directory where pants stores some stuff” not “working directory”
a

aloof-angle-91616

05/13/2019, 6:01 PM
hmmmmm
this is
quite reasonable
won't be working on that today but it gives me an easy thing to come back to tonight