0

After upgrading google-cloud-sdk from 422.0.0 to 423.0.0, my Go standard environment project suddenly no longer builds (I've replaced references to my checkout directory with <path> below, I get the same error no matter where it is checked out):

------------------------------------ STDERR ------------------------------------
2023/04/03 13:29:36 staging for go1.19
2023/04/03 13:29:36 GO111MODULE=off, so building with dependencies from GOPATH
main-package: web
2023/04/03 13:29:36 Staging app (GOPATH mode): failed analyzing <path>/src/web: no buildable Go source files in <path>/src/google.golang.org/api/transport/http/internal/propagation
GOPATH: <path>
--------------------------------------------------------------------------------

I deply with the following command (variables are set in the build script):

GOPATH=$GOPATH GO111MODULE=off gcloud app deploy --project $PROJECT --version $VERSION index.yaml app.yaml

I tried reading through the Google Cloud CLI release notes but couldn't find anything that seems to relate to any changes.

There are two .go files in the directory it claims "no buildable Go files" in, from the upstream project:

$ ls -1 <path>/src/google.golang.org/api/transport/http/internal/propagation
http.go
http_test.go
nafmo
  • 448
  • 4
  • 19
  • Considering you have dependencies which require modules I'm surprised that trying to build from `GOPATH` works at all. Why are you trying to use `GO111MODULE=off` and how are you setting up `GOPATH` with all the correct dependencies transitively defined in modules? Can you build this as a proper module in the first place? – JimB Apr 03 '23 at 14:09
  • Up until recently, I was building with Go 1.11 (and before that an earlier version) without go.mod support. I have not been able to [port it over to using go.mod](https://stackoverflow.com/q/75671494/2501078), but I have never had problems building before the recent SDK update. My next step will have to be to try to locate all the intermediate versions to see exactly which SDK update breaks the build. – nafmo Apr 03 '23 at 14:24
  • 1
    Building with GOPATH was deprecated over 4 years ago now, and the problems you are having are part of why modules exist in the first place. I would focus on getting the module build running with a supported version of Go, rather than dragging this out for even longer. – JimB Apr 03 '23 at 14:28
  • Well, getting gcloud to behave in go.mod mode is another issue that I am already working on, but not the one I have here. – nafmo Apr 03 '23 at 14:50

0 Answers0