Skip to content

Commit 35af236

Browse files
committed
Added arm64 support
Fix arduino#203
1 parent fdfe999 commit 35af236

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Diff for: arduino/cores/tools.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"github.com/arduino/arduino-cli/arduino/resources"
2525
"github.com/arduino/go-paths-helper"
2626
properties "github.com/arduino/go-properties-orderedmap"
27-
"go.bug.st/relaxed-semver"
27+
semver "go.bug.st/relaxed-semver"
2828
)
2929

3030
// Tool represents a single Tool, part of a Package.
@@ -141,13 +141,14 @@ func (tr *ToolRelease) RuntimeProperties() *properties.Map {
141141
}
142142

143143
var (
144-
regexpArmLinux = regexp.MustCompile("arm.*-linux-gnueabihf")
145-
regexpAmd64 = regexp.MustCompile("x86_64-.*linux-gnu")
146-
regexpi386 = regexp.MustCompile("i[3456]86-.*linux-gnu")
147-
regexpWindows = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
148-
regexpMac64Bit = regexp.MustCompile("(i[3456]86|x86_64)-apple-darwin.*")
149-
regexpmac32Bit = regexp.MustCompile("i[3456]86-apple-darwin.*")
150-
regexpArmBSD = regexp.MustCompile("arm.*-freebsd[0-9]*")
144+
regexpArmLinux = regexp.MustCompile("arm.*-linux-gnueabihf")
145+
regexpArm64Linux = regexp.MustCompile("(aarch64|arm64)-linux-gnu")
146+
regexpAmd64 = regexp.MustCompile("x86_64-.*linux-gnu")
147+
regexpi386 = regexp.MustCompile("i[3456]86-.*linux-gnu")
148+
regexpWindows = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
149+
regexpMac64Bit = regexp.MustCompile("(i[3456]86|x86_64)-apple-darwin.*")
150+
regexpmac32Bit = regexp.MustCompile("i[3456]86-apple-darwin.*")
151+
regexpArmBSD = regexp.MustCompile("arm.*-freebsd[0-9]*")
151152
)
152153

153154
func (f *Flavor) isCompatibleWithCurrentMachine() bool {
@@ -162,6 +163,8 @@ func (f *Flavor) isCompatibleWith(osName, osArch string) bool {
162163
switch osName + "," + osArch {
163164
case "linux,arm", "linux,armbe":
164165
return regexpArmLinux.MatchString(f.OS)
166+
case "linux,arm64":
167+
return regexpArm64Linux.MatchString(f.OS)
165168
case "linux,amd64":
166169
return regexpAmd64.MatchString(f.OS)
167170
case "linux,386":

Diff for: arduino/cores/tools_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func TestFlavorCompatibility(t *testing.T) {
3434
linuxamd64 := &os{"linux", "amd64"}
3535
linuxarm := &os{"linux", "arm"}
3636
linuxarmbe := &os{"linux", "armbe"}
37+
linuxarm64 := &os{"linux", "arm64"}
3738
darwini386 := &os{"darwin", "386"}
3839
darwinamd646 := &os{"darwin", "amd64"}
3940
freebsdi386 := &os{"freebsd", "386"}
@@ -45,6 +46,7 @@ func TestFlavorCompatibility(t *testing.T) {
4546
linuxamd64,
4647
linuxarm,
4748
linuxarmbe,
49+
linuxarm64,
4850
darwini386,
4951
darwinamd646,
5052
freebsdi386,
@@ -74,6 +76,8 @@ func TestFlavorCompatibility(t *testing.T) {
7476
{&Flavor{OS: "i686-pc-linux-gnu"}, []*os{linuxi386}},
7577
{&Flavor{OS: "x86_64-linux-gnu"}, []*os{linuxamd64}},
7678
{&Flavor{OS: "x86_64-pc-linux-gnu"}, []*os{linuxamd64}},
79+
{&Flavor{OS: "aarch64-linux-gnu"}, []*os{linuxarm64}},
80+
{&Flavor{OS: "arm64-linux-gnu"}, []*os{linuxarm64}},
7781
}
7882

7983
check := func(test *test, os *os) {

0 commit comments

Comments
 (0)