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.12.0 fails to compile: wholesym trait bounds not satisfied #271

Closed
cdown opened this issue Jun 24, 2024 · 6 comments
Closed

0.12.0 fails to compile: wholesym trait bounds not satisfied #271

cdown opened this issue Jun 24, 2024 · 6 comments

Comments

@cdown
Copy link

cdown commented Jun 24, 2024

Didn't have time to look into what's going on here yet, but I thought you'd like to know. From cargo install samply:

   Compiling samply v0.12.0
error[E0277]: the trait bound `object::File<'_, R>: wholesym::samply_symbols::object::Object<'_>` is not satisfied
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-0.12.0/src/linux_shared/converter.rs:1130:44
     |
1130 |         let debug_id = debug_id_for_object(file)?;
     |                        ------------------- ^^^^ the trait `wholesym::samply_symbols::object::Object<'_>` is not implemented for `object::File<'_, R>`
     |                        |
     |                        required by a bound introduced by this call
     |
     = help: the following other types implement trait `wholesym::samply_symbols::object::Object<'data>`:
               wholesym::samply_symbols::object::File<'data, R>
               wholesym::samply_symbols::object::coff::CoffFile<'data, R, Coff>
               wholesym::samply_symbols::object::read::elf::ElfFile<'data, Elf, R>
               wholesym::samply_symbols::object::read::macho::MachOFile<'data, Mach, R>
               wholesym::samply_symbols::object::read::pe::PeFile<'data, Pe, R>
note: required by a bound in `debug_id_for_object`
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-symbols-0.22.1/src/debugid_util.rs:69:46
     |
69   | pub fn debug_id_for_object<'data>(obj: &impl Object<'data>) -> Option<DebugId> {
     |                                              ^^^^^^^^^^^^^ required by this bound in `debug_id_for_object`

error[E0277]: the trait bound `object::File<'_, R>: wholesym::samply_symbols::object::Object<'_>` is not satisfied
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-0.12.0/src/linux_shared/converter.rs:1169:63
     |
1169 |         let base_svma = samply_symbols::relative_address_base(file);
     |                         ------------------------------------- ^^^^ the trait `wholesym::samply_symbols::object::Object<'_>` is not implemented for `object::File<'_, R>`
     |                         |
     |                         required by a bound introduced by this call
     |
     = help: the following other types implement trait `wholesym::samply_symbols::object::Object<'data>`:
               wholesym::samply_symbols::object::File<'data, R>
               wholesym::samply_symbols::object::coff::CoffFile<'data, R, Coff>
               wholesym::samply_symbols::object::read::elf::ElfFile<'data, Elf, R>
               wholesym::samply_symbols::object::read::macho::MachOFile<'data, Mach, R>
               wholesym::samply_symbols::object::read::pe::PeFile<'data, Pe, R>
note: required by a bound in `wholesym::samply_symbols::relative_address_base`
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-symbols-0.22.1/src/shared.rs:646:56
     |
646  | pub fn relative_address_base<'data>(object_file: &impl object::Object<'data>) -> u64 {
     |                                                        ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `relative_address_base`

error[E0277]: the trait bound `O: wholesym::samply_symbols::object::Object<'_>` is not satisfied
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-0.12.0/src/linux_shared/converter.rs:1301:71
     |
1301 |                 let base_svma = samply_symbols::relative_address_base(file);
     |                                 ------------------------------------- ^^^^ the trait `wholesym::samply_symbols::object::Object<'_>` is not implemented for `O`
     |                                 |
     |                                 required by a bound introduced by this call
     |
note: required by a bound in `wholesym::samply_symbols::relative_address_base`
    --> /home/cdown/.cargo/registry/src/index.crates.io-6f17d22bba15001f/samply-symbols-0.22.1/src/shared.rs:646:56
     |
646  | pub fn relative_address_base<'data>(object_file: &impl object::Object<'data>) -> u64 {
     |                                                        ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `relative_address_base`
help: consider further restricting this bound
     |
1282 |     pub fn compute_base_avma<'data, O: Object<'data> + wholesym::samply_symbols::object::Object<'_>>(
     |                                                      ++++++++++++++++++++++++++++++++++++++++++++++

For more information about this error, try `rustc --explain E0277`.
error: could not compile `samply` (bin "samply") due to 3 previous errors
@cdown
Copy link
Author

cdown commented Jun 24, 2024

--locked works, so it seems like then somewhere some versioning or version ranges are not restrictive enough.

@mstange
Copy link
Owner

mstange commented Jun 24, 2024

Ugh, thanks for reporting! I may need to yank the recent dot release of samply-symbols.

@mstange
Copy link
Owner

mstange commented Jun 28, 2024

I'm working on this now.

@mstange
Copy link
Owner

mstange commented Jun 28, 2024

Here's the dependency chains as written down in each released crate's Cargo.toml:

samply 0.12.0 -> wholesym 0.5.0 -> samply-symbols 0.22.0 -> object 0.35
samply 0.12.0 -> wholesym 0.5.0 -> object 0.35

samply-symbols has a public API which expects a type from object.

I recently released samply-symbols 0.22.1 which depends on object 0.36. This was a mistake, because it is a breaking change to the public API debug_id_for_object.
Now wholesym 0.5.0 can no longer pass its object 0.35 types to debug_id_for_object.

I'm planning to release samply-symbols 0.22.2 with the same code as samply-symbols 0.22.0. Then I will yank samply-symbols 0.22.1.

@mstange mstange changed the title 1.12.0 fails to compile: wholesym trait bounds not satisfied 0.12.0 fails to compile: wholesym trait bounds not satisfied Jun 28, 2024
@mstange
Copy link
Owner

mstange commented Jun 28, 2024

Done. cargo install samply works for me locally again.

@mstange mstange closed this as completed Jun 28, 2024
@mstange
Copy link
Owner

mstange commented Jun 28, 2024

cargo semver-checks missed this breaking change, I think that's obi1kenobi/cargo-semver-checks#638 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants