-
Notifications
You must be signed in to change notification settings - Fork 47
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
MIT licensed Antlr4 parser #74
Comments
Hi @arixmkii To me this looks like some serious downsides just to solve an issue that so far nobody complained about. And as you say Antlr is quite big. I try to keep the list of dependencies for this project really small as it is only required on application startup, therefore I do not want to have lots of dependencies residing in memory that are not used at all. Call me old fashioned here :) Also, I would really don't want to loose support for Java 8 just yet. I think there is still lots of people operating on it and loosing the option to use the InMemory testing is also.... suboptimal. So, unless there are really strong reasons for doing this I would leave it as is for now. The idea for the CLI is not bad actually! |
Unfortunately yes. In some cases we are allowed to link against LGPL based libraries, but this has to be checked with legal dept on a case per case basis, it is not a license from the allowed list. There are often options to extract/move codes between microservices (sometimes creating new ones), so, this is less of an issue than it was in the time of monoliths.
This is another way to mitigate an issue. Using pre-built LGPL app is allowed in most cases, because there is no derivative work involved. I will revisit my experiment some time later and post an update here if I have some working prototype. |
I thought about this a bit more and one way we could also do this without introducing so many dependencies is to create an API package for the Parser and then have different implementation packages. I can create the default package with the existing parser. That would give you the option to specify an exclude statement in your pom/gradle file so that the LGPL code is not taken. You can then create your own implementation based on ANTLR which is used instead. I need to come up with an easy way to pick up the implementation available on the classpath but in doubt that could be done with a file in the META-INF folder of the implementation jar. Like this there should be no change required for existing users of the library. What do you think? |
Yes, this was my idea as well. To make it as invisible for the current users as possible and provide a new option with a different license. As I see it:
I will try to make some time to sketch it in code. |
Idea is to replace LGPL licensed parser with MIT licensed version from https://github.com/antlr/grammars-v4/blob/master/cql3/CqlParser.g4 (I contributed fixes, which allowed all tests to pass).
I created an experimental implementation here arixmkii@4c50310 It passes all tests with this parser (but I had to extract embedded cassandra).
This is a significant change, because it will put a minimal JDK requirement to 11 for build and run. Also it will need to use test containers or something similar as embedded cassandra is troublesome with JDK 11. Antlr4 itself is not the most lightweight thing and could be unacceptable in some scenarios.
For me it looks like this will need to have major version bump and I imagine the plan to go there like this:
cassandra-migration
(implementation with old parser, mixed license) andcassandra-migration-core
(without any parsers and only abstract class, MIT licensed);cassandra-migration-antlr4
(with antlr4 parser, MIT licensed);_v4
suffix and remove support for cassandra v3 driver at all;Further additions for new major could be:
The text was updated successfully, but these errors were encountered: