@@ -177,20 +177,34 @@ def load_tools_list(filename, platform):
177
177
for t in tools_info :
178
178
tool_platform = [p for p in t ['systems' ] if p ['host' ] == platform ]
179
179
if len (tool_platform ) == 0 :
180
- continue
180
+ # Fallback to x86 on Apple ARM
181
+ if platform == 'arm64-apple-darwin' :
182
+ tool_platform = [p for p in t ['systems' ] if p ['host' ] == 'x86_64-apple-darwin' ]
183
+ if len (tool_platform ) == 0 :
184
+ continue
185
+ # Fallback to 32bit on 64bit x86 Windows
186
+ elif platform == 'x86_64-mingw32' :
187
+ tool_platform = [p for p in t ['systems' ] if p ['host' ] == 'i686-mingw32' ]
188
+ if len (tool_platform ) == 0 :
189
+ continue
190
+ else :
191
+ continue
181
192
tools_to_download .append (tool_platform [0 ])
182
193
return tools_to_download
183
194
184
195
def identify_platform ():
185
- arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin' , 64 : 'x86_64-apple-darwin' },
186
- 'Linux' : {32 : 'i686-pc-linux-gnu' , 64 : 'x86_64-pc-linux-gnu' },
187
- 'LinuxARM' : {32 : 'arm-linux-gnueabihf' , 64 : 'aarch64-linux-gnu' },
188
- 'Windows' : {32 : 'i686-mingw32' , 64 : 'i686-mingw32' }}
196
+ arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin' , 64 : 'x86_64-apple-darwin' },
197
+ 'DarwinARM' : {32 : 'arm64-apple-darwin' , 64 : 'arm64-apple-darwin' },
198
+ 'Linux' : {32 : 'i686-pc-linux-gnu' , 64 : 'x86_64-pc-linux-gnu' },
199
+ 'LinuxARM' : {32 : 'arm-linux-gnueabihf' , 64 : 'aarch64-linux-gnu' },
200
+ 'Windows' : {32 : 'i686-mingw32' , 64 : 'x86_64-mingw32' }}
189
201
bits = 32
190
202
if sys .maxsize > 2 ** 32 :
191
203
bits = 64
192
204
sys_name = platform .system ()
193
205
sys_platform = platform .platform ()
206
+ if 'Darwin' in sys_name and (sys_platform .find ('arm' ) > 0 or sys_platform .find ('arm64' ) > 0 ):
207
+ sys_name = 'DarwinARM'
194
208
if 'Linux' in sys_name and (sys_platform .find ('arm' ) > 0 or sys_platform .find ('aarch64' ) > 0 ):
195
209
sys_name = 'LinuxARM'
196
210
if 'CYGWIN_NT' in sys_name :
0 commit comments