-
Notifications
You must be signed in to change notification settings - Fork 985
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
compiler.version semantics and GCC/Clang versioning quirks #1214
Comments
A small tip: If you are using one compiler version and want to install a certain different compiler version for one package, you could use package-settings like I think this issue has little to do with compiler detection. The compiler detection that is run when conan is first executed, it is just a guess to initialize Also, for adoption in your company, not sure if you know that the settings can be fully customized. You can edit the file You are right, changing the default |
Thank you for the detailed response. I would like to set
I understand that there could be use for having both 6.2 and 6.3 packages, but it's just the same as having both 4.7.2 and 4.7.3, even in the number of packages over time. It is just a matter of reasonable compromise. |
I think that in order to make it work, you should:
The issue is that we cannot change the current settings.yml, as it would break for a ton of users. Also I feel that the current scheme is slightly better than the previous one, i.e. having packages for 6.2 and 6.3 by default could be a good thing, more on the safe side than the opposite. As always, it is a trade-off, having more binaries, but having binaries built with the latest minor compiler version and not stick always just to the packages built with an older version. |
We are facing this while upgrading some packages and updating conan-package-tools. Indeed it is a bit of inconvenience, because minors are being frequently released, and the bad thing is that distros are just replacing the old one, like gcc 7.1 with the new gcc 7.2, so it is no longer easy to install 7.1 at all (in fact, it seems rather complicated). We are thinking to do the next changes to conan:
Doing this we would achieve what was already achieved with older gcc 4.9.X versions, in which the compiler could be updated without issues, and packages were compatible. |
For https://github.com/conan-io/conan-docker-tools we would generate tags for conangcc5, conangcc6, conangcc7 and just use the available, abandoning the minor version (we could keep the existing images, but not generating new ones) |
In our case, we generate a settings.yml with our init script and we don't depend on OS-installed toolchains. For us, it's best if the checks are strict because we want to avoid situations where a toolchain outside our packages is used accidentally. For OSS usage, it's probably best to make it less strict. |
Yes, I think proposed model will support both cases. If you want to create packages for 7.1, you can, and it should be consistent, and if you do for 7, then you will get the less strict behavior. |
Thanks @sztomi. I think the check could take into account if you have declared in |
I just started looking into this, but if I'm understanding correctly that the default behavior for compiler.version=7 is to allow {gcc7.1, gcc7.2, ...} I'm all for it. I prefer not setting up profiles if I can possibly help it, that's one of the annoyances of working with conda. |
Hi, Adam nice to read you! To summarize, the purposed behavior is:
|
Anyone knows the semantics of Is 8.1 just a bug-fix release wrt 8.0? Many thanks! |
This should be fixed now:
|
Released in 0.30, from now, conan should use the majors for gcc and clang by default, not the minors. |
Conan currently uses
MAJOR.MINOR
as thecompiler.version
ABI compatibility key for GCC/Clang, and this key is included inpackage_id
by default. As far as I understand, this choice is a reasonable compromise: it allows seamlessly upgrading, for example, GCC 4.7.2 to GCC 4.7.3 (which is a bugfix-only release, with no new features), and distinguishes packages built with GCC 4.7 and 4.8 (a normal release with many new features, so the user could care about that). The same logic applies to Clang versioning scheme.But recently, both GCC >= 5 and Clang >= 4 have changed the semantics of their version numbers. Now major version number will increase on any non-bugfix release. While Clang made their versioning change backwards-compatible (there will be no Clang 4.1.x or 5.1.x ever, just X.0.Y), GCC took a different approach: GCC 5.2 is a small bugfix release to 5.1 (and there is no 5.0 release, but that does not matter much).
So, using the current default
compiler.version
detection has entirely different and surprising behavior on GCC >= 5. You cannot reuse binary packages over a bugfix-only compiler version difference, and the cmake generator even checks that actual compiler version matchescompiler.version
, which prohibits usingcompiler.version=6.2
as the equality class forGCC 6.x
. It could be patched individually for each package (including all dependencies) by manually specifyingcompiler.version=6
inpackage_id
method, but this is a laborious workaround.I would argue that the default behavior should be specified in terms of having more or less the same semantics on all compilers, not by just enforcing a formal rule with
MAJOR.MINOR
. In case of GCC, that would require makingcompiler.version
equalX
for GCC X.Y whereX >= 5
, and adjusting compiler version checks to handle more flexible version comparison. The same could be done for Clang >= 4, but luckilyX.0
would still work just fine.I understand that there could be some backwards compatibility concerns over changing the default compiler detection logic. At the very least, making the suggested behavior a global configuration opt-in would make adoption of Conan at my company much easier (GCC 5.x and 6.x are widely used here).
This is probably related to #1136 and #1127.
The text was updated successfully, but these errors were encountered: