Commit a10311e
Allow omitting the target triple for
You can now run `swift sdk configure --sdk-root-path /some/sdk/root
sdk-id` without needing to specify the target triple
The Android SDK
(swiftlang/swift#80788 (comment))
needs to have its `sdkRootPath` configured to point to an external NDK
sysroot. But it contains many different target triples, like
`armv7-unknown-linux-androideabi33` and
`x86_64-unknown-linux-android29`, all of which need to be configured to
point to the same sysroot. Following on to
#8687 and
swiftlang/swift-evolution#2888, this PR enables
running a single command to configure the entire SDK, like so:
```
swift run swift-sdk configure --sdk-root-path ~/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot swift-6.1-RELEASE-android-24-0.1
```
This will result in configurations being created for each of the target
triples for the SDK ID.
<details>
```
% swift run swift-sdk configure --sdk-root-path ~/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot swift-6.1-RELEASE-android-24-0.1
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android25` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi33` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android26` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi35` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android31` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi29` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android32` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android34` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android27` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi25` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi26` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi24` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android33` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android35` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android29` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android32` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android25` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android24` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi30` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android26` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android33` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi32` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android35` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android34` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android31` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android28` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android27` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android24` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android30` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi28` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `x86_64-unknown-linux-android28` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi27` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android30` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi34` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `armv7-unknown-linux-androideabi31` were successfully updated: sdkRootPath.
info: These properties of Swift SDK `swift-6.1-RELEASE-android-24-0.1` for target triple `aarch64-unknown-linux-android29` were successfully updated: sdkRootPath.
% ls ~/Library/org.swift.swiftpm/swift-sdks/configuration/
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android24.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android25.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android26.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android27.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android28.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android29.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android30.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android31.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android32.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android33.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android34.json
swift-6.1-RELEASE-android-24-0.1_aarch64-unknown-linux-android35.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi24.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi25.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi26.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi27.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi28.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi29.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi30.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi31.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi32.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi33.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi34.json
swift-6.1-RELEASE-android-24-0.1_armv7-unknown-linux-androideabi35.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android24.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android25.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android26.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android27.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android28.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android29.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android30.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android31.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android32.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android33.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android34.json
swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android35.json
% cat ~/Library/org.swift.swiftpm/swift-sdks/configuration/swift-6.1-RELEASE-android-24-0.1_x86_64-unknown-linux-android31.json
{
"sdkRootPath" : "/Users/marc/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot",
"swiftResourcesPath" : "/Users/marc/Library/org.swift.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/lib/swift",
"swiftStaticResourcesPath" : "/Users/marc/Library/org.swift.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/android-27c-sysroot/usr/lib/swift_static-x86_64",
"toolsetPaths" : [
"/Users/marc/Library/org.swift.swiftpm/swift-sdks/swift-6.1-RELEASE-android-24-0.1.artifactbundle/swift-6.1-release-android-24-sdk/swift-toolset.json"
]
}
```
</details>
In addition, this fixes
#8584, where
`swift sdk configure` with a specified target triple didn't work at all,
and instead would configure some random target triple for the specified
SDK.
Make the `targetTriple` flag for `ConfigureSwiftSDK` optional and, when
nil, apply the command to all triples included in the specified SDK.
Fixes #8584 and
enables configuring multiple target triples with a single `swift sdk
configure` command.
---------
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
(cherry picked from commit 69f851d)swift sdk configure (#8856)1 parent 261395d commit a10311e
File tree
6 files changed
+379
-209
lines changed- Sources
- PackageManagerDocs/Documentation.docc/SDK
- PackageModel/SwiftSDKs
- SwiftSDKCommand
- Tests/PackageModelTests
6 files changed
+379
-209
lines changedLines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
12 | 26 | | |
13 | 27 | | |
14 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
115 | 121 | | |
116 | 122 | | |
117 | 123 | | |
| |||
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
262 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
263 | 272 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
270 | 279 | | |
271 | 280 | | |
272 | 281 | | |
| |||
277 | 286 | | |
278 | 287 | | |
279 | 288 | | |
280 | | - | |
| 289 | + | |
281 | 290 | | |
282 | 291 | | |
283 | | - | |
| 292 | + | |
284 | 293 | | |
285 | 294 | | |
286 | | - | |
| 295 | + | |
287 | 296 | | |
288 | 297 | | |
289 | | - | |
| 298 | + | |
290 | 299 | | |
291 | 300 | | |
292 | | - | |
| 301 | + | |
293 | 302 | | |
294 | 303 | | |
295 | | - | |
| 304 | + | |
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
| |||
301 | 310 | | |
302 | 311 | | |
303 | 312 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
344 | 332 | | |
345 | 333 | | |
346 | 334 | | |
347 | 335 | | |
348 | 336 | | |
349 | 337 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
390 | 360 | | |
391 | 361 | | |
392 | 362 | | |
| |||
414 | 384 | | |
415 | 385 | | |
416 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
417 | 425 | | |
418 | 426 | | |
419 | 427 | | |
420 | | - | |
| 428 | + | |
421 | 429 | | |
422 | 430 | | |
423 | 431 | | |
| |||
464 | 472 | | |
465 | 473 | | |
466 | 474 | | |
467 | | - | |
| 475 | + | |
468 | 476 | | |
469 | 477 | | |
470 | 478 | | |
| |||
489 | 497 | | |
490 | 498 | | |
491 | 499 | | |
492 | | - | |
| 500 | + | |
493 | 501 | | |
494 | 502 | | |
495 | 503 | | |
| |||
1201 | 1209 | | |
1202 | 1210 | | |
1203 | 1211 | | |
1204 | | - | |
| 1212 | + | |
1205 | 1213 | | |
1206 | 1214 | | |
1207 | 1215 | | |
| |||
1213 | 1221 | | |
1214 | 1222 | | |
1215 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
0 commit comments