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

Compiling cargo fails during PGO profiling #81378

Closed
pietroalbini opened this issue Jan 25, 2021 · 2 comments · Fixed by #81380
Closed

Compiling cargo fails during PGO profiling #81378

pietroalbini opened this issue Jan 25, 2021 · 2 comments · Fixed by #81380
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) P-high High priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@pietroalbini
Copy link
Member

We're currently not using lockfiles during PGO profilings, and Cargo just broke with the latest serde version. Error message:

    Checking crates-io v0.31.1 (/tmp/cargo/crates/crates-io)
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`.
@pietroalbini pietroalbini added P-high High priority A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jan 25, 2021
@pietroalbini
Copy link
Member Author

Found the cause: building cargo for PGO profiling doesn't use the monorepo's lockfile, and since Cargo itself doesn't have any lockfile there are no locked dependencies during the PGO profiling build.

@pietroalbini
Copy link
Member Author

cc @rust-lang/cargo

I'm going to fix this on Rust CI's side by using the monorepo's lockfile when building Cargo for PGO profiling, but you probably want to report the serde regression upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-spurious Area: Spurious failures in builds (spuriously == for no apparent reason) P-high High priority T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant