Shopify / themekit

Shopify theme development command line tool.
https://shopify.dev/tools/theme-kit
MIT License
1.19k stars 374 forks source link

Compile themekit for M1 Macs #971

Open adrianocr opened 2 years ago

adrianocr commented 2 years ago

Is your feature request related to a problem? Please describe. Currently themekit on Macs is limited to amd64 which runs OK-ish within Rosetta but performance is not great and I've had several console errors related to timed out deployments.

Describe the solution you'd like Add darwin/arm64 to list of binaries to build

Additional context I managed to compile it myself but ran into an issue with Go 1.18 due to an apparent issue with golang.org/x/sys/unix. The errors were:

../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:28:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:43:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:59:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:75:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:90:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:105:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:121:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:136:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:151:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:166:3: //go:linkname must refer to declared function or variable
../../go/pkg/mod/golang.org/x/sys@v0.0.0-20190412213103-97732733099d/unix/zsyscall_darwin_arm64.go:166:3: too many errors

So I installed a separate copy of Go 1.16.10 and compilation worked fine. Inside the themekit directory running export GOOS=darwin GOARCH=arm64 && ~/go/bin/go1.16.10 build -o theme cmd/theme/main.go correctly compiles a themekit binary which the command ./theme version outputs the response ThemeKit 1.3.0 darwin/arm64

rmontero commented 11 months ago

Bump this up.