Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add riscv64 linux tools download support
  • Loading branch information
bitsk authored and cmaglie committed Sep 11, 2024
commit d1287d14833fb48f48ef2056146e6115d00f9f8a
3 changes: 3 additions & 0 deletions internal/arduino/cores/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func (tr *ToolRelease) RuntimeProperties() *properties.Map {
var (
regexpLinuxArm = regexp.MustCompile("arm.*-linux-gnueabihf")
regexpLinuxArm64 = regexp.MustCompile("(aarch64|arm64)-linux-gnu")
regexpLinuxRiscv64 = regexp.MustCompile("riscv64-linux-gnu")
regexpLinux64 = regexp.MustCompile("x86_64-.*linux-gnu")
regexpLinux32 = regexp.MustCompile("i[3456]86-.*linux-gnu")
regexpWindows32 = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
Expand All @@ -151,6 +152,8 @@ func (f *Flavor) isExactMatchWith(osName, osArch string) bool {
return regexpLinuxArm.MatchString(f.OS)
case "linux,arm64":
return regexpLinuxArm64.MatchString(f.OS)
case "linux,riscv64":
return regexpLinuxRiscv64.MatchString(f.OS)
case "linux,amd64":
return regexpLinux64.MatchString(f.OS)
case "linux,386":
Expand Down
3 changes: 3 additions & 0 deletions internal/arduino/cores/tools_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestFlavorCompatibility(t *testing.T) {
linuxArm := &os{"linux", "arm"}
linuxArmbe := &os{"linux", "armbe"}
linuxArm64 := &os{"linux", "arm64"}
linuxRiscv64 := &os{"linux", "riscv64"}
darwin32 := &os{"darwin", "386"}
darwin64 := &os{"darwin", "amd64"}
darwinArm64 := &os{"darwin", "arm64"}
Expand All @@ -47,6 +48,7 @@ func TestFlavorCompatibility(t *testing.T) {
linuxArm,
linuxArmbe,
linuxArm64,
linuxRiscv64,
darwin32,
darwin64,
darwinArm64,
Expand Down Expand Up @@ -82,6 +84,7 @@ func TestFlavorCompatibility(t *testing.T) {
{&Flavor{OS: "x86_64-pc-linux-gnu"}, []*os{linux64}, []*os{linux64}},
{&Flavor{OS: "aarch64-linux-gnu"}, []*os{linuxArm64}, []*os{linuxArm64}},
{&Flavor{OS: "arm64-linux-gnu"}, []*os{linuxArm64}, []*os{linuxArm64}},
{&Flavor{OS: "riscv64-linux-gnu"}, []*os{linuxRiscv64}, []*os{linuxRiscv64}},
}

checkCompatible := func(test *test, os *os) {
Expand Down