Skip to content

Commit 46ec479

Browse files
committed
Pin rust, stub libunwind
1 parent 3421be6 commit 46ec479

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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"
@@ -52,6 +49,11 @@ jobs:
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

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "1.95.0"

0 commit comments

Comments
 (0)