@@ -7,7 +7,7 @@ import { arm64, armv7, powerpc64le, sparc64, sparcv9, x86, x86_64 } from "../uti
77import { hasDnf } from "../utils/env/hasDnf.js"
88import { isUbuntu } from "../utils/env/isUbuntu.js"
99import { ubuntuVersion } from "../utils/env/ubuntu_version.js"
10- import { extractExe , extractTarByExe } from "../utils/setup/extract.js"
10+ import { extractExe , extractTarByExe , getArchiveType , getExtractFunction } from "../utils/setup/extract.js"
1111import type { PackageInfo } from "../utils/setup/setupBin.js"
1212
1313const dirname = typeof __dirname === "string" ? __dirname : path . dirname ( fileURLToPath ( import . meta. url ) )
@@ -26,7 +26,7 @@ export async function getLLVMPackageInfo(
2626 binRelativeDir : "bin" ,
2727 binFileName : addExeExt ( "clang" ) ,
2828 extractFunction : platform === "win32"
29- ? extractExe
29+ ? getExtractFunction ( getArchiveType ( url ) )
3030 : ( file : string , dest : string ) => {
3131 return extractTarByExe ( file , dest , 1 )
3232 } ,
@@ -83,9 +83,11 @@ async function getAssetKeywords(platform: string, arch: string) {
8383
8484 switch ( platform ) {
8585 case "win32" : {
86- const osKeywordsChoice : string [ ] = [ "windows" , "Windows" ]
86+ // prefer exe over tar.xz for windows
87+ optionalKeywords . push ( ".exe" , ".exe" )
88+ const osKeywordsChoice : string [ ] = [ ]
8789 if ( x86_64 . includes ( arch ) ) {
88- osKeywordsChoice . push ( "win64" , "win64" , "win64" )
90+ osKeywordsChoice . push ( "win64" )
8991 optionalKeywords . push ( [ "x86_64" , "X64" ] )
9092 // TODO fallback to win32 if win64 is not available (e.g. for LLVM 3.6.2 and older)
9193 } else if ( x86 . includes ( arch ) ) {
@@ -96,6 +98,7 @@ async function getAssetKeywords(platform: string, arch: string) {
9698 info ( `Using arch ${ arch } for LLVM` )
9799 osKeywordsChoice . push ( arch )
98100 }
101+ osKeywordsChoice . push ( "windows" , "Windows" )
99102 keywords . push ( osKeywordsChoice )
100103 break
101104 }
0 commit comments