Skip to content

Commit

Permalink
xtask: force --target-applies-to-host when running Clippy check
Browse files Browse the repository at this point in the history
Without this, the configs from `.cargo/config.toml` were not read in CI
tasks, causing false positives when running Clippy on CI (i.e. there
were issues observed when compiling locally that were not found when
compiling remotely).

Not entirely sure why it's needed, because I'm seeing the issues when
I'm using `cargo xtask ci clippy` locally, with nothing changed.
  • Loading branch information
bnjbvr committed Jun 3, 2024
1 parent 78608a1 commit adff571
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions xtask/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,27 @@ fn check_typos() -> Result<()> {

fn check_clippy() -> Result<()> {
cmd!("rustup run {NIGHTLY} cargo clippy --all-targets --features testing -- -D warnings")
// Work around https://github.com/rust-lang/cargo/issues/10744
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
.run()?;

cmd!(
"rustup run {NIGHTLY} cargo clippy --workspace --all-targets
--exclude matrix-sdk-crypto --exclude xtask
--no-default-features
--features native-tls,experimental-sliding-sync,sso-login,testing
-- -D warnings"
)
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
.run()?;

cmd!(
"rustup run {NIGHTLY} cargo clippy --all-targets -p matrix-sdk-crypto
--no-default-features -- -D warnings"
)
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
.run()?;

Ok(())
}

Expand Down

0 comments on commit adff571

Please sign in to comment.