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

antlr4-cppruntime: Upgrade to 4.11.0/4.11.1 #12902

Merged
merged 29 commits into from
Oct 11, 2022

Conversation

0xFireWolf
Copy link
Contributor

@0xFireWolf 0xFireWolf commented Sep 12, 2022

Specify library name and version: antlr4-cppruntime/4.11.0, 4.11.1

This PR contains the following changes:

  • Upgrade the runtime library to 4.11.0 and 4.11.1.
  • Drop the dependency on libuuid as of 4.11.0.
  • Support ARM architectures as of 4.11.0.
    • The previous receipt mentions that ARM is not supported due to the missing library libuuid.
  • The minimum version of GCC is now 8 (previously 7) to target C++17. (Will be reverted; See Below.)

Thank you.


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@0xFireWolf 0xFireWolf marked this pull request as draft September 12, 2022 00:09
@0xFireWolf 0xFireWolf marked this pull request as ready for review September 12, 2022 00:17
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@0xFireWolf
Copy link
Contributor Author

0xFireWolf commented Sep 12, 2022

The compiler errors reported by GCC 7 has been fixed by the PR antlr/antlr4#3885 which is pending review and approval. The minimum compiler requirement will be restored from GCC 8 to GCC 7. Depending upon when the next version of antlr4 will be released, I may choose to include a patch file that fixes the compiler errors to ship antlr4-cppruntime/4.11.1 as soon as possible.


  • Antlr4 Pull request has been merged
  • The compiler requirement has been restored
  • The patch file specified to 4.11.0/4.11.1 is now included

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit a73153d
antlr4-cppruntime/4.10
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.10.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.9.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.9.3.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.10.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.10.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.11.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.11.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.11
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.11.0.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.

@danimtb
Copy link
Member

danimtb commented Sep 21, 2022

there are some annotations made by the linter to support conan v2. @0xFireWolf would you mind having a look at them? thank you!

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2022

Hooks produced the following warnings for commit 9f95ef0
antlr4-cppruntime/4.10.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.10.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.9.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.9.3.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.11.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.11.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.

michalwidera
michalwidera previously approved these changes Oct 8, 2022
Copy link
Contributor

@michalwidera michalwidera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@0xFireWolf 0xFireWolf requested review from prince-chrismc and uilianries and removed request for prince-chrismc October 8, 2022 20:43
@michalwidera
Copy link
Contributor

michalwidera commented Oct 9, 2022

Looking at: https://github.com/conan-io/conan-center-index/blob/master/docs/policy_patching.md
According to [Rules/Source patches] - we need higher authority than mine to get acceptance.

Copy link
Contributor

@jwillikers jwillikers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! One minor quibble, but otherwise looks golden.

recipes/antlr4-cppruntime/all/conanfile.py Outdated Show resolved Hide resolved
…ictionary. The first `check_min_vs()` call already ensures that MSVC supports C++17.
Copy link
Contributor

@jwillikers jwillikers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@prince-chrismc
Copy link
Contributor

The patching being applied here is really in a grey area for me. It's a really tough call and my opinion is not the final word

  • The core principle behind the patching policy is to "provide working code" and as you have so well put it, the patch

does not change antlr's runtime behavior at all

Now, looking at this conversation and how it has changes for the last month for almost 2 hours I have some suggestions and comments.

😻 💟 ❤️ thank you so much for the time and patients getting this PR updated ❤️ 💟 😻

I absolutely agree this patch at one point could be close to the "working code" requirement. However I think a few things have changed in the last two weeks since I started reviewing this PR so I am on the other side of the fence.

Let me break down my perspective.

