loud-laptop-17949
12/14/2021, 10:59 PMProcessExecutionFailure: Process 'Run `go list` to download and analyze all third-party Go packages' failed with exit code 1. ...
...
go: updates to go.mod needed, disabled by -mod=readonly; to update it:
go mod tidy
Yet go list
on its own doesn't cause errors. And go mod tidy
doesn't show any changes.hundreds-father-404
12/14/2021, 11:03 PMgo mod download all
and go mod tidy
? We found it's sometimes necessary to run both
We know this error message is confusing https://github.com/pantsbuild/pants/issues/13136hundreds-father-404
12/14/2021, 11:03 PMloud-laptop-17949
12/14/2021, 11:04 PM$ go version
go version go1.17.5 darwin/amd64
loud-laptop-17949
12/14/2021, 11:05 PMgo mod download all
and go mod tidy
and same resultfast-nail-55400
12/14/2021, 11:08 PMgo mod download all
fast-nail-55400
12/14/2021, 11:08 PMhundreds-father-404
12/14/2021, 11:08 PMgo.mod
for you...
So I think the next best thing to debug would be using --no-process-cleanup
(--no-process-execution-local-cleanup
if on Pants 2.8). It will log something like this:
16:06:37.48 [INFO] Preserving local process execution dir /private/var/folders/g7/0lj2pw4d6db67tm8m8xj0rc80000gn/T/process-execution5P1osZ for "Run `go list` to download testprojects/src/go/go.mod"
If you cd there, you can modify the __run.sh
script to not use -mod=readonly
and see how it changes the go.mod
loud-laptop-17949
12/14/2021, 11:55 PMloud-laptop-17949
12/14/2021, 11:55 PMfast-nail-55400
12/14/2021, 11:56 PMfast-nail-55400
12/14/2021, 11:56 PM-ldebug
for debug loggingloud-laptop-17949
12/14/2021, 11:57 PM$ sh __run.sh
go: updates to go.mod needed; to update it:
go mod tidy
loud-laptop-17949
12/14/2021, 11:58 PMloud-laptop-17949
12/15/2021, 12:00 AMfast-nail-55400
12/15/2021, 12:02 AMloud-laptop-17949
12/15/2021, 12:20 AMfast-nail-55400
12/15/2021, 1:04 AMfast-nail-55400
12/15/2021, 1:07 AMmain
branch.)fast-nail-55400
12/15/2021, 3:57 AMgo list -e -json -mod=mod ...
updates the go.mod to include indirect depsfast-nail-55400
12/15/2021, 4:00 AMgo mod tidy
was not helpful because my minimal module caused tidy
to remove all unused modules (i.e., all of them)hundreds-father-404
12/15/2021, 4:18 AMgo mod download all
still not do the trick?hundreds-father-404
12/15/2021, 4:19 AMfast-nail-55400
12/15/2021, 4:22 AMgo mod download all
filled in some missing go.sum
entries but it didn’t add indirect modules to the go.mod
fast-nail-55400
12/15/2021, 4:22 AMgo-resolve
goal to handle this for the userhundreds-father-404
12/15/2021, 4:57 AMhundreds-father-404
12/15/2021, 4:58 AMloud-laptop-17949
12/15/2021, 10:26 PMloud-laptop-17949
12/16/2021, 10:21 PMgo mod tidy
. If I ignore that and run go mod download all
some entries get added to go.sum, but when running pants I still get the error telling me to run go mod tidy
, which removes the entries added by download all
.hundreds-father-404
12/16/2021, 10:23 PMgo list -e -mod=mod ...
?loud-laptop-17949
12/16/2021, 10:27 PMloud-laptop-17949
12/16/2021, 10:27 PMhundreds-father-404
12/16/2021, 10:28 PM// indirect
entries to go.mod
than you'd normally haveloud-laptop-17949
12/16/2021, 10:33 PMloud-laptop-17949
12/16/2021, 10:34 PMdownload all
go list -e -mod=mod ...
updated go.mod, not just go.sum. maybe that is my problem?hundreds-father-404
12/16/2021, 10:34 PMgo mod download all
and go list
will update go.sum
the same way. The only difference otherwise is that go list
adds more indirect entries to go.mod
But yeah, this is all so confusing and I agree with Tom that we should have Pants manage this all for youfast-nail-55400
12/17/2021, 12:23 AMgo build
doesn’t seem to add these entries when run outside of Pantsfast-nail-55400
12/17/2021, 12:23 AMgo list
to analyze third-party dependenciesloud-laptop-17949
01/04/2022, 9:54 PMhundreds-father-404
01/04/2022, 9:57 PMgo list ...
hundreds-father-404
01/04/2022, 9:59 PMloud-laptop-17949
01/04/2022, 10:02 PMgo mod tidy
to be runloud-laptop-17949
01/04/2022, 10:02 PMloud-laptop-17949
01/04/2022, 10:02 PMhundreds-father-404
01/04/2022, 10:04 PMhundreds-father-404
01/04/2022, 10:26 PMloud-laptop-17949
01/05/2022, 12:39 AMloud-laptop-17949
01/05/2022, 12:39 AMgo list -f "{{.ImportPath}} {{.Deps}}" ./...