Hi, I am kinda new to `pants`, and had a question ...
# general
s
Hi, I am kinda new to
pants
, and had a question about optionally doing builds during run time. So we have a repo that has Python and Go code, and we run one of the Python script in CI (Buildkite) using
pants
. But it fails while looking for Go binaries. Is there a way to tell
pants
to skip
Go
build during run time?
Copy code
./pants run <path to python file> --args1 args1
e
Do you want to turn off Go support completely for CI?
If so you could have a CI pants.toml override file you activate by having CI export `PANTS_CONFIG_FILES=pants.no-go.toml`:
Copy code
[GLOBAL]
backend_packages.remove = ["pants.backend.experimental.go"]
s
Just for that run.
e
Ok, you can do that then as a fairly ugly hack, but easy to implement and try real quick.
c
won’t that make pants choke on go targets then?
e
Damn Pants
I guess
c
had the same idea but no feasible work around.. would be nice perhaps with exposing a
--ignore-unknown-targets
flag..
e
I'd rather Pants didn't nanny quite so much, but since it does - yeah - maybe that.
The real fix here though is that Pants shouldn't need Go or any binaries if it doesn't actually use them. That seems like a bug.
c
yea
s
Agreed, I have to unnecessary blot the environment.
e
Maybe Pants does really use Go binaries as part of parsing BUILD somehow.
c
I think it is during parsing of dependencies or some such..
e
Dep inference
Yeah 😕
c
so there’s likely some too eager
AllTargets
-> Deps lookup going on..
e
This is apparently totally ad-hoc, not present for Go fwict, but: https://www.pantsbuild.org/docs/reference-scala-infer#imports
So if that sort of thing were around for Go, turning it off might work.
h
Yeah, I think this is due to needing to use go to parse .go files for dep inference, because as far as Pants knows, the python file might depend on a go file. But that is clearly silly, and we should have a way to not do this.