Skip to content

Commit 60c3494

Browse files
committed
Added windows/arm64 target host for tools
1 parent 7b8b215 commit 60c3494

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

docs/package_index_json-specification.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,22 @@ Each tool version may come in different build flavours for different OS. Each fl
172172
array. The IDE will take care to install the right flavour for the user's OS by matching the `host` value with the
173173
following table or fail if a needed flavour is missing.
174174

175-
| OS flavour | `host` regexp | suggested `host` value |
176-
| --------------- | ------------------------------------- | ----------------------------------- |
177-
| Linux 32 | `i[3456]86-.*linux-gnu` | `i686-linux-gnu` |
178-
| Linux 64 | `x86_64-.*linux-gnu` | `x86_64-linux-gnu` |
179-
| Linux Arm | `arm.*-linux-gnueabihf` | `arm-linux-gnueabihf` |
180-
| Linux Arm64 | `(aarch64\|arm64)-linux-gnu` | `aarch64-linux-gnu` |
181-
| Linux RISC-V 64 | `riscv64-linux-gnu` | `riscv64-linux-gnu` |
182-
| Windows 32 | `i[3456]86-.*(mingw32\|cygwin)` | `i686-mingw32` or `i686-cygwin` |
183-
| Windows 64 | `(amd64\|x86_64)-.*(mingw32\|cygwin)` | `x86_64-mingw32` or `x86_64-cygwin` |
184-
| MacOSX 32 | `i[3456]86-apple-darwin.*` | `i686-apple-darwin` |
185-
| MacOSX 64 | `x86_64-apple-darwin.*` | `x86_64-apple-darwin` |
186-
| MacOSX Arm64 | `arm64-apple-darwin.*` | `arm64-apple-darwin` |
187-
| FreeBSD 32 | `i?[3456]86-freebsd[0-9]*` | `i686-freebsd` |
188-
| FreeBSD 64 | `amd64-freebsd[0-9]*` | `amd64-freebsd` |
189-
| FreeBSD Arm | `arm.*-freebsd[0-9]*` | `arm-freebsd` |
175+
| OS flavour | `host` regexp | suggested `host` value |
176+
| --------------- | -------------------------------------- | ----------------------------------- |
177+
| Linux 32 | `i[3456]86-.*linux-gnu` | `i686-linux-gnu` |
178+
| Linux 64 | `x86_64-.*linux-gnu` | `x86_64-linux-gnu` |
179+
| Linux Arm | `arm.*-linux-gnueabihf` | `arm-linux-gnueabihf` |
180+
| Linux Arm64 | `(aarch64\|arm64)-linux-gnu` | `aarch64-linux-gnu` |
181+
| Linux RISC-V 64 | `riscv64-linux-gnu` | `riscv64-linux-gnu` |
182+
| Windows 32 | `i[3456]86-.*(mingw32\|cygwin)` | `i686-mingw32` or `i686-cygwin` |
183+
| Windows 64 | `(amd64\|x86_64)-.*(mingw32\|cygwin)` | `x86_64-mingw32` or `x86_64-cygwin` |
184+
| Windows Arm64 | `(aarch64\|arm64)-.*(mingw32\|cygwin)` | `arm64-mingw32` or `arm64-cygwin` |
185+
| MacOSX 32 | `i[3456]86-apple-darwin.*` | `i686-apple-darwin` |
186+
| MacOSX 64 | `x86_64-apple-darwin.*` | `x86_64-apple-darwin` |
187+
| MacOSX Arm64 | `arm64-apple-darwin.*` | `arm64-apple-darwin` |
188+
| FreeBSD 32 | `i?[3456]86-freebsd[0-9]*` | `i686-freebsd` |
189+
| FreeBSD 64 | `amd64-freebsd[0-9]*` | `amd64-freebsd` |
190+
| FreeBSD Arm | `arm.*-freebsd[0-9]*` | `arm-freebsd` |
190191

191192
The `host` value is matched with the regexp, this means that a more specific value for the `host` field is allowed (for
192193
example you may write `x86_64-apple-darwin14.1` for MacOSX instead of the suggested `x86_64-apple-darwin`), by the way,

internal/arduino/cores/tools.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ var (
134134
regexpLinux32 = regexp.MustCompile("i[3456]86-.*linux-gnu")
135135
regexpWindows32 = regexp.MustCompile("i[3456]86-.*(mingw32|cygwin)")
136136
regexpWindows64 = regexp.MustCompile("(amd64|x86_64)-.*(mingw32|cygwin)")
137+
regexpWindowsArm64 = regexp.MustCompile("(aarch64|arm64)-.*(mingw32|cygwin)")
137138
regexpMac64 = regexp.MustCompile("x86_64-apple-darwin.*")
138139
regexpMac32 = regexp.MustCompile("i[3456]86-apple-darwin.*")
139140
regexpMacArm64 = regexp.MustCompile("arm64-apple-darwin.*")
@@ -162,6 +163,8 @@ func (f *Flavor) isExactMatchWith(osName, osArch string) bool {
162163
return regexpWindows32.MatchString(f.OS)
163164
case "windows,amd64":
164165
return regexpWindows64.MatchString(f.OS)
166+
case "windows,arm64":
167+
return regexpWindowsArm64.MatchString(f.OS)
165168
case "darwin,arm64":
166169
return regexpMacArm64.MatchString(f.OS)
167170
case "darwin,amd64":

internal/arduino/cores/tools_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func TestFlavorCompatibility(t *testing.T) {
2929
}
3030
windows32 := &os{"windows", "386"}
3131
windows64 := &os{"windows", "amd64"}
32+
windowsArm64 := &os{"windows", "arm64"}
3233
linux32 := &os{"linux", "386"}
3334
linux64 := &os{"linux", "amd64"}
3435
linuxArm := &os{"linux", "arm"}
@@ -43,6 +44,7 @@ func TestFlavorCompatibility(t *testing.T) {
4344
oses := []*os{
4445
windows32,
4546
windows64,
47+
windowsArm64,
4648
linux32,
4749
linux64,
4850
linuxArm,
@@ -64,6 +66,7 @@ func TestFlavorCompatibility(t *testing.T) {
6466
tests := []*test{
6567
{&Flavor{OS: "i686-mingw32"}, []*os{windows32, windows64}, []*os{windows32}},
6668
{&Flavor{OS: "x86_64-mingw32"}, []*os{windows64}, []*os{windows64}},
69+
{&Flavor{OS: "arm64-mingw32"}, []*os{windowsArm64}, []*os{windowsArm64}},
6770
{&Flavor{OS: "i386-apple-darwin11"}, []*os{darwin32, darwin64, darwinArm64}, []*os{darwin32}},
6871
{&Flavor{OS: "x86_64-apple-darwin"}, []*os{darwin64, darwinArm64}, []*os{darwin64}},
6972
{&Flavor{OS: "arm64-apple-darwin"}, []*os{darwinArm64}, []*os{darwinArm64}},

link

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
broken

0 commit comments

Comments
 (0)