https://pantsbuild.org/ logo
d

damp-easter-17791

11/02/2019, 6:04 PM
Alternatively, is there a way to pass in a large argument list via text file? If I compute the list of transitive dependencies and run
./pants compile $TRANSITIVE_TARGETS
then the argument is too long
a

aloof-angle-91616

11/02/2019, 6:10 PM
--target-spec-file
!
d

damp-easter-17791

11/02/2019, 6:11 PM
should that file contain line separated arguments?
a

aloof-angle-91616

11/02/2019, 6:11 PM
yes!
d

damp-easter-17791

11/02/2019, 6:11 PM
sweet!
will pants be OK if I call
./pants compile ...
with thousands of targets?
a

aloof-angle-91616

11/02/2019, 6:11 PM
you can use
diff
or
comm
to diff the output of
dependencies
and
list
but i assume you’ve figured that out
yes!!! i recommend gnu parallel to shard large target lists
d

damp-easter-17791

11/02/2019, 6:12 PM
I already ran pants export, so I have the list of transitive deps
a

aloof-angle-91616

11/02/2019, 6:12 PM
but pants can be run with that
ok, that should work great!
d

damp-easter-17791

11/02/2019, 6:12 PM
nice, thanks
will give it a try
a

aloof-angle-91616

11/02/2019, 6:12 PM
let me know! about to start watching a movie so gone for two hours but back after
d

damp-easter-17791

11/02/2019, 6:12 PM
will do
❤️ 1
@aloof-angle-91616 how exactly is the syntax?
/pants compile --target-spec-file=args.txt
?
a

aloof-angle-91616

11/02/2019, 6:18 PM
yes, you may need to place it at the front of the command line. typically arguments immediately after a goal name such as
compile
are interpreted as options within the scope of that goal
d

damp-easter-17791

11/02/2019, 6:18 PM
that works! 🎉
🔥 1
a

aloof-angle-91616

11/02/2019, 6:19 PM
let us know if you have further questions!!
d

damp-easter-17791

11/02/2019, 6:28 PM
I'm getting "Build graph construction failed"
I'll just compile everything, will try to figure out another time how to skip compiling the actual targets
Thank you for the help!
a

aloof-angle-91616

11/02/2019, 10:12 PM
i’m sorry!! that usually happens when invalid target specs are added, or when a target’s definition is invalid (pants will lazily crawl the filesystem to parse BUILD files). if you post the stacktrace we can debug — sorry for the confusing error message!
d

damp-easter-17791

11/03/2019, 5:39 PM
It's fine, the approach to extract the dependency targets was quite hacky
compiling everything is working great for now, would be nice to avoid the redundant compilation in the future with
--query
a

aloof-angle-91616

11/03/2019, 11:08 PM
it's possible i may be able to work on that earlier than expected if it's relevant for IDE responsiveness
4 Views