Skip to content

Commit adff571

Browse files
committed
xtask: force --target-applies-to-host when running Clippy check
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.
1 parent 78608a1 commit adff571

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xtask/src/ci.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,27 @@ fn check_typos() -> Result<()> {
179179

180180
fn check_clippy() -> Result<()> {
181181
cmd!("rustup run {NIGHTLY} cargo clippy --all-targets --features testing -- -D warnings")
182+
// Work around https://github.com/rust-lang/cargo/issues/10744
183+
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
182184
.run()?;
185+
183186
cmd!(
184187
"rustup run {NIGHTLY} cargo clippy --workspace --all-targets
185188
--exclude matrix-sdk-crypto --exclude xtask
186189
--no-default-features
187190
--features native-tls,experimental-sliding-sync,sso-login,testing
188191
-- -D warnings"
189192
)
193+
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
190194
.run()?;
195+
191196
cmd!(
192197
"rustup run {NIGHTLY} cargo clippy --all-targets -p matrix-sdk-crypto
193198
--no-default-features -- -D warnings"
194199
)
200+
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
195201
.run()?;
202+
196203
Ok(())
197204
}
198205

0 commit comments

Comments
 (0)