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

import/path: issue title #69448

Closed
nolag opened this issue Sep 13, 2024 · 2 comments
Closed

import/path: issue title #69448

nolag opened this issue Sep 13, 2024 · 2 comments

Comments

@nolag
Copy link

nolag commented Sep 13, 2024

Go version

go1.22.7 WASM build not reproducible

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='wasm'
GOBIN=''
GOCACHE='/Users/<name>/Library/Caches/go-build'
GOENV='/Users/<name>/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/<name>/go/pkg/mod'
GONOPROXY='github.com/smartcontractkit/chainlink-dev'
GONOSUMDB='github.com/smartcontractkit/chainlink-dev'
GOOS='wasip1'
GOPATH='/Users/<name>/go'
GOPRIVATE='github.com/smartcontractkit/chainlink-dev'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/Users/<name>/sdk/go1.22.7'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/Users/<name>/sdk/go1.22.7/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.22.7'
GCCGO='gccgo'
GOWASM=''
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/Users/<name>/go/src/github.com/smartcontractkit/chainlink-common/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/nx/ky9rn7kd0v56h5kz679cfqy00000gn/T/go-build4181679374=/tmp/go-build -gno-record-gcc-switches'

What did you do?

This shell scrip was used to create a WASM binary that a test relies on.

I attempted to ensure that all the environment variables are identical so that the build is reproducible, but the WASM binaries differ. This discrepancy causes CI to fail because it detects the file as not being generated in the PR.

We need the build to be reproducible so we can use the hash as an identifier for the WASM binaries. I noticed that GOGCCFLAGS differs between my machine and the CI machine, but since CGO_ENABLED=0 and it’s WASM, I expected that to be irrelevant. I also tried setting the variable directly, but go env didn’t show it respecting the flags.

I’ve attached the output from go env on both my machine and the CI machine, as captured by the shell script.

Note: I’ve redacted my name from my go env.

env.mine.txt
env.pr.txt

What did you see happen?

When make generate is run in the PR, causing go generate to run the shell script, the produced binary is different than the one generated on my local machine. I've also had others attempt to generate the WASM, but theirs was different again.

What did you expect to see?

A reproducible build.

@seankhliao
Copy link
Member

consider flags like -trimpath.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants