-
Notifications
You must be signed in to change notification settings - Fork 139
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
0.7.1 release of deadpool_redis is not semver-compatible with 0.7.0 #90
Comments
I thought depending on This basicly means that version ranges are a big no-no for libraries... which in turn sounds like this is a broken feature... I feel like this is a Cargo issue in its core. Currently there is no way to specify the dependency version of a depencendy (+ features) and there doesn't seam to be a deduplication logic in place that handles version ranges of crate dependencies. All this results in this rather unfortunate behavior. I only added the version range as I didn't feel the need for it since the |
I'm not sure I 100% agree here. I don't think there is any reasonable way to re-export types from a crate whilst depending on it with a version range that crosses semantic versioning "boundaries". |
And actually "re-export" could be generalised to "have types from |
Thinking about this further, the problem can be summed up even more simply, using one of the breaking changes between versions 0.19 and 0.20 of the This code: use deadpool_redis::redis::ErrorKind::{self, *};
match ErrorKind {
ResponseError => {},
AuthenticationFailed => {},
TypeError => {},
ExecAbortError => {},
BusyLoadingError => {},
NoScriptError => {},
InvalidClientConfig => {},
Moved => {},
Ask => {},
TryAgain => {},
ClusterDown => {},
CrossSlot => {},
MasterDown => {},
IoError => {},
ClientError => {},
ExtensionError => {},
ReadOnly => {},
} always compiles on IMO this is not a problem in cargo - by asking for A suitable fix would be yanking 0.7.1 and publishing a 0.8.0 with Optionally you could also publish a 0.7.2 that remains compatible with |
Sorry for taking this long. You're 100% right with this. I had the wrong expectation about how Cargo works and calculates versions of dependencies of dependencies. This brings us back to the PR #60 and issue #66. I'm glad I opted against re-exporting features from those crates as it wouldn't work break semantic versioning anyways if reexporting types from those crates. TL;DR - Specifying version ranges for This is related to #94 - Maybe that |
I guess anyone affected by this change has already been affected (and hopefully updated to redis 0.20). So yanking the I'm about to release |
Please let me know if you disagree and yanking 0.7.1 and rereleasing as 0.8 should be done nonetheless. |
It seems reasonable to me. Existing users have likely already dealt with the issue, and new users are likely to be using redis 0.20 from the start. |
All right. Time to close this issue then. In the future I'll be releasing new versions of this crate and no longer use version ranges as dependencies then. I still kind of wonder why library crates support this in the first place... need to check with the cargo devs... |
I think in some situations (if you don't use any part of the dependent crate in the public API of your crate), a dependency with a version range in a library crate could be fine. |
The 0.7.1 release has this dependency spec for redis:
version = ">=0.19,<=0.20"
The 0.7.0 release had this dependency spec:
version = "0.19"
Since
deadpool_redis
re-exportsredis
, the public API ofredis
forms part of the public API ofdeadpool_redis
, so 0.7.0 and 0.7.1 are not actually compatible in a semver sense.It also causes a problem if some crate that depends on deadpool_redis also depends on redis directly (e.g. to adjust the cargo features), because in some situations you can end up with two different versions of redis. This was my situation and a simple
cargo update
(which should generally be safe if everything follows semver) broke the build because deadpool_redis updated from 0.7.0 to 0.7.1 but my direct dep of redis stayed on 0.19.x.The text was updated successfully, but these errors were encountered: