Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add redis-rs feature flags #183

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

edmondwinston
Copy link

Fixes #146.

@edmondwinston
Copy link
Author

@djc

I've understood and used the first option, which is to have both bb8-redis and redis-rs, but (I think) this is still a nice think to have. However, I'm not sure this is what you meant, since I couldn't find a way to test it locally. Any suggestions?

Metadata error

Error: failed to get cargo metadata

Caused by:
cargo metadata exited with an error: warning: patch for bb8-redis uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism
error: failed to load source for dependency bb8-redis

Caused by:
  Unable to update /home/edw/work/local-patches/bb8/redis

Caused by:
  failed to read `/home/edw/work/local-patches/bb8/redis/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

Copy link

codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1598481) 72.00% compared to head (1cbe0bd) 72.00%.
Report is 1 commits behind head on main.

❗ Current head 1cbe0bd differs from pull request most recent head 408267c. Consider uploading reports for the commit 408267c to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #183   +/-   ##
=======================================
  Coverage   72.00%   72.00%           
=======================================
  Files           6        6           
  Lines         593      593           
=======================================
  Hits          427      427           
  Misses        166      166           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

redis/Cargo.toml Outdated Show resolved Hide resolved
redis/Cargo.toml Outdated Show resolved Hide resolved
redis/Cargo.toml Outdated Show resolved Hide resolved
redis/Cargo.toml Outdated Show resolved Hide resolved
@djc
Copy link
Owner

djc commented Dec 22, 2023

cargo metadata exited with an error: warning: patch for bb8-redis uses the features mechanism. default-features and features will not take effect because the patch dependency does not support this mechanism

That is just an aspect of how you've set this up. You can use features with a patch section, but features aren't configured as part of the patch section -- they're just taken from the dependencies section as usual.

@edmondwinston
Copy link
Author

You can use features with a patch section, but features aren't configured as part of the patch section -- they're just taken from the dependencies section as usual.

I see. Was doing it that way because I didn't know this is the way to expose upstream's features, so I very naturally want to test it locally, but I guess it is not necessary, after all.

@edmondwinston edmondwinston marked this pull request as ready for review December 22, 2023 14:44
Copy link
Owner

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost ready!

@@ -10,8 +10,29 @@ repository = "https://github.com/djc/bb8"
[dependencies]
async-trait = "0.1"
bb8 = { version = "0.8", path = "../bb8" }
redis = { version = "0.24", default-features = false, features = ["tokio-comp"] }
redis = { version = "0.24", default-features = false, features = [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the formatting change.


[dev-dependencies]
futures-util = "0.3.15"
tokio = { version = "1.0.0", features = ["macros", "rt-multi-thread"] }

[features]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move the features before the dependencies section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why bb8-redis can't support redis features?
2 participants