Skip to content

Commit 9a3af0b

Browse files
committed
Debug target triplet resolution
1 parent e3ce31a commit 9a3af0b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/build_individual_libldk.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from script_config import ScriptConfig, BuildConfig
77

88
RUSTUP_PATH = os.getenv('HOME') + '/.cargo/bin/rustup'
9+
RUSTC_PATH = os.getenv('HOME') + '/.cargo/bin/rustc'
910
CARGO_PATH = os.getenv('HOME') + '/.cargo/bin/cargo'
1011

1112

@@ -98,12 +99,16 @@ def run(config: ScriptConfig):
9899
shutil.rmtree(cargo_target_directory, ignore_errors=True)
99100
subprocess.check_call([CARGO_PATH, 'clean'], cwd=config.LDK_C_BINDINGS_DIRECTORY)
100101

102+
rust_target_triplet = f'{rust_architecture}-apple-{rust_target_os}'
103+
101104
print('Rust architecture:', rust_architecture)
102105
print('Rust target OS:', rust_target_os)
103-
print('Target:', f'{rust_architecture}-apple-{rust_target_os}')
106+
print('Target:', rust_target_triplet)
107+
108+
subprocess.check_call([RUSTC_PATH, '-Z', 'unstable-options', '--print', 'target-spec-json', '--target', rust_target_triplet])
104109

105110
# cargo build -Z build-std=panic_abort,std --features "std" --target "${RUST_ARCH}-apple-${RUST_TARGET_OS}" $RUST_CONFIGURATION_FLAG
106-
build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', f'{rust_architecture}-apple-{rust_target_os}']
111+
build_arguments = [CARGO_PATH, 'build', '-Z', 'build-std=panic_abort,std', '--features', 'std', '--target', rust_target_triplet]
107112
if config.RUST_CONFIGURATION_FLAG:
108113
build_arguments.append(config.RUST_CONFIGURATION_FLAG)
109114
subprocess.check_call(

0 commit comments

Comments
 (0)