Alternatively, is there a way to pass in a large a...
# general
d
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
--target-spec-file
!
d
should that file contain line separated arguments?
a
yes!
d
sweet!
will pants be OK if I call
./pants compile ...
with thousands of targets?
a
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
I already ran pants export, so I have the list of transitive deps
a
but pants can be run with that
ok, that should work great!
d
nice, thanks
will give it a try
a
let me know! about to start watching a movie so gone for two hours but back after
d
will do
❤️ 1
@aloof-angle-91616 how exactly is the syntax?
/pants compile --target-spec-file=args.txt
?
a
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
that works! 🎉
🔥 1
a
let us know if you have further questions!!
d
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
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
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
it's possible i may be able to work on that earlier than expected if it's relevant for IDE responsiveness