Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit cb76c75

Browse files
author
Mrinal Wahal
committed
removed syscall based silicon processor detection
2 parents bcba5b9 + e26e9a5 commit cb76c75

3 files changed

Lines changed: 20 additions & 22 deletions

File tree

.github/workflows/build.yaml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,29 @@ on: [push, pull_request]
66

77
jobs:
88
build:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v2
9+
name: Build
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
# build in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
14+
goos: [linux, windows, darwin]
15+
goarch: ["386", amd64, arm64]
16+
exclude:
17+
- goarch: "386"
18+
goos: darwin
19+
- goarch: arm64
20+
goos: windows
21+
steps:
22+
- name: Checkout Repository
23+
uses: actions/checkout@v2.3.4
1224

1325
- name: Set up Go
1426
uses: actions/setup-go@v2
1527
with:
16-
go-version: 1.16
28+
go-version: 1.16.5
1729

18-
- name: Install
19-
run: go get -v ./...
30+
- name: Install Dependencies
31+
run: go get
2032

2133
- name: Build
22-
run: go build -v ./...
34+
run: go build

nhost/nhost.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ func GenerateConfig(options App) Configuration {
972972
// Hasura's image is still not natively working on Apple Silicon.
973973
// If it's an Apple Silicon processor,
974974
// then add the custom Hasura image, as a temporary fix.
975-
if runningSilicon() {
975+
if runtime.GOOS == "darwin" && runtime.GOARCH == "arm64" {
976976
hasura.Image = "fedormelexin/graphql-engine-arm64"
977977
}
978978

nhost/utils.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"path/filepath"
99
"strconv"
1010
"strings"
11-
"syscall"
1211
"time"
1312
)
1413

@@ -74,16 +73,3 @@ func GetCurrentBranch() string {
7473
payload := strings.Split(string(data), " ")
7574
return strings.TrimSpace(filepath.Base(payload[1]))
7675
}
77-
78-
// Detects whether the host machine is running on Apple Silicon processor.
79-
func runningSilicon() bool {
80-
81-
r, err := syscall.Sysctl("sysctl.proc_translated")
82-
if err != nil {
83-
if err.Error() == "no such file or directory" {
84-
return false
85-
}
86-
}
87-
88-
return r == "\x00\x00\x00" || r == "\x01\x00\x00"
89-
}

0 commit comments

Comments
 (0)