https://pantsbuild.org/ logo
#general
Title
# general
r

rapid-bird-79300

05/18/2022, 9:15 PM
Hey Pants Team, looking for some help debugging an issue with a go project with pants
2.11.0
. I recently upgraded my go version
1.17->1.18
and when running Pants I'm seeing this error:
Copy code
BinaryNotFoundError: Cannot find a `go` binary with the expected version of 1.18 (set by `[golang].expected_version`).

Found these `go` binaries, but they had different versions:

  * /usr/local/bin/go: 1.17

To fix, please install the expected version (<https://golang.org/doc/install>) and ensure that it is discoverable via the option `[golang].go_search_paths`, or change `[golang].expected_version`.
When inspecting the go version it seems to be correct
Copy code
$/usr/local/bin/go version
go version go1.18.2 darwin/amd64
Not sure if it's pants related at all but any help is appreciated
h

hundreds-father-404

05/18/2022, 9:17 PM
simply not good UX 😕 I fixed, but it's not in 2.11 https://github.com/pantsbuild/pants/pull/15306
looks like it's not until Pants 2.13, which hasn't had any release candidates yet
in the meantime, I recommend using a
.pants.rc
file to override this locally: https://www.pantsbuild.org/docs/options#pantsrc-file
👀 1
r

rapid-bird-79300

05/18/2022, 9:22 PM
but I'm not sure what I would change
golang.expected_version
to as it seems to be correct (1.18 which is installed) curious about this log line for the binary
* /usr/local/bin/go: 1.17
Pants is reporting
1.17
when the binary is
1.18
. Maybe I'm missing something else?
h

hundreds-father-404

05/18/2022, 9:23 PM
ohhhhh I see. Try
rm -rf .pids
👀 1
We memoize with Pantsd the discovery of binaries. It's not correct, we technically should rescan your machine every single run to see if binaries have changed But that is slow, so we make a tradeoff to only find binaries the first time the daemon runs
1
r

rapid-bird-79300

05/18/2022, 9:25 PM
that fixed it! Thank you @hundreds-father-404 that solution is totally okay if we see this again we'll start by nuking that directory first
❤️ 1