Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dedicated Rust-based build helper for ksuinit and wires it into the userspace Cargo configuration so CI (and developers) can build ksuinit via a cargo alias.
Changes:
- Introduce
userspace/toolscrate with abuild-ksuinitbinary that sets up the linker/RUSTFLAGS and runscargo buildforuserspace/ksuinit. - Add
userspace/.cargo/config.tomlalias (cargo build-ksuinit) to invoke the new tool. - Update the
ksuinitGitHub Actions workflow to use the alias, and adjustksuinit’s.gitignoreto track an example Cargo config.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
userspace/tools/src/bin/build-ksuinit.rs |
New build helper that locates the NDK linker and runs the ksuinit release build. |
userspace/tools/Cargo.toml |
Defines the new tools crate and build-ksuinit binary target. |
userspace/tools/Cargo.lock |
Lockfile for the new tools crate. |
userspace/tools/.gitignore |
Ignores build artifacts for the new crate. |
userspace/ksuinit/.gitignore |
Stops ignoring the whole .cargo/ dir; ignores only .cargo/config.toml. |
userspace/ksuinit/.cargo/config.example.toml |
Adds a tracked example Cargo config for developers/rust-analyzer. |
userspace/.cargo/config.toml |
Adds cargo build-ksuinit alias to run the new tool. |
.github/workflows/ksuinit.yml |
Switches CI build step to cargo build-ksuinit. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: Build ksuinit |
There was a problem hiding this comment.
The build tool errors out if ANDROID_NDK_HOME is unset, but this workflow doesn't install/configure the Android NDK or export ANDROID_NDK_HOME. As a result, the CI job will fail on runners where ANDROID_NDK_HOME is not preconfigured. Consider adding an Android SDK/NDK setup step (pin an NDK version) and explicitly setting ANDROID_NDK_HOME before calling cargo build-ksuinit, or update the tool to derive the NDK path from ANDROID_SDK_ROOT/ANDROID_HOME when ANDROID_NDK_HOME is missing.
| - name: Build ksuinit | |
| - name: Set up Android SDK and NDK | |
| uses: android-actions/setup-android@v3 | |
| with: | |
| ndk-version: 25.2.9519653 | |
| - name: Build ksuinit | |
| env: | |
| ANDROID_NDK_HOME: ${{ env.ANDROID_NDK_ROOT }} |
| @@ -0,0 +1 @@ | |||
| target | |||
There was a problem hiding this comment.
For consistency with the other Rust userspace crates (e.g., userspace/ksuinit/.gitignore and userspace/ksud/.gitignore), consider using /target here instead of target so the rule only applies to the crate root and doesn't accidentally ignore any nested target directories.
| target | |
| /target |
f99db52 to
b3d034d
Compare
No description provided.