I had a similar issue [1] that I resolved by running Brian's shell one-liner. However, it also deleted a bunch of checked-in vendor directories, which is presumably undesirable.
> I thought there was a clean gradle target already, for the go gradle plugin. But that's probably mistaken. `./gradlew sdks:go:clean` didn't work for me, although maybe there is some other `clean` task specific to Go? > Can we have a custom error message on the gradle resolve target with a suggested fix? That'd be ideal, but it might be hard to distinguish a stale cache from a legitimate Go build error introduced by the developer. So maybe a qualified message like "If you don't think this error is your fault, try <gradle command>" [1] https://issues.apache.org/jira/browse/BEAM-9690 On Mon, Jul 27, 2020 at 2:10 PM Robert Burke <rob...@frantil.com> wrote: > I thought there was a clean gradle target already, for the go gradle > plugin. But that's probably mistaken. > > The correct answer is to probably provide both. The more direct > documentation of the solution and the attempt to automate it. > > Any suggestions about where to put auch documentation? Should it it be in > the sdks/go/README.md and also somewhere on the wiki? > > The hardest part of documenting this is discovery. Can we have a custom > error message on the gradle resolve target with a suggested fix? > > On Mon, Jul 27, 2020, 1:52 PM Robert Bradshaw <rober...@google.com> wrote: > >> Is this documented somewhere (other than now here)? Maybe we should make >> a "clean" gradle target for this? >> >> On Fri, Jul 24, 2020 at 7:19 PM Robert Burke <rob...@frantil.com> wrote: >> >>> Yup that is and always has been the right answer. >>> >>> I can't look up the JIRA right now but once I've finished schemas, the >>> plan is to get Go Modules working which will be a much more reliable >>> solution. >>> >>> On Fri, Jul 24, 2020, 5:19 PM Brian Hulette <bhule...@google.com> wrote: >>> >>>> Spoke with Daniel about this offline and he suggested deleting all the >>>> vendor directories. I ran `find . -name vendor | xargs -I{} rm -rf {}` from >>>> my Beam clone and all is well now. >>>> >>>> On Fri, Jul 24, 2020 at 11:13 AM Brian Hulette <bhule...@google.com> >>>> wrote: >>>> >>>>> I tried removing every .gogradle directory in Beam, as well >>>>> as ~/.cache/go-build and ~/.gradle/go/repo but it's still happening. Maybe >>>>> there's some other cache I'm missing? I also synced past >>>>> https://github.com/apache/beam/pull/12364 in case it was related. >>>>> >>>>> I thought maybe others were having the same issue but I guess this is >>>>> a problem unique to me. >>>>> >>>>> On Thu, Jul 23, 2020 at 6:33 PM Daniel Oliveira < >>>>> danolive...@google.com> wrote: >>>>> >>>>>> It looks like the cached version of a package is stale and causing >>>>>> build errors when building beam. Chances are just deleting that >>>>>> /.gogradle directory will cause everything to rebuild from a clean state, >>>>>> so I'd try that. I think it should be /sdks/go/.gogradle >>>>>> >>>>>> On Thu, Jul 23, 2020 at 4:56 PM Ahmet Altay <al...@google.com> wrote: >>>>>> >>>>>>> This is probably : https://issues.apache.org/jira/browse/BEAM-10567 >>>>>>> <https://issues.apache.org/jira/browse/BEAM-10567#> >>>>>>> >>>>>>> On Thu, Jul 23, 2020 at 4:53 PM Brian Hulette <bhule...@google.com> >>>>>>> wrote: >>>>>>> >>>>>>>> Whenever I build a container locally >>>>>>>> (:sdks:java:container:docker, :sdks:python:container:py37:docker, ..) >>>>>>>> I get >>>>>>>> a Go error (log at the end of this message). >>>>>>>> >>>>>>>> I've discovered I can just comment >>>>>>>> out resolveBuildDependencies.dependsOn ":sdks:go:goBuild" in the >>>>>>>> relevant >>>>>>>> build.gradle file [1] whenever this happens, but it's getting old and >>>>>>>> I'm >>>>>>>> wondering if there's a better way. Is there something wrong with my >>>>>>>> environment that's causing these errors (It must not be an actual >>>>>>>> breakage >>>>>>>> in the Go SDK)? Can we remove or modify this statement to fix this? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Brian >>>>>>>> >>>>>>>> [1] >>>>>>>> https://github.com/apache/beam/blob/59b7200c8621b81804d53ded771fd3aa525fbb47/sdks/java/container/build.gradle#L32 >>>>>>>> >>>>>>>> # github.com/apache/beam/sdks/go/test/integration/synthetic >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:31:31: >>>>>>>> cannot use s (type " >>>>>>>> github.com/apache/beam/sdks/go/test/vendor/github.com/apache/beam/sdks/go/pkg/beam".Scope) >>>>>>>> as type "github.com/apache/beam/sdks/go/pkg/beam".Scope in >>>>>>>> argument to synthetic.SourceSingle >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:33:24: >>>>>>>> cannot use s (type " >>>>>>>> github.com/apache/beam/sdks/go/test/vendor/github.com/apache/beam/sdks/go/pkg/beam".Scope) >>>>>>>> as type "github.com/apache/beam/sdks/go/pkg/beam".Scope in >>>>>>>> argument to synthetic.Step >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:34:2: >>>>>>>> undefined: passert.Count >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:51:25: >>>>>>>> cannot use s (type " >>>>>>>> github.com/apache/beam/sdks/go/test/vendor/github.com/apache/beam/sdks/go/pkg/beam".Scope) >>>>>>>> as type "github.com/apache/beam/sdks/go/pkg/beam".Scope in >>>>>>>> argument to synthetic.Source >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:51:25: >>>>>>>> cannot use configs (type " >>>>>>>> github.com/apache/beam/sdks/go/test/vendor/github.com/apache/beam/sdks/go/pkg/beam".PCollection) >>>>>>>> as type "github.com/apache/beam/sdks/go/pkg/beam".PCollection in >>>>>>>> argument to synthetic.Source >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:52:24: >>>>>>>> cannot use s (type " >>>>>>>> github.com/apache/beam/sdks/go/test/vendor/github.com/apache/beam/sdks/go/pkg/beam".Scope) >>>>>>>> as type "github.com/apache/beam/sdks/go/pkg/beam".Scope in >>>>>>>> argument to synthetic.Step >>>>>>>> .gogradle/project_gopath/src/ >>>>>>>> github.com/apache/beam/sdks/go/test/integration/synthetic/synthetic.go:61:2: >>>>>>>> undefined: passert.Count >>>>>>>> >>>>>>>> > Task :sdks:go:buildLinuxAmd64 FAILED >>>>>>>> >>>>>>>