Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,20 @@ jobs:
export ${{ matrix.linker_env }}="$NDK_TOOLCHAIN/${{ matrix.linker_bin }}"
export AR="$NDK_TOOLCHAIN/llvm-ar"

# The linker setting above is cargo's; cc-rs, which `ring` (the
# telemetry uploader's TLS, via rustls) uses for its C and assembly,
# never reads it and resolves a compiler on its own. Left to itself
# it probes PATH for `<triple>-clang`, and setup-ndk puts the NDK
# root on PATH, not the toolchain bin, so on every ABI the probe
# fails inside ring's build script. Its fallback list does not help
# either: it names armv7a-linux-androideabi16-clang and
# i686-linux-android16-clang, API levels r26b no longer ships. So
# name the compiler outright: the same versioned clang the linker
# uses. cc-rs reads CC_<triple> with the dashes made underscores.
TARGET_VAR="$(printf '%s' '${{ matrix.target }}' | tr '-' '_')"
export "CC_${TARGET_VAR}=$NDK_TOOLCHAIN/${{ matrix.linker_bin }}"
export "CXX_${TARGET_VAR}=$NDK_TOOLCHAIN/${{ matrix.linker_bin }}++"

cargo build --release --locked --target ${{ matrix.target }} --package offline-protocol-uniffi

mkdir -p jniLibs/${{ matrix.abi }}
Expand Down
17 changes: 17 additions & 0 deletions bindings/react-native/scripts/build-uniffi-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,23 @@ export CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="$NDK_TOOLCHAIN/x86_64-linux-and
export CARGO_TARGET_I686_LINUX_ANDROID_LINKER="$NDK_TOOLCHAIN/i686-linux-android21-clang"
export AR="$NDK_TOOLCHAIN/llvm-ar"

# The linker settings above are cargo's; cc-rs, which `ring` (the telemetry
# uploader's TLS, via rustls) uses for its C and assembly, never reads them
# and resolves a compiler on its own. It probes PATH for `<triple>-clang`,
# a name no NDK ships, then a fixed list of versioned names, two of which
# (armv7a-linux-androideabi16-clang and i686-linux-android16-clang) are API
# levels that NDK r24 and later no longer carry. So with the toolchain on
# PATH the 64-bit ABIs happen to build and the 32-bit ones fail in ring's
# build script. Name each compiler outright, the same clang the linker uses.
export CC_aarch64_linux_android="$CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER"
export CXX_aarch64_linux_android="${CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER}++"
export CC_armv7_linux_androideabi="$CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER"
export CXX_armv7_linux_androideabi="${CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER}++"
export CC_x86_64_linux_android="$CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER"
export CXX_x86_64_linux_android="${CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER}++"
export CC_i686_linux_android="$CARGO_TARGET_I686_LINUX_ANDROID_LINKER"
export CXX_i686_linux_android="${CARGO_TARGET_I686_LINUX_ANDROID_LINKER}++"

for linker in \
"$CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER" \
"$CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER" \
Expand Down
Loading