ANTLR4 and Go


The antlr4-project package was introduced in early 2020. It contains a parser generator written in Java, and runtimes for various languages, currently Java, JavaScript, C++, Python, and Go. At the time, various packages had bundled copies of the language runtimes, which were moved to the new package.

Later, I opened PRs against the packages with antlr4-generated parsers, to force them to regenerate the parsers at build time. This was necessary because of a backwards incompatibility introduced into the runtimes. We needed to make sure the packaged runtimes matched the parser code to avoid having parsers explode at runtime.

Later still, I discovered that we had duplicate Go runtimes in Fedora. In addition to golang-antlr4-runtime-devel, a subpackage of antlr4-project, we also had golang-github-antlr-antlr4. I asked the maintainers of that package to retire it in favor of the subpackage, which they did.

When antlr4 version 4.11.0 was released, we ran into a problem. That version once again made some backwards incompatible changes, and not all packages were ready to move to the new version. Over time, the various upstreams made the necessary changes. However, the Go ecosystem has an issue: a new version of golang-github-google-cel is needed to update antlr4-project, but it in turn requires an update of golang-google-genproto, which requires adding a massive number of new packages.


Matters have remained in that state for some time. However, the pressure to update antlr4-project has been growing. I’ve got a user who wants the Typescript code generator, which was added in version 4.11.

A new version of sympy was just released (1.13.0), and it wants antlr4 version 4.11 or later.


I need those involved in Go packaging to do something so we can unblock the antlr4-project update. I suggest one of the following:

  1. Open review requests for the new packages needed to update golang-google-genproto. I will help review them. (Note that I am not volunteering to review all of them, but I will dedicate as much time as I can to reviewing them.) This would also solve another problem related to the old version of golang-google-genproto.

  2. Bring back golang-github-antlr-antlr4, and add Obsoletes and Provides for golang-antlr4-runtime-devel. This will let you stay on antlr 4.10 indefinitely. However, you won’t be able to regenerate parsers with the antlr4 tool, as the runtime would not be compatible with the generated parsers.

Please let me know what you want to do so I can plan the antlr4-project and sympy updates. Thank you!


It turns out that golang-google-genproto had already been updated, but nobody remembered to tell me and I didn’t check. Move along now, nothing to see here…

For the record, antlr4 4.13.1 has been built in Rawhide.

1 Like

Can close this?

Yes. But I seem to have gone blind. I don’t see a “Solved” button anywhere. Am I looking right at it and not seeing it?

1 Like

Maybe because it’s listed under Project Discussion