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

Latest released version does not compile #9124

Closed
ia0 opened this issue Feb 2, 2021 · 16 comments
Closed

Latest released version does not compile #9124

ia0 opened this issue Feb 2, 2021 · 16 comments
Labels
C-bug Category: bug

Comments

@ia0
Copy link

ia0 commented Feb 2, 2021

Problem

The cargo library doesn't build at 0.50.0 (latest released version) and 0.52.0. However it does at master.

Steps

  1. git checkout 67a00f95b (supposedly 0.50.0) or git checkout 60143816b (supposedly 0.52.0)
  2. cargo build --release --lib
  3. The following error is displayed:
error[E0283]: type annotations needed
   --> src/cargo/util/config/de.rs:530:63
    |
530 |                 seed.deserialize(Tuple2Deserializer(1i32, env.as_ref()))
    |                                                           ----^^^^^^--
    |                                                           |   |
    |                                                           |   cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                                           this method call resolves to `&T`
    |
    = note: cannot satisfy `std::string::String: AsRef<_>`
help: use the fully qualified path for the potential candidates
    |
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<OsStr>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<std::path::Path>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<str>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530 |                 seed.deserialize(Tuple2Deserializer(1i32, <std::string::String as AsRef<[u8]>>::as_ref(env)))
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

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

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

Possible Solution(s)

Bump and release version 0.53.0.

Notes

Output of cargo version: cargo 1.51.0-nightly (c3abcfe8a 2021-01-25)
Output of rustc version: rustc 1.51.0-nightly (04caa632d 2021-01-30)

@ia0 ia0 added the C-bug Category: bug label Feb 2, 2021
@est31
Copy link
Member

est31 commented Feb 2, 2021

Hitting this issue in the cargo-udeps CI as well. cargo install --locked works, which means it's likely due to a dependency update. If I do the following, I can reproduce the issue on cargo-udeps master:

$ cargo update -p syn -p serde
    Updating serde v1.0.121 -> v1.0.123
    Updating serde_derive v1.0.121 -> v1.0.123
    Updating syn v1.0.59 -> v1.0.60

(It doesn't reproduce without that)

cc @dtolnay

@est31
Copy link
Member

est31 commented Feb 2, 2021

Already happens when I do:

$ cargo update -p syn && cargo update -p serde --precise 1.0.122
    Updating crates.io index
    Updating syn v1.0.59 -> v1.0.60
    Updating crates.io index
    Updating serde v1.0.121 -> v1.0.122
    Updating serde_derive v1.0.121 -> v1.0.122

And it does not happen when I run it for syn only, so I suspect it's either due to a serde or serde_derive change, between the 1.0.121 and 1.0.122 versions. changes link.

@est31
Copy link
Member

est31 commented Feb 2, 2021

See f097d02 and #9101

@est31
Copy link
Member

est31 commented Feb 2, 2021

and serde-rs/serde#1967

@ia0
Copy link
Author

ia0 commented Feb 2, 2021

I didn't mention in the initial post, but I actually got the issue when building cargo-outdated with cargo install cargo-outdated. So besides serde, this should also break CIs of projects where cargo-outdated is built with the command above. At least it did for https://travis-ci.org/github/ia0/data-encoding/jobs/757173491.

Not sure what is the release policy of cargo but when debugging this I was surprised to see that the latest published version is 0.50.0 while master is past 0.52.0. I was also surprised to see that the issue is not present in master, so the fix should just be to publish a new version.

@est31
Copy link
Member

est31 commented Feb 2, 2021

@ia0 release policy of the cargo crate is to release the new version on crates.io whenever there is a new release of rust/rustc. There is also a 6 week beta waiting period. So if the fix arrives in an "ordinary" way it'll take until March 25... hopefully it's realized that this is untenable, but let's see.

@ia0
Copy link
Author

ia0 commented Feb 2, 2021

Oh I see, that's good to know. Thanks for the info! I guess I'll just disable the cargo outdated test in my CI until this is fixed. This is not a big issue for me. I just felt I had to report it.

@est31
Copy link
Member

est31 commented Feb 2, 2021

You can also try if cargo install --locked works for you.

ia0 added a commit to ia0/data-encoding that referenced this issue Feb 2, 2021
@ia0
Copy link
Author

ia0 commented Feb 2, 2021

Yes it works, thanks!

@Eh2406
Copy link
Contributor

Eh2406 commented Feb 2, 2021

We discussed it in today's Cargo meeting. We are good to do a patch release of the library when a PR bacporting #9101 is merged.

@est31
Copy link
Member

est31 commented Feb 2, 2021

@Eh2406 that'd be awesome!

qryxip added a commit to qryxip/cargo-compete that referenced this issue Feb 3, 2021
qryxip added a commit to qryxip/cargo-compete that referenced this issue Feb 3, 2021
bors added a commit that referenced this issue Feb 3, 2021
Backport #9102 to the 1.50 release branch

As per #9124 (comment) here is a backport of #9102
@est31
Copy link
Member

est31 commented Feb 6, 2021

0.50.1 is out now (and the latest released version). I confirm that running cargo update on cargo-udeps does not break the build any more.

@Eh2406 Eh2406 closed this as completed Feb 6, 2021
@arkonbob
Copy link

Did 0.50.1 get taken down again? I amended the HomeBrew formula on my mac to pull 0.50.1 and it failed "fatal: couldn't find remote ref refs/tags/0.50.1".

Just had a look under tags/releases here and I don't see it.

@est31
Copy link
Member

est31 commented Feb 10, 2021

@arkonbob the release is available on crates.io, but it seems to not have been tagged in git. If you obtain cargo via the git dependency, you will have to use the raw commit hash of the release (or maybe maintainers can tag it).

The vcs info json accompanying the crates.io release indicates that the release commit is d61c808.

@Eh2406
Copy link
Contributor

Eh2406 commented Feb 10, 2021

Tagged. Thank you for finding the relevant links.

@arkonbob
Copy link

@est31 @Eh2406 perfect timing, thanks both.

Confirm HomeBrew is now able to pull with

resource "cargo" do
      url "https://github.com/rust-lang/cargo.git",
          tag: "0.50.1",
          revision: "d61c808dda8029721042618f22e8e15d01328af4"
    end

newkit pushed a commit to newkit/homebrew-core that referenced this issue Feb 11, 2021
Bump rust cargo to version 0.50.1 since build on Mac OS X did fail, see also this bug discription:
rust-lang/cargo#9124
kevswims pushed a commit to kevswims/cargo-bitbake that referenced this issue May 7, 2021
This works around the cargo compilation issue here: rust-lang/cargo#9124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants