This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 6e8f084c8 refactor: Split async_backtrace layer to new crate (#6867)
6e8f084c8 is described below
commit 6e8f084c8a482fcfde184876495c656d34f2b77d
Author: Xuanwo <[email protected]>
AuthorDate: Fri Dec 5 18:15:01 2025 +0800
refactor: Split async_backtrace layer to new crate (#6867)
Signed-off-by: Xuanwo <[email protected]>
---
core/Cargo.lock | 10 ++++++-
core/Cargo.toml | 5 ++--
core/core/Cargo.toml | 4 ---
core/core/src/layers/mod.rs | 5 ----
core/layers/async-backtrace/Cargo.toml | 31 ++++++++++++++++++++++
.../async-backtrace/src/lib.rs} | 13 ++++-----
core/src/lib.rs | 7 +++++
7 files changed, 57 insertions(+), 18 deletions(-)
diff --git a/core/Cargo.lock b/core/Cargo.lock
index 0dd01bee2..597d41511 100644
--- a/core/Cargo.lock
+++ b/core/Cargo.lock
@@ -5406,6 +5406,7 @@ dependencies = [
"libtest-mimic",
"log",
"opendal-core",
+ "opendal-layer-async-backtrace",
"opendal-service-s3",
"opentelemetry",
"opentelemetry-otlp",
@@ -5452,7 +5453,6 @@ name = "opendal-core"
version = "0.55.0"
dependencies = [
"anyhow",
- "async-backtrace",
"await-tree",
"backon",
"base64 0.22.1",
@@ -5576,6 +5576,14 @@ dependencies = [
"uuid",
]
+[[package]]
+name = "opendal-layer-async-backtrace"
+version = "0.55.0"
+dependencies = [
+ "async-backtrace",
+ "opendal-core",
+]
+
[[package]]
name = "opendal-service-s3"
version = "0.55.0"
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 0ca702199..ed742214f 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -17,7 +17,7 @@
[workspace]
default-members = [".", "core"]
-members = [".", "core", "examples/*", "fuzz", "edge/*", "benches/vs_*",
"services/*"]
+members = [".", "core", "examples/*", "fuzz", "edge/*", "benches/vs_*",
"services/*", "layers/*"]
[workspace.package]
edition = "2024"
@@ -52,7 +52,7 @@ default = ["reqwest-rustls-tls", "executors-tokio",
"services-memory"]
executors-tokio = ["opendal-core/executors-tokio"]
internal-path-cache = ["opendal-core/internal-path-cache"]
internal-tokio-rt = ["opendal-core/internal-tokio-rt"]
-layers-async-backtrace = ["opendal-core/layers-async-backtrace"]
+layers-async-backtrace = ["dep:opendal-layer-async-backtrace"]
layers-await-tree = ["opendal-core/layers-await-tree"]
layers-chaos = ["opendal-core/layers-chaos"]
layers-dtrace = ["opendal-core/layers-dtrace"]
@@ -152,6 +152,7 @@ required-features = ["tests"]
[dependencies]
opendal-core = { path = "core", version = "0.55.0", default-features = false }
+opendal-layer-async-backtrace = { path = "layers/async-backtrace", version =
"0.55.0", optional = true, default-features = false }
opendal-service-s3 = { path = "services/s3", version = "0.55.0", optional =
true, default-features = false }
[dev-dependencies]
diff --git a/core/core/Cargo.toml b/core/core/Cargo.toml
index 0f6edc6d5..f186ec679 100644
--- a/core/core/Cargo.toml
+++ b/core/core/Cargo.toml
@@ -97,8 +97,6 @@ layers-otel-trace = ["dep:opentelemetry",
"opentelemetry/trace"]
layers-throttle = ["dep:governor"]
# Enable layers await-tree support.
layers-await-tree = ["dep:await-tree"]
-# Enable layers async-backtrace support.
-layers-async-backtrace = ["dep:async-backtrace"]
# Enable dtrace support.
layers-dtrace = ["dep:probe"]
@@ -352,8 +350,6 @@ web-sys = { version = "0.3.77", optional = true, features =
[
] }
# Layers
-# for layers-async-backtrace
-async-backtrace = { version = "0.2.6", optional = true }
# for layers-await-tree
await-tree = { version = "0.3", optional = true }
# for layers-throttle
diff --git a/core/core/src/layers/mod.rs b/core/core/src/layers/mod.rs
index cffc12ead..d684b50f3 100644
--- a/core/core/src/layers/mod.rs
+++ b/core/core/src/layers/mod.rs
@@ -116,11 +116,6 @@ mod await_tree;
#[cfg(feature = "layers-await-tree")]
pub use self::await_tree::AwaitTreeLayer;
-#[cfg(feature = "layers-async-backtrace")]
-mod async_backtrace;
-#[cfg(feature = "layers-async-backtrace")]
-pub use self::async_backtrace::AsyncBacktraceLayer;
-
#[cfg(all(target_os = "linux", feature = "layers-dtrace"))]
mod dtrace;
#[cfg(all(target_os = "linux", feature = "layers-dtrace"))]
diff --git a/core/layers/async-backtrace/Cargo.toml
b/core/layers/async-backtrace/Cargo.toml
new file mode 100644
index 000000000..3032817ba
--- /dev/null
+++ b/core/layers/async-backtrace/Cargo.toml
@@ -0,0 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+name = "opendal-layer-async-backtrace"
+version = "0.55.0"
+edition = "2024"
+license = "Apache-2.0"
+repository = "https://github.com/apache/opendal"
+description = "Apache OpenDAL async-backtrace layer"
+
+[package.metadata.docs.rs]
+all-features = true
+
+[dependencies]
+opendal-core = { path = "../../core", version = "0.55.0", default-features =
false }
+async-backtrace = "0.2.6"
diff --git a/core/core/src/layers/async_backtrace.rs
b/core/layers/async-backtrace/src/lib.rs
similarity index 95%
rename from core/core/src/layers/async_backtrace.rs
rename to core/layers/async-backtrace/src/lib.rs
index 061ebbd1e..2f9d67f58 100644
--- a/core/core/src/layers/async_backtrace.rs
+++ b/core/layers/async-backtrace/src/lib.rs
@@ -15,8 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-use crate::raw::*;
-use crate::*;
+use opendal_core::raw::oio;
+use opendal_core::raw::*;
+use opendal_core::*;
/// Add Efficient, logical 'stack' traces of async functions for the
underlying services.
///
@@ -28,10 +29,10 @@ use crate::*;
/// # Examples
///
/// ```no_run
-/// # use opendal_core::layers::AsyncBacktraceLayer;
-/// # use opendal_core::services;
-/// # use opendal_core::Operator;
-/// # use opendal_core::Result;
+/// use opendal_layer_async_backtrace::AsyncBacktraceLayer;
+/// use opendal_core::services;
+/// use opendal_core::Operator;
+/// use opendal_core::Result;
///
/// # fn main() -> Result<()> {
/// let _ = Operator::new(services::Memory::default())?
diff --git a/core/src/lib.rs b/core/src/lib.rs
index e02ba8c9c..4192eb619 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -30,3 +30,10 @@ pub mod services {
#[cfg(feature = "services-s3")]
pub use opendal_service_s3::*;
}
+
+/// Re-export of layers.
+pub mod layers {
+ pub use opendal_core::layers::*;
+ #[cfg(feature = "layers-async-backtrace")]
+ pub use opendal_layer_async_backtrace::*;
+}