-
Notifications
You must be signed in to change notification settings - Fork 305
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
Broaden bytes dep to include version 0.5.z through 1.y #461
Conversation
fc292f5
to
50d8e0b
Compare
See above edit for Expected behavior from user perspective. |
So this PR is useless to most users who don't know to use that special command. |
Noted that you didn't use a question mark (?), but I'd be surprised if "most users" with applications don't keep a |
@dekellum By the way, what happens with an existing lock file if one adds a dependency on bytes 1.0 (directly, or through e.g. updating tokio to 1.0)? One would still have bytes 0.5 as a dep then, even if nothing else requires bytes <1.0, right? Not that I would consider this PR a bad thing because of that, I think one should run |
@jplatte Its the same as the "Without a lock file" case I described above. "cargo update" (no flags) will use bytes 1.0 across everything (assuming you have, or can have with the update, http 0.2.3 with this PR's change). |
I just don't understand why you don't bother explaining or even mentioning in CHANGELOG that |
@malaire I'm not the author of the cargo commands. I agree its a pretty strange one. But which is better:
As to your CHANGELOG suggestion, including the above details in the CHANGELOG is a bit too much, IMO. So better to give the link and hope users follow it to get the full details. |
50d8e0b
to
dfc56e0
Compare
That's not what I meant. I know what happens with |
Yes, I think thats possible, since doing something like A bit out of scope for this PR, but my way of viewing this, is that as there are increasingly more ≥1.0.0 crates, the technique used here will become much more desirable and common, and it would be very helpful if cargo tried to coalesce duplicates where possible, rather than maximizing all dependencies (or in this particular case, minimizing changes) at the expense of duplicates. |
@seanmonstar anything missing for this (beyond your available time)? |
So here's where I'm at: having weighed the different options, this one seems risky for the benefit of those not fully upgrading to have 1 less dependency. I have seen semver ranges cause problems before (the Because of that, I still lean towards "an extra dependency for people not upgrading fully" is the least worst option. |
This is one alternative discussed in #457 comment and on discord, to releasing an http 0.2.3 that forces as per current master, existing hyper 0.13 (tokio 0.2, etc.) applications to have duplicate bytes crates in their dependency graph. I'm PRing this for CI and in case it helps.
Duplicates are at minimum a build time and cosmetic liability, and at maximum cause compiler errors or even subtle bugs. Note that the worst case is usually due to the dependency being in the public API, but in the case of http, bytes is currently private.
This broad dependency range is only particularly appropriate for a patch release 0.2.3 and could be reverted (in favor of a bytes = "^1.0.0" dependency) in a 1.0.0 release.
Expected behavior from user perspective
Just to clarify how this expected to work, and as reference for users who might want to manually intervene to avoid the duplicate:
With an existing Cargo.lock and dependency on http 0.2.x
Dry run the update:
To update http, without adding bytes 1.0.0:
Without a lock file
On a new install without an existing
Cargo.lock
, for example new clone of application that doesn't trackCargo.lock
, or viacargo install
, a duplicate of bytes is expected:...but with this PR, this can be manually avoided by the user:
Without this PR, (if released as per current master, 95c338e) this would not be an option. The only option would be to not update to http 0.2.3, but this effectively cuts the user/application off from potentially important future bug fixes, including security fixes!