-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: running go generate
with go tool with _same_ GOROOT fails
#43369
Comments
A workaround? to fix this problem is: $ pwd # /Users/furkan/go/src/goroot
$ cd ./src
$ ./make.bash
$ ../bin/go generate -v . # this usage not works at all
$ ../bin/go generate ./cmd/compile/internal/gc/syntax.go # this works well |
CC @matloob |
Change https://golang.org/cl/280252 mentions this issue: |
Change https://golang.org/cl/280572 mentions this issue: |
The stringer using `go list` for the type detection, which depends on GOROOT. Unfortunally by changing GOROOT to develop path will raise version mismatch with internal packages. Update #43369 Change-Id: Id81334ea5f1ecdbfa81eb2d162944d65664ce727 Reviewed-on: https://go-review.googlesource.com/c/go/+/280572 Trust: Meng Zhuo <mzh@golangcn.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Change https://golang.org/cl/280635 mentions this issue: |
During recent refactoring, we moved mkbuiltin.go to package typecheck, but accidentally duplicated its //go:generate directive into a bunch of other files/directories. This CL cleans up the unnecessary duplicates. Also, update all of the stringer invocations to use an explicit file name, and regenerate their files. Updates #43369. Change-Id: I4e493c1fff103d742de0a839d7a3375659270b50 Reviewed-on: https://go-review.googlesource.com/c/go/+/280635 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Meng Zhuo <mzh@golangcn.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Meng Zhuo <mzh@golangcn.org>
I see you mentioned #32724, but how is this issue different from that one? I see the title is different, but the steps in "What did you do?" seem to be the same. Also, what does |
Could it be that you're running into #42563 and |
I tried with |
If Some things that might be going wrong:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, commit: b116404
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
$ pwd #/Users/furkan.turkal/go/src/goroot
)$ cd src/cmd/compile/internal/gc
syntax.go
to add a new AST node typeOFOOBAR
$ go generate
What did you expect to see?
Expected
op_string.go
to be updated with the new node type.$ go generate syntax.go
No errors, but the generated
op_string.go
does not have the new node type.What did you see instead?
Expected the new node type to appear in
op_string.go
after running$ go generate
Ref: #32724
CC: @bcmills @ianlancetaylor
The text was updated successfully, but these errors were encountered: