Commit 97632ad
committed
Parse SDK settings
Previously, we did a simplistic check against the SDKROOT path to try
to figure out whether we should use the environment variable, or try to
find a better matching SDK instead.
This is brittle since the user might want their SDK to be in a
different place in the file system (that's kinda the whole idea of the
SDKROOT variable), and also didn't work properly with SDKs in the Xcode
Command Line Tools.
Instead, we now:
1. Parse the SDKSettings.json file under the SDKROOT, to determine
whether it is suitable for the target we're compiling for (which it
might not be when using Cargo, and targetting iOS but compiling build
scripts on macOS).
2. If it's not, attempt to find another SDK.
This allows us to give much more detailed error messages, to better
support cross-compile scenarios, and allows using parameters from the
SDK (such as the SDK version) elsewhere in the future.1 parent 05457b9 commit 97632ad
File tree
16 files changed
+1792
-64
lines changed- compiler
- rustc_codegen_ssa
- src
- apple
- sample_sdk_settings
- back
- rustc_metadata/src
16 files changed
+1792
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3478 | 3478 | | |
3479 | 3479 | | |
3480 | 3480 | | |
| 3481 | + | |
3481 | 3482 | | |
3482 | 3483 | | |
3483 | 3484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
14 | 22 | | |
15 | 23 | | |
16 | 24 | | |
| |||
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
| |||
49 | 62 | | |
50 | 63 | | |
51 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
52 | 108 | | |
53 | 109 | | |
54 | 110 | | |
| |||
0 commit comments