@@ -252,9 +252,35 @@ async function fetchLatestTaggedRelease(channel: "stable" | "beta", timeout: num
252
252
return ret ;
253
253
}
254
254
255
+ function getSystemArch ( ) : string {
256
+ if ( process . arch == "x64" )
257
+ return "x86_64" ;
258
+ else if ( process . arch == "ia32" )
259
+ {
260
+ if ( process . platform == "win32" )
261
+ {
262
+ // we might be on WOW:
263
+ // https://ss64.com/nt/syntax-64bit.html
264
+ // https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
265
+ if ( process . env . PROCESSOR_ARCHITEW6432 === "AMD64" || process . env . PROCESSOR_ARCHITEW6432 === "IA64" )
266
+ return "x86_64" ;
267
+ else if ( process . env . PROCESSOR_ARCHITECTURE === "ARM64" )
268
+ return "arm64" ;
269
+ else if ( process . env . PROCESSOR_ARCHITECTURE === "ARM" )
270
+ return "arm" ;
271
+ else
272
+ return "x86" ;
273
+ }
274
+ else
275
+ return "x86" ;
276
+ }
277
+ else
278
+ return process . arch ;
279
+ }
280
+
255
281
function findFirstMatchingAsset ( name : string | "nightly" , assets : ReleaseAsset [ ] ) : ReleaseAsset | undefined {
256
282
let os = < string > process . platform ;
257
- let arch = process . arch == "x64" ? "x86_64" : process . arch == "ia32" ? "x86" : process . arch ;
283
+ let arch = getSystemArch ( ) ;
258
284
259
285
if ( os == "win32" ) {
260
286
os = "windows" ;
@@ -499,7 +525,6 @@ export function compileServeD(ref?: string): (env: NodeJS.ProcessEnv) => Promise
499
525
buildArgs . push ( "--compiler=" + dmdPath ) ;
500
526
}
501
527
await compileDependency ( outputFolder , "serve-d" , "https://github.com/Pure-D/serve-d.git" , [
502
- [ dubPath , [ "upgrade" ] ] ,
503
528
[ dubPath , buildArgs ]
504
529
] , env , ref ) ;
505
530
var finalDestination = path . join ( outputFolder , "serve-d" , "serve-d" + ( process . platform == "win32" ? ".exe" : "" ) ) ;
0 commit comments