Skip to content

Commit

Permalink
ci: Unbreak mutually exclusive features
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Feb 8, 2024
1 parent 08159e0 commit b0eb7be
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ jobs:
- name: Test
run: |
cargo nextest run --workspace \
--exclude matrix-sdk-integration-testing --features testing
--exclude matrix-sdk-integration-testing
--no-default-features --features __ci_or_development
- name: Test documentation
run: |
Expand Down
11 changes: 9 additions & 2 deletions bindings/matrix-sdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,15 @@ repository = "https://github.com/matrix-org/matrix-rust-sdk"
crate-type = ["cdylib", "staticlib"]

[features]
default = ["bundled-sqlite"]
default = ["bundled-sqlite", "rustls-tls"]

bundled-sqlite = ["matrix-sdk/bundled-sqlite"]
native-tls = ["matrix-sdk/native-tls"]
rustls-tls = ["matrix-sdk/rustls-tls"]

# Don't use rustls for --workspace tests / clippy / doc checks, as only one
# TLS backend can be enabled at a time.
__ci_or_development = ["native-tls"]

[build-dependencies]
uniffi = { workspace = true, features = ["build"] }
Expand All @@ -29,7 +36,7 @@ eyeball-im = { workspace = true }
extension-trait = "1.0.1"
futures-core = { workspace = true }
futures-util = { workspace = true }
matrix-sdk = { workspace = true, features = ["anyhow", "e2e-encryption", "experimental-oidc", "experimental-sliding-sync", "experimental-widgets", "markdown", "rustls-tls", "socks", "sqlite", "uniffi"] }
matrix-sdk = { workspace = true, features = ["anyhow", "e2e-encryption", "experimental-oidc", "experimental-sliding-sync", "experimental-widgets", "markdown", "socks", "sqlite", "uniffi"] }
matrix-sdk-ui = { workspace = true, features = ["e2e-encryption", "uniffi"] }
mime = "0.3.16"
once_cell = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion contrib/ide/vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"rust-analyzer.checkOnSave.command": "clippy",
"rust-analyzer.rustfmt.extraArgs": ["+nightly"]
"rust-analyzer.rustfmt.extraArgs": ["+nightly"],
"rust-analyzer.cargo.noDefaultFeatures": true,
"rust-analyzer.cargo.features": ["__ci_or_development"]
}
13 changes: 12 additions & 1 deletion crates/matrix-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,18 @@ experimental-sliding-sync = [
]
experimental-widgets = ["dep:language-tags", "dep:uuid"]

docsrs = ["e2e-encryption", "sqlite", "indexeddb", "sso-login", "qrcode", "image-proc"]
__ci_or_development = [
"e2e-encryption",
"sqlite",
"indexeddb",
"sso-login",
"qrcode",
"image-proc",
"image-rayon",
"experimental-oidc",
"experimental-sliding-sync",
"experimental-widgets",
]

[dependencies]
anyhow = { workspace = true, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn check_clippy() -> Result<()> {
"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
--features __ci_or_development
-- -D warnings"
)
.run()?;
Expand Down
17 changes: 11 additions & 6 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ fn build_docs(
}

// Keep in sync with .github/workflows/docs.yml
cmd!("rustup run {NIGHTLY} cargo doc --no-deps --workspace --features docsrs")
// Work around https://github.com/rust-lang/cargo/issues/10744
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
.env("RUSTDOCFLAGS", rustdocflags)
.args(extra_args)
.run()?;
cmd!(
"
rustup run {NIGHTLY} cargo doc
--no-deps --workspace --no-default-features --features __ci_or_development
"
)
// Work around https://github.com/rust-lang/cargo/issues/10744
.env("CARGO_TARGET_APPLIES_TO_HOST", "true")
.env("RUSTDOCFLAGS", rustdocflags)
.args(extra_args)
.run()?;

Ok(())
}

0 comments on commit b0eb7be

Please sign in to comment.