Skip to content

Commit

Permalink
fix: Fix libunwind for old android (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
cvarjao committed May 23, 2023
1 parent cd5640c commit 611d5ce
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/build-cross-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,17 @@ jobs:
repository: cross-rs/cross
ref: ${{ env.CROSS_REPO_REF }}
path: cross


- name: git patch (cross)
run: git apply ../patches/cross.patch
working-directory: ./cross

- name: Configure Android/NDK/SDK
working-directory: ./cross
run: |
grep 'ARG ANDROID_' ./docker/Dockerfile.*
grep 'libunwind.a' ./docker/android-system.sh || true
- uses: ./.github/actions/setup-rust

- name: Set up Docker Buildx
Expand Down
16 changes: 16 additions & 0 deletions patches/cross.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/docker/android-system.sh b/docker/android-system.sh
index 412758f..2a97e9a 100755
--- a/docker/android-system.sh
+++ b/docker/android-system.sh
@@ -137,6 +137,11 @@ main() {
rm -rf "${td}"
rm -rf "${PYTHON_TMPDIR}"
rm "${0}"
+ # workaround
+ # https://blog.rust-lang.org/2023/01/09/android-ndk-update-r25.html
+ # https://github.com/rust-lang/rust/pull/85806#issuecomment-1096266946
+ find / -name 'libunwind.a' | sed '[email protected][email protected]@' | while read x; do echo "INPUT(-lunwind)" > $x; echo "Patched $x"; done
+ apt-get install --assume-yes --no-install-recommends libncurses5
}

# java isn't required for the build, but the build expects to

0 comments on commit 611d5ce

Please sign in to comment.