Skip to content

ksuinit: add build tool#3327

Draft
5ec1cff wants to merge 2 commits intomainfrom
buildksuinit
Draft

ksuinit: add build tool#3327
5ec1cff wants to merge 2 commits intomainfrom
buildksuinit

Conversation

@5ec1cff
Copy link
Copy Markdown
Collaborator

@5ec1cff 5ec1cff commented Mar 23, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/tools crate with a build-ksuinit binary that sets up the linker/RUSTFLAGS and runs cargo build for userspace/ksuinit.
  • Add userspace/.cargo/config.toml alias (cargo build-ksuinit) to invoke the new tool.
  • Update the ksuinit GitHub Actions workflow to use the alias, and adjust ksuinit’s .gitignore to 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.

Comment on lines 26 to 27

- name: Build ksuinit
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
- 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 }}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1 @@
target
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
target
/target

Copilot uses AI. Check for mistakes.
@Ylarod Ylarod force-pushed the main branch 4 times, most recently from f99db52 to b3d034d Compare March 27, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants