@@ -32,13 +32,10 @@ jobs:
3232 steps :
3333 - uses : actions/checkout@v4
3434
35- - uses : dtolnay/ rust-toolchain@stable
35+ - uses : actions-rust-lang/setup- rust-toolchain@v1
3636 with :
37- targets : ${{ matrix.target }}
38-
39- - uses : Swatinem/rust-cache@v2
40- with :
41- key : android-${{ matrix.target }}
37+ target : ${{ matrix.target }}
38+ cache-key : android-${{ matrix.target }}
4239
4340 - name : Install pinned Android NDK
4441 run : echo y | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;21.3.6528147"
5249 run : |
5350 triple_upper=$(echo "${{ matrix.target }}" | tr 'a-z-' 'A-Z_')
5451 export "CARGO_TARGET_${triple_upper}_LINKER=${{ matrix.cc }}"
52+ # NDK r21d lacks libunwind.a but Rust's Android target spec requires
53+ # it; empty stub satisfies the link, libgcc carries the real symbols.
54+ mkdir -p "$RUNNER_TEMP/libunwind-stub"
55+ printf '!<arch>\n' > "$RUNNER_TEMP/libunwind-stub/libunwind.a"
56+ export RUSTFLAGS="-L $RUNNER_TEMP/libunwind-stub"
5557 cargo build --target ${{ matrix.target }} --release
5658
5759 - name : Upload native lib
@@ -101,13 +103,10 @@ jobs:
101103 steps :
102104 - uses : actions/checkout@v4
103105
104- - uses : dtolnay/rust-toolchain@stable
105- with :
106- targets : ${{ matrix.target }}
107-
108- - uses : Swatinem/rust-cache@v2
106+ - uses : actions-rust-lang/setup-rust-toolchain@v1
109107 with :
110- key : desktop-${{ matrix.target }}
108+ target : ${{ matrix.target }}
109+ cache-key : desktop-${{ matrix.target }}
111110
112111 - name : Build
113112 shell : bash
0 commit comments