You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2024/01/23 16:39:53 UTC

[PR] refactor: avoid hard dep to tokio rt [opendal]

tisonkun opened a new pull request, #4061:
URL: https://github.com/apache/opendal/pull/4061

   This closes https://github.com/apache/opendal/issues/3948.
   
   I'm tryong to opt-out tokio deps as much as possible. But it surprises me that simply remove "rt" doesn't give compile error locally. Check CI workflow for more infos.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464247158


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   The issue here is that even `layers-blocking` is disabled, this method (`new_task_join_error`) can be still referred. Where a new `internal-tokio-rt` doesn't help because the `tokio/rt` is enabled by other services feature.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor!: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464335089


##########
bindings/java/Cargo.toml:
##########
@@ -32,8 +32,8 @@ crate-type = ["cdylib"]
 doc = false
 
 [features]
-# Enable all opendal default feature by default.
 default = [
+  # Enable all opendal default feature by default.

Review Comment:
   But I touch it once more so change together :D



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464247623


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   > layers-blocking can include this feature instead of tokio/rt
   
   This can be done, while I don't find it makes difference.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "PsiACE (via GitHub)" <gi...@apache.org>.
PsiACE commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1463631140


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
    It depends on the method of feature solving, and it does not always occur according to natural logic.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464253034


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   All services relying on `tokio::task::JoinError` must enable the `internal-tokio-rt` feature instead. This feature is added for remove `impl Into<anyhow::Error>` here, not for removing `tokio/rt` from more place.
   
   > This feature is added for remove `impl Into<anyhow::Error>` here
   
   I want this change to avoid `new_task_join_error` been used wrongly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #4061:
URL: https://github.com/apache/opendal/pull/4061#issuecomment-1906502440

   @Xuanwo I have an alternative idea.
   
   I'm investigating `pollster::block_on` to replace tokio runtime. It's a trivial "runtime" to block on the current thread exactly. But I noticed that we have a few features that depends on a running tokio runtime (e.g., pg services), so we may still depends on tokio runtime for running a compatible blocking layer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1463625412


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
   But I suppose compiling "BlockingLayer" should fail for core crate itself. You can see that it still compiles ...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "PsiACE (via GitHub)" <gi...@apache.org>.
PsiACE commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1463602052


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
   if our upstream dependencies include `rt`, it may still detect this feature.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #4061:
URL: https://github.com/apache/opendal/pull/4061#issuecomment-1906583486

   > so we may still depends on tokio runtime for running a compatible blocking layer.
   
   This is the case. Switching to a feature flag solution.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "ClSlaid (via GitHub)" <gi...@apache.org>.
ClSlaid commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464257608


##########
bindings/c/include/opendal.h:
##########
@@ -121,7 +121,6 @@ typedef struct BlockingLister BlockingLister;
  * Some services like s3, gcs doesn't have native blocking supports, we can use [`layers::BlockingLayer`]
  * to wrap the async operator to make it blocking.
  *
- * ```rust

Review Comment:
   Do we miss a code block beginning here?



##########
bindings/java/Cargo.toml:
##########
@@ -32,8 +32,8 @@ crate-type = ["cdylib"]
 doc = false
 
 [features]
-# Enable all opendal default feature by default.
 default = [
+  # Enable all opendal default feature by default.

Review Comment:
   Maybe redundant?



##########
bindings/python/Cargo.toml:
##########
@@ -28,8 +28,8 @@ rust-version.workspace = true
 version.workspace = true
 
 [features]
-# Enable all opendal default feature by default.
 default = [
+  # Enable all opendal default feature by default.

Review Comment:
   Maybe redundant?



##########
bindings/nodejs/Cargo.toml:
##########
@@ -28,8 +28,8 @@ rust-version.workspace = true
 version.workspace = true
 
 [features]
-# Enable all opendal default feature by default.
 default = [
+  # Enable all opendal default feature by default.

Review Comment:
   Maybe redundant?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #4061:
URL: https://github.com/apache/opendal/pull/4061#issuecomment-1906495359

   We need to make blocking layer under a feature gate instead. This is a breaking change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464260376


##########
bindings/c/include/opendal.h:
##########
@@ -121,7 +121,6 @@ typedef struct BlockingLister BlockingLister;
  * Some services like s3, gcs doesn't have native blocking supports, we can use [`layers::BlockingLayer`]
  * to wrap the async operator to make it blocking.
  *
- * ```rust

Review Comment:
   It's generated from [here](https://github.com/apache/opendal/pull/4061/files#diff-5a52598b6d997d9668254e2164bfa2132b79365387edc15f7df27232d1d69b6aR62-R63). IIRC there is an issue o decouple these docs from Rust's one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor!: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #4061:
URL: https://github.com/apache/opendal/pull/4061


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464257275


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   > All services relying on tokio::task::JoinError must enable the internal-tokio-rt feature instead.
   
   OK.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464260501


##########
bindings/c/include/opendal.h:
##########
@@ -121,7 +121,6 @@ typedef struct BlockingLister BlockingLister;
  * Some services like s3, gcs doesn't have native blocking supports, we can use [`layers::BlockingLayer`]
  * to wrap the async operator to make it blocking.
  *
- * ```rust

Review Comment:
   Thus unrelated to this patch or we should not resolve it here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor!: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464297029


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
   > if our upstream dependencies include `rt`, it may still detect this feature.
   
   This PR is still meaningful that we are not the blocker for other projects to remove `tokio/rt` anymore.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464228503


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   I'm thinking of adding a new feature called `internal-tokio-rt`. We can check if this feature has been enable here, and `layers-blocking` can include this feature instead of `tokio/rt`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on PR #4061:
URL: https://github.com/apache/opendal/pull/4061#issuecomment-1906576959

   > I'm investigating pollster::block_on to replace tokio runtime.
   
   Replacing tokio this way doesn't look good to me. I like the idea of using pollster, but I wish it to be a new layer like `PollsterLayer` instead.
   
   In this way, our users can decide which runtime to use by switching layers in the next version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464292733


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   Updated.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464281750


##########
bindings/java/Cargo.toml:
##########
@@ -32,8 +32,8 @@ crate-type = ["cdylib"]
 doc = false
 
 [features]
-# Enable all opendal default feature by default.
 default = [
+  # Enable all opendal default feature by default.

Review Comment:
   It existed previously. Let's review this in another thread.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464293823


##########
core/src/raw/tests/utils.rs:
##########
@@ -80,7 +80,14 @@ pub fn init_test_service() -> Result<Option<Operator>> {
     // Enable blocking layer if needed.
     if !op.info().full_capability().blocking {
         let _guard = TEST_RUNTIME.enter();
-        op = op.layer(layers::BlockingLayer::create().expect("blocking layer must be created"))
+        #[cfg(feature = "layers-blocking")]

Review Comment:
   We don't need those since `raw/tests` is hide under feature `tests` which enables `layers-blocking` already.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1463723537


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
   Yeah. We depend on reqwest which hard depends on tokio runtime ..



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #4061:
URL: https://github.com/apache/opendal/pull/4061#issuecomment-1906618085

   @Xuanwo @PsiACE seems ready for review now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "weihanglo (via GitHub)" <gi...@apache.org>.
weihanglo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464080459


##########
core/Cargo.toml:
##########
@@ -250,8 +250,7 @@ reqwest = { version = "0.11.18", features = [
 ], default-features = false }
 serde = { version = "1", features = ["derive"] }
 serde_json = "1"
-# TODO: remove `rt` after https://github.com/apache/opendal/issues/3948
-tokio = { version = "1.27", features = ["sync", "rt"] }
+tokio = { version = "1.27", features = ["sync"] }

Review Comment:
   [Feature unification](https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-unification) in Cargo is addition and there is no way to opt-out if any dependency in your dependency closure activating a feature.
   
   There is a pre-RFC might get this resolved, and we'd like to see people drive it: <https://internals.rust-lang.org/t/pre-rfc-mutually-excusive-global-features/19618>.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor: avoid hard dep to tokio rt [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464253034


##########
core/src/raw/tokio_util.rs:
##########
@@ -15,9 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
-use crate::*;
+use crate::{Error, ErrorKind};
 
 /// Parse tokio error into opendal::Error.
-pub fn new_task_join_error(e: tokio::task::JoinError) -> Error {
+// HACK - tokio::task::JoinError is not always present, use an existential type.
+pub fn new_task_join_error(e: impl Into<anyhow::Error>) -> Error {

Review Comment:
   All services relying on `tokio::task::JoinError` must enable the `internal-tokio-rt` feature instead. This feature is added for remove `impl Into<anyhow::Error>` here, not for removing `tokio/rt` from more place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] refactor!: avoid hard dep to tokio rt [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #4061:
URL: https://github.com/apache/opendal/pull/4061#discussion_r1464307688


##########
core/src/raw/tests/utils.rs:
##########
@@ -80,7 +80,14 @@ pub fn init_test_service() -> Result<Option<Operator>> {
     // Enable blocking layer if needed.
     if !op.info().full_capability().blocking {
         let _guard = TEST_RUNTIME.enter();
-        op = op.layer(layers::BlockingLayer::create().expect("blocking layer must be created"))
+        #[cfg(feature = "layers-blocking")]

Review Comment:
   Yep. It's an intermediate change .. Let me revert it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org