Skip to content

use linux/amd64 platform when running on M1 macs #10

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

Merged
merged 4 commits into from
Mar 1, 2022
Merged

use linux/amd64 platform when running on M1 macs #10

merged 4 commits into from
Mar 1, 2022

Conversation

zerowidth
Copy link
Member

@zerowidth zerowidth commented Mar 1, 2022

This doesn't work on M1 macs:

$ go run github.com/github/proto-gen-go@v1.1.0
proto-gen-go: building protoc container image...
proto-gen-go: protoc
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory
proto-gen-go: protoc command failed: exit status 255
exit status 1

This PR adds --platform=linux/amd64 when it detects it's running on an M1.

After:

$ go run .
proto-gen-go: building protoc container image...
proto-gen-go: protoc
Usage: /usr/local/bin/protoc [OPTION] PROTO_FILES
[...]

An alternative might be trying an arm64-specific base image, but I wasn't able to figure that out.

@zerowidth zerowidth requested a review from adonovan March 1, 2022 20:39
@adonovan adonovan merged commit 39c4271 into github:main Mar 1, 2022
@zerowidth zerowidth deleted the m1-support branch March 1, 2022 21:29
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

Successfully merging this pull request may close these issues.

2 participants