Skip to content

chore: run clippy in CI and build with NDK r27c - #53

Merged
oonid merged 5 commits into
mainfrom
chore/ci-clippy-ndk
Nov 7, 2026
Merged

oonid merged 5 commits into
mainfrom
chore/ci-clippy-ndk

Conversation

@oonid

@oonid oonid commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

What

Audit B2 and B3.

Clippy (B3). CI installed clippy but never ran it. It now runs cargo clippy -- -D warnings on pr-cli (--all-targets, after the test binary is built, since pr-cli embeds it) and on the test binary (--target aarch64-linux-android). The existing warnings are fixed first, with printed output unchanged:

  • pr-cli (13): literal strings passed as format arguments move into the format string, map_or(true, ..) becomes is_none_or, a redundant closure and two same-type casts go, and main() moves above the test module.
  • test binary (2): readlink's two identical Ok branches merge into one condition; eprintln!("") becomes eprintln!().

The test binary has no unit tests, so CI builds and lints it; that part of B3 needs nothing more.

Pinned Rust. CI's Rust is pinned to 1.97.1, the version the code was checked with. The first CI run used @stable (1.99), whose clippy adds chunks_exact_to_as_chunks and failed the test binary's step. With warnings as errors, a floating toolchain would fail unrelated PRs whenever a Rust release adds a lint; with the pin, new lints come only when the pin is raised. AGENTS.md says so.

NDK (B2). CI used $ANDROID_NDK_LATEST_HOME (30.x), while scripts/build.sh defaults to r27c and the committed binaries are built with it. CI now installs r27c (ndk;27.2.12479018) with sdkmanager, exports it as PR_NDK, and uses it for build.sh and in place of the local NDK path in both .cargo/config.toml files.

Docs: AGENTS.md and README describe the new CI steps; proot-improvement.md's CI toolchain note is updated.

Tests

  • pr-cli: cargo fmt --check, cargo clippy --all-targets -- -D warnings clean; cargo test 325 pass.
  • Test binary: cargo fmt --check, cargo clippy -- -D warnings clean for both the host and aarch64-linux-android.
  • CI on this PR: every step passes, including both clippy steps, the proot build with r27c, the Android unit tests and the APK build.

The committed libpr-cli.so is not rebuilt: the source changes do not change behaviour or output.

oonid added 5 commits November 7, 2026 22:05
Literal strings move into their format strings, map_or(true, ..)
becomes is_none_or, a redundant closure and two same-type casts go,
and main() moves above the test module. In the test binary,
readlink's two Ok branches merge and eprintln!("") drops its empty
argument. Printed output is unchanged.
CI installed clippy but never ran it. It now runs clippy with
warnings as errors on pr-cli (all targets) and on the test binary
(aarch64-linux-android), after the test binary is built, since
pr-cli embeds it.

CI also installs NDK r27c (27.2.12479018), the version
scripts/build.sh defaults to and the committed binaries use, and
builds proot and the Rust binaries with it instead of the runner's
newest NDK.
With clippy's warnings as errors, a floating stable toolchain fails
CI whenever a Rust release adds a lint: 1.99 flags chunks_exact with
a constant size. Pin the version the code was checked with, so new
lints arrive only when the pin is raised.
@oonid
oonid merged commit a5a2a72 into main Nov 7, 2026
1 check passed
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.

1 participant