build on current Rust, clean up clippy/fmt, and add GitHub Actions CI - #3
Open
asiniscalchi wants to merge 4 commits into
Open
build on current Rust, clean up clippy/fmt, and add GitHub Actions CI#3asiniscalchi wants to merge 4 commits into
asiniscalchi wants to merge 4 commits into
Conversation
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.
The crate no longer built on a current stable toolchain. This PR fixes the build,
resolves every clippy finding (a few of which were real bugs), formats the codebase
with rustfmt, and adds a CI workflow that keeps all of it enforced.
Build fixes
[[bin]] helloentry fromCargo.toml—src/hello/was deletedlong ago and the dangling entry made every
cargoinvocation fail target resolution.dangerous_implicit_autorefshard errors inaudio.rs(deny-by-default onrecent toolchains) by making the reference through the shared-memory pointer explicit.
.cargo/config→.cargo/config.toml(deprecated name, contents unchanged).Real bugs surfaced by clippy
constants in
ceti.rswere built from byte literals without a trailing\0, soshm_open/sem_openwould read past the end of the literal. All C-string constantsnow use
c"..."literals, which are NUL-terminated by construction.subscription.rs): commands wereparsed from the full 1500-byte buffer including uninitialized tail; now only the bytes
actually received are parsed.
writecalls in the example client replaced withwrite_all, and analways-false
size <= 0comparison on an unsigned value fixed.Cleanup
cargo clippy --fixfor the mechanical findings (unneededreturns,div_ceil,needless borrows) plus removal of dead code and dead stores.
#[allow(clippy::too_many_arguments)]ontcp_handler(one subscriber list persensor stream) and a
SubscriberListtype alias infwd_thread.rs.cargo fmtover the whole codebase (whitespace-only; the largesubscription.rsdiff is rustfmt re-nesting the match arms).
## CI (
.github/workflows/ci.yml)Two jobs on push to
mainand on PRs:cargo fmt --check, build all targets (installslibasound2-devfor the rodio example),cargo clippy --all-targets -- -D warnings,cargo test.gcc-aarch64-linux-gnu(linker overridden via env var, taking precedence over.cargo/config.toml), with the resultingdaemon-aarch64binary uploaded as a workflow artifact on every run.