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

[bug] binary cache not used, claim is same settings and options but different dependencies, dependencies looks identical to me #17262

Open
hpe-ykoehler opened this issue Oct 31, 2024 · 6 comments
Assignees

Comments

@hpe-ykoehler
Copy link

Describe the bug

I have a situation where the binary cache is not being used.

The conan graph explain says that the following:

        dependencies
          expected: hiredis/1.1.Z, libev/4.33.Z
          existing: hiredis/1.1.0#312991eb91791ad706f038d6a8383c63:be712621cf2b2bb3dfabbbfedf4c2b102294b18a, libev/4.33#8fc921587a3733e276520386c84ac583:5e6e38e5a54ca49246fc1eefcd6700d1d71fa40f
        explanation: This binary has same settings and options, but different dependencies

using conan 2.9.1

Yet we can see above that hiredis 1.1.0 is same as 1.1.Z and libev 4.33 should be treated same as 4.33.Z but apparently it is not.explains

How to reproduce it

Create a package with libev 4.33 as a dependency, seems that because the version has only two parts, the cache binary system fails to recognized it as greater or equal version.

(assuming I misunderstand the underlying bug)

@hpe-ykoehler
Copy link
Author

I believe the same is occurring with pcre2 which also have 2 parts only in its version.

@memsharded memsharded self-assigned this Oct 31, 2024
@memsharded
Copy link
Member

Hi @hpe-ykoehler

Thanks for your report.
This doesn't look a bug so far.
The conan graph explain is reporting:

expected: hiredis/1.1.Z, libev/4.33.Z
existing: hiredis/1.1.0#312991eb91791ad706f038d6a8383c63:be712621cf2b2bb3dfabbbfedf4c2b102294b18a, libev/4.33#8fc921587a3733e276520386c84ac583:5e6e38e5a54ca49246fc1eefcd6700d1d71fa40f

This means that the existing package binary was created with some "package_id_mode" like full_mode. This can happen because some external configuration, like the core.package_id:default_non_embed_mode, but also because some package changed the package_type, or modified its package_id.

Yet we can see above that hiredis 1.1.0 is same as 1.1.Z and libev 4.33 should be treated same as 4.33.Z but apparently it is not.explains

What the conan graph explain displays should be an exact match. Only 1.1.Z matches 1.1.Z, it doesn't match 1.1.0#rev. Those factors are not version ranges or semver versions, the values are hashed as they are to compute the package_id.

@hpe-ykoehler
Copy link
Author

I am unclear how you got from the output to "package_id_mode", and why would not the explain output also mention that?

I am not sure I get where the 1.1.Z (the Z?) where it comes from, and even less why it is "expected". We certainly do not use that in our version.

Somehow the explanation given by conan graph explain is raising more question than answers.

@hpe-ykoehler
Copy link
Author

hpe-ykoehler commented Nov 1, 2024

Found more information here: #16161

Will explore if the shared option changes or transitive flags, yet I still don't get where the Z comes from, why it is displayed and what is means.

@memsharded
Copy link
Member

This is explained in https://docs.conan.io/2/reference/binary_model/dependencies.html, you can see for example how https://docs.conan.io/2/reference/binary_model/dependencies.html#non-embed-mode explains the mapping to the .Z.

@hpe-ykoehler
Copy link
Author

hpe-ykoehler commented Nov 2, 2024

Thanks I think this help clarified things, I do wish it was more obvious in the conan graph explain output.

Wouldn't there be a way to preserve the profile and the requires() attributes used to build a binary cache as to enable comparison on such failure to then be able to pinpoint changes in options (shared/static) or transitive aspect?

Being able to say:

dependencies option mismatch 
  cached options:
    ...
  requested options:
    ...
    
 dependencies require flags mismatch
   cached flags
     ...
    requested flags
     ...

would be a lot more useful

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

2 participants