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] conan profile detect does not detect compiler.update for msvc #13329

Closed
mpusz opened this issue Mar 5, 2023 · 4 comments
Closed

[bug] conan profile detect does not detect compiler.update for msvc #13329

mpusz opened this issue Mar 5, 2023 · 4 comments
Assignees

Comments

@mpusz
Copy link

mpusz commented Mar 5, 2023

Environment details

  • Conan version: 2.0.1

Steps to reproduce

The set of C++ features supported in the MSVC compiler with each new compiler update improves a lot. validate() method often will require not just a major compiler version but also at least a specific update version to work correctly on the MSVC compiler (i.e. mp-units requires at least 192.8 to compile). By default, conan profile detect does not set the update number in the profile, which is a big issue:

  • builds with different updates may have a different ABI (Because they will have to use workarounds on earlier versions where C++ specific feature is not supported)
  • on the CI like GitHub Actions, it is hard to track which compile update is the current one, so setting it for the build should not be hardcoded in the GitHub-related scripts

Logs

No response

@memsharded memsharded self-assigned this Mar 5, 2023
@memsharded
Copy link
Member

Hi @mpusz

I am afraid that this is intentional. Adding the update to the profile detect would explode the number of combinations that ConanCenter and users have to build and deal with

builds with different updates may have a different ABI (Because they will have to use workarounds on earlier versions where C++ specific feature is not supported)

Yes, they might have different ABI, but the model in general works very well with forward versions, 99% of the cases is good, this cannot default for the exception case, but for a balanced case

on the CI like GitHub Actions, it is hard to track which compile update is the current one, so setting it for the build should not be hardcoded in the GitHub-related scripts

Yes, users that will want to detail the ABI compatibility down to the update, will have to specify the update themselves, because as explained above, defaulting to detail the update will be a very bad default for ConanCenter packages and many users

@mpusz
Copy link
Author

mpusz commented Mar 5, 2023

Can't it be somehow handled by the compatibility.py? I mean that the update would be detected but maybe ignored for most packages? This would however allow using it in validate() and other places if needed.

@memsharded
Copy link
Member

Default compatibility.py cannot explode the configurations to validate either, as the resolution of binaries is linear in the number of hypothesis to check. Needing to check like 10 different updates for every binary will make the resolution of binaries much slower (it would multiply by the number of cppstd configurations to check), so this is not a possibility at the moment. At some point we will try to design and implement a v3 protocol with servers that could resolve this faster, but it will take time.

I'd suggest that you document that it is necessary to have the latest update of the compiler (I think this is similar to what we do in ConanCenter), and that should be a pragmatic solution, it has worked very well in ConanCenter for a long time.

@memsharded
Copy link
Member

Closing this as not a bug, the default profile detect will not add the compiler.update for msvc.

#15435 might make available the update detection via detect_api for users wanting to automate that in their profiles

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