Skip to content

Commit b0eb7be

Browse files
committed
ci: Unbreak mutually exclusive features
1 parent 08159e0 commit b0eb7be

File tree

6 files changed

+38
-12
lines changed

6 files changed

+38
-12
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ jobs:
184184
- name: Test
185185
run: |
186186
cargo nextest run --workspace \
187-
--exclude matrix-sdk-integration-testing --features testing
187+
--exclude matrix-sdk-integration-testing
188+
--no-default-features --features __ci_or_development
188189
189190
- name: Test documentation
190191
run: |

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ repository = "https://github.com/matrix-org/matrix-rust-sdk"
1313
crate-type = ["cdylib", "staticlib"]
1414

1515
[features]
16-
default = ["bundled-sqlite"]
16+
default = ["bundled-sqlite", "rustls-tls"]
17+
1718
bundled-sqlite = ["matrix-sdk/bundled-sqlite"]
19+
native-tls = ["matrix-sdk/native-tls"]
20+
rustls-tls = ["matrix-sdk/rustls-tls"]
21+
22+
# Don't use rustls for --workspace tests / clippy / doc checks, as only one
23+
# TLS backend can be enabled at a time.
24+
__ci_or_development = ["native-tls"]
1825

1926
[build-dependencies]
2027
uniffi = { workspace = true, features = ["build"] }
@@ -29,7 +36,7 @@ eyeball-im = { workspace = true }
2936
extension-trait = "1.0.1"
3037
futures-core = { workspace = true }
3138
futures-util = { workspace = true }
32-
matrix-sdk = { workspace = true, features = ["anyhow", "e2e-encryption", "experimental-oidc", "experimental-sliding-sync", "experimental-widgets", "markdown", "rustls-tls", "socks", "sqlite", "uniffi"] }
39+
matrix-sdk = { workspace = true, features = ["anyhow", "e2e-encryption", "experimental-oidc", "experimental-sliding-sync", "experimental-widgets", "markdown", "socks", "sqlite", "uniffi"] }
3340
matrix-sdk-ui = { workspace = true, features = ["e2e-encryption", "uniffi"] }
3441
mime = "0.3.16"
3542
once_cell = { workspace = true }

contrib/ide/vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
22
"rust-analyzer.checkOnSave.command": "clippy",
3-
"rust-analyzer.rustfmt.extraArgs": ["+nightly"]
3+
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
4+
"rust-analyzer.cargo.noDefaultFeatures": true,
5+
"rust-analyzer.cargo.features": ["__ci_or_development"]
46
}

crates/matrix-sdk/Cargo.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,18 @@ experimental-sliding-sync = [
5959
]
6060
experimental-widgets = ["dep:language-tags", "dep:uuid"]
6161

62-
docsrs = ["e2e-encryption", "sqlite", "indexeddb", "sso-login", "qrcode", "image-proc"]
62+
__ci_or_development = [
63+
"e2e-encryption",
64+
"sqlite",
65+
"indexeddb",
66+
"sso-login",
67+
"qrcode",
68+
"image-proc",
69+
"image-rayon",
70+
"experimental-oidc",
71+
"experimental-sliding-sync",
72+
"experimental-widgets",
73+
]
6374

6475
[dependencies]
6576
anyhow = { workspace = true, optional = true }

xtask/src/ci.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn check_clippy() -> Result<()> {
183183
"rustup run {NIGHTLY} cargo clippy --workspace --all-targets
184184
--exclude matrix-sdk-crypto --exclude xtask
185185
--no-default-features
186-
--features native-tls,experimental-sliding-sync,sso-login,testing
186+
--features __ci_or_development
187187
-- -D warnings"
188188
)
189189
.run()?;

xtask/src/main.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,17 @@ fn build_docs(
6262
}
6363

6464
// Keep in sync with .github/workflows/docs.yml
65-
cmd!("rustup run {NIGHTLY} cargo doc --no-deps --workspace --features docsrs")
66-
// Work around https://github.com/rust-lang/cargo/issues/10744
67-
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
68-
.env("RUSTDOCFLAGS", rustdocflags)
69-
.args(extra_args)
70-
.run()?;
65+
cmd!(
66+
"
67+
rustup run {NIGHTLY} cargo doc
68+
--no-deps --workspace --no-default-features --features __ci_or_development
69+
"
70+
)
71+
// Work around https://github.com/rust-lang/cargo/issues/10744
72+
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
73+
.env("RUSTDOCFLAGS", rustdocflags)
74+
.args(extra_args)
75+
.run()?;
7176

7277
Ok(())
7378
}

0 commit comments

Comments
 (0)