Repository navigation
chore: run clippy in CI and build with NDK r27c - #53
Merged
Merged
Conversation
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.
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.
What
Audit B2 and B3.
Clippy (B3). CI installed clippy but never ran it. It now runs
cargo clippy -- -D warningson 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:map_or(true, ..)becomesis_none_or, a redundant closure and two same-type casts go, andmain()moves above the test module.readlink's two identicalOkbranches merge into one condition;eprintln!("")becomeseprintln!().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 addschunks_exact_to_as_chunksand 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), whilescripts/build.shdefaults to r27c and the committed binaries are built with it. CI now installs r27c (ndk;27.2.12479018) withsdkmanager, exports it asPR_NDK, and uses it forbuild.shand in place of the local NDK path in both.cargo/config.tomlfiles.Docs: AGENTS.md and README describe the new CI steps;
proot-improvement.md's CI toolchain note is updated.Tests
cargo fmt --check,cargo clippy --all-targets -- -D warningsclean;cargo test325 pass.cargo fmt --check,cargo clippy -- -D warningsclean for both the host andaarch64-linux-android.The committed
libpr-cli.sois not rebuilt: the source changes do not change behaviour or output.