这是indexloc提供的服务,不要输入任何密码
Skip to content

Use CGO on macOS M1 darwin-arm64 #985

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 2 commits into from
Apr 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,22 @@ platform-unixlike:
cd "$(NPMDIR)" && npm version "$(TURBO_VERSION)" --allow-same-version
CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/turbo" ./cmd/turbo

# To fix https://github.com/vercel/turborepo/issues/941 (DNS issue),
# we compile the darwin-arm64 binary with CGO_ENABLED=1 on an macOS M1
platform-unixlike-cgo:
test -n "$(GOOS)" && test -n "$(GOARCH)" && test -n "$(NPMDIR)"
mkdir -p "$(NPMDIR)/bin"
cd "$(NPMDIR)" && npm version "$(TURBO_VERSION)" --allow-same-version
CGO_ENABLED=1 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/turbo" ./cmd/turbo

platform-android-arm64:
make GOOS=android GOARCH=arm64 NPMDIR=npm/turbo-android-arm64 platform-unixlike

platform-darwin:
make GOOS=darwin GOARCH=amd64 NPMDIR=npm/turbo-darwin-64 platform-unixlike

platform-darwin-arm64:
make GOOS=darwin GOARCH=arm64 NPMDIR=npm/turbo-darwin-arm64 platform-unixlike
make GOOS=darwin GOARCH=arm64 NPMDIR=npm/turbo-darwin-arm64 platform-unixlike-cgo

platform-freebsd:
make GOOS=freebsd GOARCH=amd64 NPMDIR=npm/turbo-freebsd-64 platform-unixlike
Expand Down