From 5439b56307f4956d2099784bd282feda6b6168da Mon Sep 17 00:00:00 2001 From: Albin Date: Fri, 20 Sep 2024 11:29:52 +0200 Subject: [PATCH 1/3] Bump android container to 7b4ffb683 --- building/android-container-image.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/building/android-container-image.txt b/building/android-container-image.txt index 40c3c1a8766f..4a37c25bf706 100644 --- a/building/android-container-image.txt +++ b/building/android-container-image.txt @@ -1 +1 @@ -ghcr.io/mullvad/mullvadvpn-app-build-android:63e6d7303 +ghcr.io/mullvad/mullvadvpn-app-build-android:7b4ffb683 From 25158bab26bd5784097727e69c6cda410e854c23 Mon Sep 17 00:00:00 2001 From: Albin Date: Fri, 20 Sep 2024 11:36:40 +0200 Subject: [PATCH 2/3] Clean up actions and workflows from cbindgen --- .github/workflows/android-app.yml | 2 -- .github/workflows/rust-unused-dependencies.yml | 6 ------ build-apk.sh | 8 -------- 3 files changed, 16 deletions(-) diff --git a/.github/workflows/android-app.yml b/.github/workflows/android-app.yml index b098d346f79c..204b84ed5a40 100644 --- a/.github/workflows/android-app.yml +++ b/.github/workflows/android-app.yml @@ -206,8 +206,6 @@ jobs: RUSTFLAGS: --deny warnings BUILD_TYPE: debug run: | - # Temporary fix to address maybenot.h build issues. - cargo install --force cbindgen --version "0.26.0" ARCHITECTURES="${{ matrix.abi }}" UNSTRIPPED_LIB_PATH="$CARGO_TARGET_DIR/${{ matrix.target }}/$BUILD_TYPE/libmullvad_jni.so" STRIPPED_LIB_PATH="./android/app/build/extraJni/${{ matrix.abi }}/libmullvad_jni.so" diff --git a/.github/workflows/rust-unused-dependencies.yml b/.github/workflows/rust-unused-dependencies.yml index 45a2829f66b8..cfdd75e75176 100644 --- a/.github/workflows/rust-unused-dependencies.yml +++ b/.github/workflows/rust-unused-dependencies.yml @@ -81,12 +81,6 @@ jobs: git config --global --add safe.directory '*' git submodule update --init --recursive --depth=1 wireguard-go-rs - - name: Install cbindgen - run: | - # Temporary fix to address maybenot.h build issues. - # Remove this step when cbindgen has been added to the build container. - cargo install --force cbindgen --version "0.26.0" - - name: Install nightly Rust toolchain run: | rustup default $RUST_NIGHTLY_TOOLCHAIN diff --git a/build-apk.sh b/build-apk.sh index 748baa0946b8..e45d4014c9d4 100755 --- a/build-apk.sh +++ b/build-apk.sh @@ -77,14 +77,6 @@ mkdir -p "app/build/extraAssets" mkdir -p "app/build/extraJni" popd -# Temporary fix to address maybenot.h (checked in) sometimes needing to be -# re-generated due to how `make` looks at last-modifications while git neither -# stores nor consistently sets modification metadata on file checkout. -# -# NOTE: The version should match the one used in the checked in -# maybenot.h file. -cargo install --force cbindgen --version "0.26.0" - for ARCHITECTURE in ${ARCHITECTURES:-aarch64 armv7 x86_64 i686}; do case "$ARCHITECTURE" in "x86_64") From 4c7b69b4a34ef63b18a86ff19f152e16b372c9e4 Mon Sep 17 00:00:00 2001 From: Albin Date: Fri, 20 Sep 2024 11:39:24 +0200 Subject: [PATCH 3/3] Document cbindgen requirement in build instructions --- android/BuildInstructions.md | 2 ++ android/docs/BuildInstructions.macos.md | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/android/BuildInstructions.md b/android/BuildInstructions.md index fdbea867150c..39cf2ad7715c 100644 --- a/android/BuildInstructions.md +++ b/android/BuildInstructions.md @@ -128,6 +128,8 @@ Linux distro: #### 5. Install and configure Rust toolchain - Get the latest **stable** Rust toolchain via [rustup.rs](https://rustup.rs/). + Also install `cbindgen` which is required to build `wireguard-go-rs`: + `cargo install --force cbindgen` - Configure Android cross-compilation targets and set up linker and archiver. This can be done by setting the following environment variables: diff --git a/android/docs/BuildInstructions.macos.md b/android/docs/BuildInstructions.macos.md index 01546c570ac6..cf26a297d862 100644 --- a/android/docs/BuildInstructions.macos.md +++ b/android/docs/BuildInstructions.macos.md @@ -28,6 +28,11 @@ Finish the install of `rustup`: rustup-init ``` +Install `cbindgen` which is required to build `wireguard-go-rs`: +```bash +cargo install --force cbindgen +``` + ## 2. Install SDK Tools and Android NDK Toolchain Open Android Studio -> Tools -> SDK Manager, and install `Android SDK Command-line Tools (latest)`.