|
6 | 6 | from script_config import ScriptConfig, BuildConfig
|
7 | 7 |
|
8 | 8 | RUSTUP_PATH = os.getenv('HOME') + '/.cargo/bin/rustup'
|
| 9 | +RUSTC_PATH = os.getenv('HOME') + '/.cargo/bin/rustc' |
9 | 10 | CARGO_PATH = os.getenv('HOME') + '/.cargo/bin/cargo'
|
10 | 11 |
|
| 12 | +# 1.62: nightly-2022-05-13 |
| 13 | +NIGHTLY_TOOLCHAIN = 'nightly-2022-06-24' # 1.63 |
| 14 | + |
11 | 15 |
|
12 | 16 | def run(config: ScriptConfig):
|
13 | 17 | if len(config.LIBLDK_BUILD_CONFIGURATIONS) != 1:
|
@@ -55,7 +59,10 @@ def run(config: ScriptConfig):
|
55 | 59 | child_environment['RUSTFLAGS'] = '--cfg=c_bindings'
|
56 | 60 | child_environment['PATH'] = '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
|
57 | 61 |
|
58 |
| - subprocess.check_call([RUSTUP_PATH, 'override', 'set', 'nightly-2022-05-13'], cwd=config.LDK_C_BINDINGS_DIRECTORY) |
| 62 | + # stop cargo's obsession with x86_64-apple-ios13.0-macabi when nobody asked for it |
| 63 | + child_environment['CFLAGS_x86_64_apple_ios_macabi'] = '--target=x86_64-apple-ios-macabi' |
| 64 | + |
| 65 | + subprocess.check_call([RUSTUP_PATH, 'override', 'set', NIGHTLY_TOOLCHAIN], cwd=config.LDK_C_BINDINGS_DIRECTORY) |
59 | 66 |
|
60 | 67 | lipo_executables_input: [str] = []
|
61 | 68 |
|
@@ -95,8 +102,16 @@ def run(config: ScriptConfig):
|
95 | 102 | shutil.rmtree(cargo_target_directory, ignore_errors=True)
|
96 | 103 | subprocess.check_call([CARGO_PATH, 'clean'], cwd=config.LDK_C_BINDINGS_DIRECTORY)
|
97 | 104 |
|
| 105 | + rust_target_triplet = f'{rust_architecture}-apple-{rust_target_os}' |
| 106 | + |
| 107 | + print('Rust architecture:', rust_architecture) |
| 108 | + print('Rust target OS:', rust_target_os) |
| 109 | + print('Target:', rust_target_triplet) |
| 110 | + |
| 111 | + subprocess.check_call([RUSTC_PATH, f'+{NIGHTLY_TOOLCHAIN}', '-Z', 'unstable-options', '--print', 'target-spec-json', '--target', rust_target_triplet]) |
| 112 | + |
98 | 113 | # cargo build -Z build-std=panic_abort,std --features "std" --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}" $RUST_CONFIGURATION_FLAG
|
99 |
| - build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', f'{rust_architecture}-apple-{rust_target_os}'] |
| 114 | + build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', rust_target_triplet] |
100 | 115 | if config.RUST_CONFIGURATION_FLAG:
|
101 | 116 | build_arguments.append(config.RUST_CONFIGURATION_FLAG)
|
102 | 117 | subprocess.check_call(
|
|
0 commit comments