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

Avo needs GOARCH to be set to find build-tagged stubs #450

Open
FiloSottile opened this issue Nov 6, 2024 · 0 comments
Open

Avo needs GOARCH to be set to find build-tagged stubs #450

FiloSottile opened this issue Nov 6, 2024 · 0 comments

Comments

@FiloSottile
Copy link

If you use Package and Implements calls to implement a stub, and the stub is only in a file tagged _amd64.go, generation will fail if run on e.g. darwin/arm64.

This can be worked around by simply adding the following two lines to main().

os.Setenv("GOOS", "linux")
os.Setenv("GOARCH", "amd64")

This is mostly an annoyance, but it could led to incorrect code being generated if a function with the same name but with different types is defined in a non-amd64 file which matches the host.

gopherbot pushed a commit to golang/go that referenced this issue Nov 6, 2024
They needed their package names updated after packages were moved to
crypto/internal/fips. Also, mitigated mmcloughlin/avo#450 which would
require setting GOARCH=amd64 at generation time.

Change-Id: Ib903ef113ebb5a24844204f231f2507cea03a67e
Reviewed-on: https://go-review.googlesource.com/c/go/+/626075
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Russ Cox <[email protected]>
Auto-Submit: Filippo Valsorda <[email protected]>
Reviewed-by: David Chase <[email protected]>
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

1 participant