Is there any way to avoid pants analyzing a bunch ...
# general
p
Is there any way to avoid pants analyzing a bunch of go dependencies whenever it starts if I'm not actually trying to do anything with the,m?
h
Are you running whole repo commands? Or is your command line focused on just python code, say?
p
I was building some docker images, but they should not have any dependency on the go code
I do not see any go deps in
pants dependencies --dependencies-transitive docker/dashboard
either
e.g.
Copy code
$ pants -ldebug package docker/dashboard
15:50:50.34 [INFO] Initialization options changed: reinitializing scheduler...
15:50:59.62 [INFO] Scheduler initialized.
⠒ 0.58s Scheduling: Download Go module <http://github.com/tdewolff/parse/v2@v2.6.4|github.com/tdewolff/parse/v2@v2.6.4>.
c
hmm.. could be if some rule asks for
AllTargets
that could explain it..
p
I still see it on a smaller set of rules, e.g.
Copy code
$ pants -ldebug package ux:dashboard
16:15:12.11 [WARN] DEPRECATED: Not explicitly providing [python-infer].use_rust_parser is scheduled to be removed in version 2.18.0.dev0.

Read the help for [python-infer].use_rust_parser <<https://www.pantsbuild.org/v2.17/docs/reference-python-infer#use_rust_parser>>, then set the value in pants.toml.
⠋ 0.85s Scheduling: Download Go module <http://github.com/gin-gonic/gin@v1.8.1|github.com/gin-gonic/gin@v1.8.1>.
Interrupted by user.
tried some other unrelated python targets too
h
Yeah, the way dep inference works, it analyzes all sources to find out what they provide. There is currently no logic to say "in practice go will never provide deps to be consumed by Python"
This is something we should add though
Some concept of "realms"
that only interact via explicit deps
p
Is there some equivalent of lockfiles for go that would make this fast?
eg I did not notice this sort of thing when I added some Java code, presumably because that has lockfiles
h
I think the go backend has to analyze 3rdparty source code to figure out what it provides, whereas with JVM and Python that information comes from metadata. @fast-nail-55400 is the expert here though.