Problem 1: Antlr was not using UUID

  • libuuid is not used since at least ANTLR 4.9 (revealed in [C++] Remove libuuid dependency  antlr/antlr4#3787).
    As such, I decided to backport this fix from 4.11.x to 4.9.3 and 4.10.x because doing so makes antlr no longer dependent on non-header-only libraries and does not change antlr's runtime behavior at all.

"its not being use by this library" does not mean the Conan consumer is not expecting it to be present.
Conan users very often pull more than one package and given how 1.x works people expect ALL of the deps to be made available backporting this will break their expectations as the 4.9.3 did in fact require libuuid.

I absolutely understand this respects the correctness of this libary, but as a ConanCenter contributors my focus is more on the consumers who rely on the packages. How would they see this change if it broke their project?

Problem 2: ARM Support

  • libuuid prevents compilation on Apple Silicon-based Macs (notes added by @michalwidera).

It does in fact work. https://packages.ubuntu.com/bionic/uuid-devhas been shipping for a while on ARM but the recipe just had not been updated to work there. The last PR published packages for it https://c3i.jfrog.io/c3i/misc/summary.html?json=https://c3i.jfrog.io/c3i/misc/logs/pr/13130/1/libuuid/1.0.3//summary.json so it should be availble now.

Again this was added the well after PR was started, the comments made were accurate but the speed at which we are moving is really exciting to see 🚀 so it could be reconsidered.

Problem 3: New Generator Support

As for things not working with the new generators https://github.com/conan-io/conan-center-index/blob/d9ad528b30032bb01c5d522224e5b604c6fa6501/recipes/libuuid/all/conanfile.py
Is was migrated after those comments were written which is not surprising given how fast things are changing

As for the build problem that was encountered, I am pretty sure it's related to this conan-io/conan#11962
The CMakeToolchain provided paths and the cache layout means the build-in CMake pkg_config support does not work... I tried to look but the workaround does not seem to have been used in the PR, which would certainly cause the problem that was seen.

I think it would be worth giving it a second shot with this new information. 😸


I 100% think the work that was done was right, you've all done fantastic work

@conan-center-bot
Copy link
Collaborator

All green in build 15 (d9cc6f5d52fc7982c4e67c4ec5553034cd84cbb1):

  • antlr4-cppruntime/4.10.1@:
    All packages built successfully! (All logs)

  • antlr4-cppruntime/4.9.3@:
    All packages built successfully! (All logs)

  • antlr4-cppruntime/4.11.1@:
    All packages built successfully! (All logs)

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit d9cc6f5
antlr4-cppruntime/4.10.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.10.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.9.3
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.9.3.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
antlr4-cppruntime/4.11.1
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.so' links to system library 'm' but it is not in cpp_info.system_libs.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.4.11.1.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.
post_package(): WARN: [MISSING SYSTEM LIBS (KB-H043)] Library './lib/libantlr4-runtime.dylib' links to system library 'CoreFoundation' but it is not in cpp_info.frameworks.

@0xFireWolf
Copy link
Contributor Author

@prince-chrismc First of all, I want to thank you for the thoughtful comments and suggestions.

RE: Problem 1: Antlr was not using UUID

"its not being use by this library" does not mean the Conan consumer is not expecting it to be present. People expect ALL of the deps to be made available.

This does not make sense to me at all. If developers need libuuid for their projects, they should explictly add libuuid/1.0.3 to their conanfile.txt. Importing a package implicitly should be strongly discouraged or even disallowed. To me, their expectation was actually misled or, precisely speaking, is wrong because of Conan 1.x being too permissive. The C compiler even warns the users when they use a function implicitly without including the header.

But as a ConanCenter contributors my focus is more on the consumers who rely on the packages. How would they see this change if it broke their project?

I duly understand that you care a lot about your consumers, but to some extent your comments make me feel like you are being overprotective of them. Yes, they will observe that their projects cannot be compiled if they import libuuid implicitly, but I believe that this is also their opportunity to fix this bug in their build system. We could certainly add a print statement in requirements(), warning them to add libuuid to their conanfile.txt if they really need it.

To be honest, I didn't even know that antlr depended on libuuid until I upgraded this recipe, because I trust Conan to resolve all the dependencies for me automatically and correctly. I do hope that other antlr users have the same experience as me, so that we won't even notice the removal of libuuid.

RE: Problem 2: ARM Support

I sincerely thank you for the information because I don't have the time to keep track of other recipes.
However, whether the libuuid recipe supports ARM now is no longer important because it was not and will not be needed by antlr.

RE: Problem 3: New Generator Support

Your comment conan-io/conan#11962 (comment) posted 8 hours ago indicated that the workaround did not fix all the issues. As such, implementing this hacky workaround for the generator of a package which is actually not used by antlr at all is just a waste of effort. Besides, I believe that this discrepancy of pkgconfig will eventually be fixed in a newer Conan release, so are we going to remove this workaround or enable this workaround conditionally when the new Conan is released? To me, the best solution is to remove libuuid, solving the issue once and for all. This recipe remains concise and respects the correctness of the antlr library.

My conclusion

I am not inclined to add libuuid back to this recipe.
Antlr 4.11.1 was released on Sep 4, and I opened this PR on Sep 11, hoping to ship 4.11.1 as soon as possible.
Making the recipe compatible with Conan 2.0 was not even the goal of this PR, but thanks to uilianries's help we made it.
This update is way past due, and as one of your consumers, I am also looking forward to upgrading to antlr 4.11.1 for my projects.
Unfortunately, I do not have the time for the so-called second shot.
If we cannot reach a mutual agreement or you are uncomfortable with my proposed changes, please feel free to close this PR or I can close it myself.

Thank you and I hope that you can understand my position.

@michalwidera
Copy link
Contributor

Suggestion of way of resolving this conflict:
Remain as it is without changing the code with patches and Limit platforms for them

  • 4.9.3
  • 4.10.0
  • 4.10.1
  • 4.11.0
  • 4.11.1
    and then add following binaries:
  • 4.9.3-patch1
  • 4.10.1-patch1
  • 4.11.1-patch1
    That has no dependency to libuuid and have bug fixes and is able ARM compilation.
    That will create non changed artifacts and libraries with required changes?
    Is this plan ok for all ?
    @prince-chrismc @uilianries @0xFireWolf - what you think ?

@prince-chrismc
Copy link
Contributor

Asking the Conan team for a second opinion, they can be the tie breaker 🤞

I am completely on the fence and my personal bias around patches is not a deciding factor 😄

@prince-chrismc
Copy link
Contributor

Okay, this is a really hard one. So thanks for working with me on it. Let me capture our reasoning as precedence


Our criteria for patches is "makes working software" the patches in question do not reach that (per say), they do however allow building more easily.

Given this is aligned with the projects expectations, combined with the uncertainty of CMakeToolchain + PkgConfigDeps this is a valid backport. From the project's perspective this should have never been required and this make it more available from a Conan perspective

@conan-center-bot conan-center-bot merged commit 8e8536d into conan-io:master Oct 11, 2022
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

Successfully merging this pull request may close these issues.

7 participants