chore: replace android cross-rs cross compilation setup with a nix based one#434
Open
Dzejkop wants to merge 34 commits into
Open
chore: replace android cross-rs cross compilation setup with a nix based one#434Dzejkop wants to merge 34 commits into
Dzejkop wants to merge 34 commits into
Conversation
|
Semgrep found 10
GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. |
Dzejkop
commented
Jul 9, 2026
Dzejkop
commented
Jul 9, 2026
412fce6 to
08ecd8d
Compare
… brittle NDK paths Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…r swift build Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…evshells Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cit unsupported-platform error Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nix's apple-sdk hook overwrites DEVELOPER_DIR inside the shell, so the pin moves to WALLETKIT_DEVELOPER_DIR; an invalid pin now aborts the shell, and CI asserts the xcodebuild version. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…oid shell to NDK-supported systems Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nix/build-android.sh handles per-target matrix builds and kotlin/build_kotlin.sh (new --artifacts-dir flag) assembles jniLibs and generates bindings, instead of inlining both in each workflow. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
08ecd8d to
f5bfdb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale
The Android build requires
nargoas a build-time host tool.cross-rsuses target-specific Docker images and may execute target binaries under emulation—for example, itsi686-linux-androidimage uses an i386 QEMU runner. Noir does not publishnargobinaries for these emulated target environments, so we cannot reliably provision it inside thecross-rsbuild flow.This PR replaces
cross-rswith Nix-based cross-compilation. Cargo andnargonow run on the host architecture, where an officialnargobinary is available, while the pinned Android NDK cross-compiles the native library for each Android target.Changes
nargobinaries for supported host platforms.cross-rsbuilds with Nix/NDK builds for:aarch64-linux-androidarmv7-linux-androideabix86_64-linux-androidi686-linux-androidkotlin/build_kotlin.sh.linux/amd64because the Android NDK does not provide an aarch64-linux host toolchain.Validation
nargo, and JDK 17.Note
Medium Risk
This changes how release Android
.soartifacts are produced; Swift is untouched, but a toolchain regression would affect published Kotlin packages until caught in CI.Overview
Replaces cross-rs Android builds with Nix devshells so
cargoandnargorun on the host while a pinned NDK r27 cross-compiles all four Android targets—addressing missingnargobinaries inside cross’s emulated target images.Adds a flake (
default,android,wasmshells), repackagednargo, helpers (nix/build-android.sh,nix/docker.sh), and docs innix/README.md.Cross.tomlis removed; Android link flags stay in.cargo/config.toml.Release workflow (
prepare-kotlin/publish-kotlin) now installs Nix, caches Cargo artifacts, builds via./nix/build-android.sh, and assembles JNI + UniFFI throughkotlin/build_kotlin.sh --artifacts-dir. Swift release steps stay on macOS/Xcode; GitHub Actions are pinned to commit SHAs.kotlin/build_kotlin.shis unified for local and CI (plaincargo build, optional prebuilt.solayout). README andlocal_kotlin.shdrop Docker/crossprerequisites in favor ofnix develop .#android.Reviewed by Cursor Bugbot for commit f5bfdb4. Bugbot is set up for automated code reviews on this repo. Configure here.