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

0.4.3 was a breaking change #55

Open
Nemo157 opened this issue May 22, 2021 · 5 comments
Open

0.4.3 was a breaking change #55

Nemo157 opened this issue May 22, 2021 · 5 comments

Comments

@Nemo157
Copy link

Nemo157 commented May 22, 2021

> cargo new foo && cd foo
     Created binary (application) `foo` package
> cargo add --vers 0.4.2 hex --no-default-features
    Updating 'https://github.com/rust-lang/crates.io-index' index
      Adding hex v0.4.2 to dependencies
> echo 'fn main() { dbg!(hex::encode(b"1234")); }' > src/main.rs
> cargo update --precise 0.4.2 -p hex
    Updating crates.io index
    Updating hex v0.4.3 -> v0.4.2
> cargo run
   Compiling hex v0.4.2
   Compiling foo v0.1.0 (/tmp/tmp.EwT6eRV1y2/foo)
    Finished dev [unoptimized + debuginfo] target(s) in 0.51s
     Running `/home/nemo157/.cargo/shared-target/debug/foo`
[src/main.rs:1] hex::encode(b"1234") = "31323334"
> cargo update -p hex
    Updating crates.io index
    Updating hex v0.4.2 -> v0.4.3
> cargo run
   Compiling foo v0.1.0 (/tmp/tmp.EwT6eRV1y2/foo)
error[E0425]: cannot find function `encode` in crate `hex`
 --> src/main.rs:1:23
  |
1 | fn main() { dbg!(hex::encode(b"1234")); }
  |                       ^^^^^^ not found in `hex`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: could not compile `foo`

To learn more, run the command again with --verbose.

Moving an existing API under a feature flag is a breaking change to all users with default-features = false specified.

Nemo157 added a commit to Nullus157/cbor-diag-rs that referenced this issue May 22, 2021
@eminence
Copy link

Version 0.4.3 also changed the Minimum Supported Rust Version:

achin@bigbox:~/tmp/65/rust-hex$ git checkout v0.4.2
HEAD is now at be0c32f fix: Bump to v0.4.2

achin@bigbox:~/tmp/65/rust-hex$ cargo +1.34.0 check
    Finished dev [unoptimized + debuginfo] target(s) in 0.27s
chin@bigbox:~/tmp/65/rust-hex$ git checkout v0.4.3
HEAD is now at b2b4370 Release v0.4.3

achin@bigbox:~/tmp/65/rust-hex$ cargo +1.34.0 check
    Updating crates.io index
    Checking hex v0.4.3 (/home/achin/tmp/65/rust-hex)
error[E0658]: use of unstable library feature 'alloc': this library is unlikely to be stabilized in its current form or name (see issue #27783)
  --> src/lib.rs:41:1
   |
41 | extern crate alloc;
   | ^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `hex`.

To learn more, run the command again with --verbose.

@Nemo157
Copy link
Author

Nemo157 commented May 24, 2021

hex has no published MSRV policy, so it changing in a patch version is fine.

Given the age of this release, I'm not sure there's any point in doing anything. I assume I'm the only one to be hit by the issue, and I'm just about to publish a patch release to my library that will support both 0.4.2 and 0.4.3. Just something to keep aware of for next time.

@KokaKiwi
Copy link
Owner

Yup really sorry about that, i'm still having issues dealing with API and versions compatibilities 😞
I'll write down this issue on my checklist for futures releases, so i wouldn't make the same mistake..

Also, i really want to work on finally making the hex-1.0 release and dealing with stuff like MSRV but due to personal issues it's kinda complicated right now so i'm working on it sporadically

I'll keep this issue open to keep it visible until the next release which will hopefully be better prepared ^^'

@HeroicKatora
Copy link

Speaking from experience both the inability to add new feature flags and MSRV is annoying. Maybe annoying to the point of warranting support in cargo. I'm not sure if this would be in the form of detection and warning on publish or in the form of a better dependency specification language that allows such changes to be made without breaking anyone downstream. We can provide both this, wgpu, and several image-related crates as examples.

@ckcr4lyf
Copy link

FYI: If you're like me and realize you need to use 0.4.2, you can force the downgrade by changing the dependency as such:

hex = "=0.4.2"

If you just do hex = "0.4.2" then cargo will keep using the 0.4.3 version.

redshiftzero added a commit to penumbra-zone/decaf377 that referenced this issue Dec 12, 2023
hex=0.4.3 was breaking the build, see:
KokaKiwi/rust-hex#55

cargo-nono was reporting false positives on zeroize and
num-bigint, so instead of using that in CI I'm instead
building without the default `std` feature
redshiftzero added a commit to penumbra-zone/decaf377 that referenced this issue Dec 12, 2023
hex=0.4.3 was breaking the build, see:
KokaKiwi/rust-hex#55

cargo-nono was reporting false positives on zeroize and
num-bigint, so instead of using that in CI I'm instead
building without the default `std` feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants