Skip to content
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: can not output ssa.html file after remove it manually with GOSSAFUNC flag set #40465

Closed
feilengcui008 opened this issue Jul 29, 2020 · 2 comments

Comments

@feilengcui008
Copy link
Contributor

feilengcui008 commented Jul 29, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.6 linux/amd64

Does this issue reproduce with the latest release?

Yes,with the latest release go1.14.6

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN="/home/tanhongfei/me/workspace/src/go/bin"
GOCACHE="/home/tanhongfei/.cache/go-build"
GOENV="/home/tanhongfei/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tanhongfei/me/workspace/src/go:/home/tanhongfei/me/workspace/go/src/k8s.io/kubernetes/staging"
GOPRIVATE=""
GOPROXY="https://goproxy.cn/"
GOROOT="/home/tanhongfei/me/software/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/tanhongfei/me/software/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build390604943=/tmp/go-build"

What did you do?

  1. generate ssa.html file with command env GOSSAFUNC=test go build main.go for the following code:
package main
import (
    "fmt"
)
func test() {
    fmt.Println("hello, world!")
}
func main() {
    test()
}
  1. remove ssa.html

  2. run env GOSSAFUNC=test go build main.go again

extra infomation:
env GOSSAFUNC=test go run/install main.go has the same problem.
env GOSSAFUNC=test go build/run/install -a main.go will work correctly with "-a" flag
env GOSSAFUNC=test go tool compile main.go will work correctly
I guess it is related to the cache mechanism of "go" command, using "go tool compile" or with "-a" flag(force rebuild) will work correctly.

What did you expect to see?

generate ssa.html file again in the current directory

What did you see instead?

output with the following message, but no ssa.html file is generated in the current directory

# command-line-arguments
dumped SSA to ./ssa.html
@cuonglm
Copy link
Member

cuonglm commented Jul 29, 2020

I think this is duplicated of #31290

@cagedmantis
Copy link
Contributor

This does indeed seem like a duplicate of #31290. Please feel free to contribute and follow-up with that issue. If you think this issue was closed in error, please respond.

@golang golang locked and limited conversation to collaborators Jul 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants