@@ -78,28 +78,28 @@ export async function getLLVMAssetURL(platform: string, arch: string, version: s
78
78
}
79
79
80
80
async function getAssetKeywords ( platform : string , arch : string ) {
81
- const keywords : string [ ] = [ ]
82
- const optionalKeywords : string [ ] = [ ]
81
+ const keywords : ( string | string [ ] ) [ ] = [ ]
82
+ const optionalKeywords : ( string | string [ ] ) [ ] = [ ]
83
83
84
84
switch ( platform ) {
85
85
case "win32" : {
86
- optionalKeywords . push ( "windows" , "Windows" )
86
+ const osKeywordsChoice : string [ ] = [ "windows" , "Windows" ]
87
87
if ( x86_64 . includes ( arch ) ) {
88
- // prefer win64 keyword over x86_64 or x64
89
- optionalKeywords . push ( "win64" , "win64" , "win64" , "x86_64" , "X64" )
88
+ osKeywordsChoice . push ( "win64" , "win64" , "win64" , "x86_64" , "X64" )
90
89
// TODO fallback to win32 if win64 is not available (e.g. for LLVM 3.6.2 and older)
91
90
} else if ( x86 . includes ( arch ) ) {
92
- keywords . push ( "win32" )
91
+ osKeywordsChoice . push ( "win32" )
93
92
} else if ( arm64 . includes ( arch ) ) {
94
- keywords . push ( "woa64" )
93
+ osKeywordsChoice . push ( "woa64" )
95
94
} else {
96
95
info ( `Using arch ${ arch } for LLVM` )
97
- keywords . push ( arch )
96
+ osKeywordsChoice . push ( arch )
98
97
}
98
+ keywords . push ( osKeywordsChoice )
99
99
break
100
100
}
101
101
case "linux" : {
102
- optionalKeywords . push ( "linux" , "Linux" )
102
+ const osKeywordsChoice = [ "linux" , "Linux" ]
103
103
104
104
if ( isUbuntu ( ) ) {
105
105
optionalKeywords . push ( "ubuntu" )
@@ -117,7 +117,7 @@ async function getAssetKeywords(platform: string, arch: string) {
117
117
}
118
118
119
119
if ( x86_64 . includes ( arch ) ) {
120
- optionalKeywords . push ( "x86_64" , "X64" )
120
+ keywords . push ( [ "x86_64" , "X64" ] )
121
121
} else if ( x86 . includes ( arch ) ) {
122
122
keywords . push ( "x86" )
123
123
} else if ( arm64 . includes ( arch ) ) {
@@ -132,17 +132,17 @@ async function getAssetKeywords(platform: string, arch: string) {
132
132
info ( `Using arch ${ arch } for LLVM` )
133
133
keywords . push ( arch )
134
134
}
135
-
135
+ keywords . push ( osKeywordsChoice )
136
136
break
137
137
}
138
138
case "darwin" : {
139
- optionalKeywords . push ( "apple" , "macos" , "macOS" )
139
+ keywords . push ( [ "apple" , "macos" , "macOS" ] )
140
140
141
141
if ( x86_64 . includes ( arch ) ) {
142
- optionalKeywords . push ( "x86_64" , "X64" )
142
+ optionalKeywords . push ( [ "x86_64" , "X64" ] )
143
143
} else if ( arm64 . includes ( arch ) ) {
144
144
// allow falling back to x86_64 if arm64 is not available
145
- optionalKeywords . push ( "arm64" , "ARM64" )
145
+ optionalKeywords . push ( [ "arm64" , "ARM64" ] )
146
146
} else {
147
147
info ( `Using arch ${ arch } for LLVM` )
148
148
keywords . push ( arch )
0 commit comments