prototool icon indicating copy to clipboard operation
prototool copied to clipboard

Support Apple arm64 arch

Open zephyrpathsofglory opened this issue 4 years ago • 9 comments

when I run prototool generate in my Macbook pro M1 chip, it prints unsupported value for runtime.GOARCH: arm64, then I searched the repo and found this function in internal/protoc/downloader.go:

func getUnameSUnameMPaths(goos string, goarch string) (string, string, error) {
	var unameS string
	switch goos {
	case "darwin":
		unameS = "Darwin"
	case "linux":
		unameS = "Linux"
	default:
		return "", "", fmt.Errorf("unsupported value for runtime.GOOS: %v", goos)
	}
	var unameM string
	switch goarch {
	case "amd64":
		unameM = "x86_64"
	default:
		return "", "", fmt.Errorf("unsupported value for runtime.GOARCH: %v", goarch)
	}
	return unameS, unameM, nil
}

So I guess it is a bug of prototool and composed this issue to ask for some help.

zephyrpathsofglory avatar Feb 18 '21 07:02 zephyrpathsofglory

The same problem

jinsuojinsuo avatar Apr 19 '21 02:04 jinsuojinsuo

forgot about mac m1 users ?

totmaxim avatar Jun 30 '21 11:06 totmaxim

Facing the same issue, is there any workaround until this is fixed?

mehuled avatar Jul 07 '21 07:07 mehuled

Facing the same issue, is there any workaround until this is fixed?

In my case, I just add arm64 to the switch. Works for me.

https://github.com/hanksudo/prototool/commit/3086a4b512489fd4bb77d4f0377a961047925bd7

hanksudo avatar Jul 07 '21 14:07 hanksudo

Any updates on this one?

ddiaz914 avatar Oct 06 '21 14:10 ddiaz914

Seems like protobuf is not publishing precompiled binaries for Apple ARM machines yet. More details here https://github.com/protocolbuffers/protobuf/issues/8428

shettyh avatar Oct 07 '21 03:10 shettyh

Seems like protobuf now supports apple arm. I'd really like to use the prototool docker image on apple silicon (though that would mean linux arm, not apple arm)! Currently, with rosetta2, it's not possible to use it. qemu throws a segfault.

qemu: uncaught target signal 11 (Segmentation fault) - core dumped

freisenhauer avatar Nov 16 '21 08:11 freisenhauer

I still get the same error

peterdemartini avatar Jan 21 '22 17:01 peterdemartini

I was looking for solution and found this https://hub.docker.com/r/decoder89/prototool-m1/tags Works for me

hsqds avatar Feb 04 '22 08:02 hsqds