diff --git a/.github/workflows/ci_core.yml b/.github/workflows/ci_core.yml index 1402f0c8a4e6..aa4c581b369e 100644 --- a/.github/workflows/ci_core.yml +++ b/.github/workflows/ci_core.yml @@ -257,6 +257,6 @@ jobs: - name: Test working-directory: core - run: cargo nextest run --no-fail-fast --features layers-all && cargo test --doc + run: cargo nextest run --no-fail-fast --features layers-all,tests && cargo test --doc --features tests env: LD_LIBRARY_PATH: ${{ env.JAVA_HOME }}/lib/server:${{ env.LD_LIBRARY_PATH }} diff --git a/bin/oli/Cargo.toml b/bin/oli/Cargo.toml index 3967b802c133..950be3d87588 100644 --- a/bin/oli/Cargo.toml +++ b/bin/oli/Cargo.toml @@ -60,7 +60,24 @@ dirs = "5.0.1" env_logger = "0.11" futures = "0.3" log = "0.4" -opendal = { version = "0.45.1", path = "../../core" } +opendal = { version = "0.45.1", path = "../../core", features = [ + # These are default features before v0.46. TODO: change to optional features + "services-azblob", + "services-azdls", + "services-cos", + "services-fs", + "services-gcs", + "services-ghac", + "services-http", + "services-ipmfs", + "services-memory", + "services-obs", + "services-oss", + "services-s3", + "services-webdav", + "services-webhdfs", + "services-azfile", +] } serde = { version = "1", features = ["derive"] } tokio = { version = "1.34", features = [ "fs", diff --git a/bindings/c/Cargo.toml b/bindings/c/Cargo.toml index 2b5d051fe7ab..725326e180d7 100644 --- a/bindings/c/Cargo.toml +++ b/bindings/c/Cargo.toml @@ -39,5 +39,21 @@ bytes = "1.4.0" once_cell = "1.17.1" opendal = { version = "0.45.1", path = "../../core", features = [ "layers-blocking", + # These are default features before v0.46. TODO: change to optional features #4313 + "services-azblob", + "services-azdls", + "services-cos", + "services-fs", + "services-gcs", + "services-ghac", + "services-http", + "services-ipmfs", + "services-memory", + "services-obs", + "services-oss", + "services-s3", + "services-webdav", + "services-webhdfs", + "services-azfile", ] } tokio = { version = "1.27", features = ["fs", "macros", "rt-multi-thread"] } diff --git a/core/Cargo.toml b/core/Cargo.toml index e95322cffa3f..83155584137e 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -39,24 +39,7 @@ default-members = ["."] members = [".", "fuzz", "edge/*", "benches/vs_*"] [features] -default = [ - "rustls", - "services-azblob", - "services-azdls", - "services-cos", - "services-fs", - "services-gcs", - "services-ghac", - "services-http", - "services-ipmfs", - "services-memory", - "services-obs", - "services-oss", - "services-s3", - "services-webdav", - "services-webhdfs", - "services-azfile", -] +default = ["rustls"] # Build test utils or not. # @@ -64,7 +47,17 @@ default = [ # And doesn't have any other effects. # # You should never enable this feature unless you are developing opendal. -tests = ["dep:rand", "dep:sha2", "dep:dotenvy", "layers-blocking"] +tests = [ + "dep:rand", + "dep:sha2", + "dep:dotenvy", + "layers-blocking", + "services-azblob", + "services-fs", + "services-http", + "services-memory", + "services-s3", +] # Enable trust-dns for pure rust dns cache. trust-dns = ["reqwest/trust-dns"] diff --git a/core/edge/file_write_on_full_disk/Cargo.toml b/core/edge/file_write_on_full_disk/Cargo.toml index 63a57a21a716..5e1c7f7c7a12 100644 --- a/core/edge/file_write_on_full_disk/Cargo.toml +++ b/core/edge/file_write_on_full_disk/Cargo.toml @@ -25,6 +25,6 @@ version = "0.0.0" [dependencies] futures = "0.3" -opendal = { path = "../../" } +opendal = { path = "../../", features = ["services-memory", "services-fs"] } rand = "0.8" tokio = { version = "1", features = ["full"] } diff --git a/core/src/docs/upgrade.md b/core/src/docs/upgrade.md index 7c56ff1255c0..dfd7198acced 100644 --- a/core/src/docs/upgrade.md +++ b/core/src/docs/upgrade.md @@ -1,3 +1,9 @@ +# Upgrade to v0.46 + +## Services Feature Flag + +Starting from v0.46, OpenDAL does not include any services in default features to avoid compiling unneeded services' code. Please enable each service's feature flag to use it. + # Upgrade to v0.45 ## Public API diff --git a/core/src/lib.rs b/core/src/lib.rs index 343bbd37d5e2..054dd4f7a0a5 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -129,8 +129,6 @@ // Make sure all our public APIs have docs. #![warn(missing_docs)] -// Deny unused qualifications. -#![deny(unused_qualifications)] // Private module with public types, they will be accessed via `opendal::Xxxx` mod types; diff --git a/core/src/raw/http_util/body.rs b/core/src/raw/http_util/body.rs index cee80ec1562d..c73aaf374122 100644 --- a/core/src/raw/http_util/body.rs +++ b/core/src/raw/http_util/body.rs @@ -76,6 +76,7 @@ impl IncomingAsyncBody { } /// Create an empty IncomingAsyncBody. + #[allow(dead_code)] pub(crate) fn empty() -> Self { Self { inner: Box::new(()), diff --git a/core/src/types/mode.rs b/core/src/types/mode.rs index c5e45f3fed44..aa8b8d35029c 100644 --- a/core/src/types/mode.rs +++ b/core/src/types/mode.rs @@ -41,6 +41,7 @@ impl EntryMode { } /// Create entry mode from given path. + #[allow(dead_code)] pub(crate) fn from_path(path: &str) -> Self { if path.ends_with('/') { EntryMode::DIR diff --git a/core/src/types/operator/builder.rs b/core/src/types/operator/builder.rs index cca37f72959d..40f265ff885f 100644 --- a/core/src/types/operator/builder.rs +++ b/core/src/types/operator/builder.rs @@ -151,6 +151,7 @@ impl Operator { /// Ok(()) /// } /// ``` + #[allow(unused_variables, unreachable_code)] pub fn via_map(scheme: Scheme, map: HashMap) -> Result { let op = match scheme { #[cfg(feature = "services-atomicserver")] diff --git a/integrations/dav-server/Cargo.toml b/integrations/dav-server/Cargo.toml index 9919526cafa6..d1d82c990342 100644 --- a/integrations/dav-server/Cargo.toml +++ b/integrations/dav-server/Cargo.toml @@ -35,7 +35,7 @@ dav-server = { version = "0.5.8" } dirs = "5.0.0" futures = "0.3" futures-util = { version = "0.3.16" } -opendal = { version = "0.45.1", path = "../../core" } +opendal = { version = "0.45.1", path = "../../core", features = ["services-fs"] } quick-xml = { version = "0.31", features = ["serialize", "overlapped-lists"] } serde = { version = "1", features = ["derive"] } tokio = { version = "1.27", features = [ diff --git a/integrations/object_store/Cargo.toml b/integrations/object_store/Cargo.toml index 8b398f47020e..740f274c0fa3 100644 --- a/integrations/object_store/Cargo.toml +++ b/integrations/object_store/Cargo.toml @@ -38,3 +38,4 @@ tokio = { version = "1", default-features = false } [dev-dependencies] tokio = { version = "1", features = ["fs", "macros", "rt-multi-thread"] } +opendal = { version = "0.45.1", path = "../../core", features = ["services-memory"] } \ No newline at end of file