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
gherkin: namespace conflict between old and new gems #1063
Comments
Anything? |
Good news! This is no longer a necessarily a blocking issue for my project. I am able to model |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
It is a problem that resurfaces on a regular basis, including within the past week. I'm going to say that that is still counts as 'active' |
Unfortunately, I'm not sure that there is a way to solve this problem that doesn't boil down to "upgrade all of your dependencies and stop using the old stuff". Even with added version restrictions on the newer libraries, users would still have to update those libraries to get the fixes. An once they've upgraded to get then they're already no longer using the old stuff and so the problem is solved anyway. So...I think that this kind of problem could only have been avoided by deciding against the design choices that led to it in the first place. :/ A fix for the issue being practically moot, this issue can be closed. I'll just keep linking to it for reference as people encounter problems until the community as a whole has moved on to the newer libraries. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
Can anyone please help me, I am also getting the same issue , I am using these gems Error: I tried Keep the default argumentdef initialize(ast_builder = AstBuilder.new(Cucumber::Messages::IdGenerator::UUID.new)) |
You are likely using the conflicting gems for gherkin. Ideally ensure you don't install gherkin manually (Although it is possible). There is a As you are using an old version of cucumber (v3), I'd also advise you to upgrade that if possible. As we don't support legacy versions of the software currently. If you have an issue still after this, please open a new issue |
Summary
Both the
gherkin
gem and thecucumber-gherkin
gem that replaced it use the same module namespace (e.g.Gherkin
) and so they can conflict if they are both loaded.According to all conventions and tools, they are separate gems and so will not conflict with each other but, because they effectively are the same gem from a code standpoint, they cannot co-exist in the same runtime without stepping on each other's toes. This is causing some Dependency Hell for projects that end up transitively needing both gems because Bundler (or anything else) doesn't know that they are the same library.
In my case, I am now limited to using Cucumber 2.2.0 in several of my projects. Even 3.x Cucumber has been 'broken' because of the namespace issue. Cucumber 3.x doesn't use
cucumber-gherkin
according to its gem specification but Ruby will still end up in that code at runtime, even though it should end up in code from thegherkin
gem, which is what my project explicitly declares as a dependency and intends to be using.Expected Behavior
gherkin
andcucumber-gherkin
would either use their respective conventional namespaces ofGherkin
andCucumberGherkin
or be prevented from co-exsisting in a dependency tree, thus preventing any code conflicts.Current Behavior
Both
gherkin
andcucumber-gherkin
use theGherkin
namespace and there are not version limits in place in thecucumber
tech stack to prevent various support libraries from transitively pulling in both gems.cucumber
2.2.0 remains safe to use due to (I'm guessing) it's usage ofgherkin3
instead ofgherkin
andgherkin3
follows convention by using theGherkin3
namespace, thus avoiding conflicts withcucumber-gherkin
.Possible Solution
From what I can tell, the namespace overlap is intentional, so as to make
cucumber-gherkin
a 'drop-in' replacement ofgherkin
. That rules out fixing the namespace overlap, Therefore, it will probably have to be handled by updating all of the various support libraries to have better version limits.Steps to Reproduce (for bugs)
Here is
cucumber
3.x ending up incucumber-gherkin
and here is
cucumber
4.x ending up ingherkin
Context & Motivation
I tried upgrading to the newest version of
cucumber
and ended up having to immediately downgrade so hard that I had to go back in time 4 years to make things work again. I am limited to usingcucumber
2.2.0 in all of my projects* and, if I ever need to start using theRule
keyword or any of the newer syntax, Cucumber will become entirely unusable for me. Given that my primary project models Gherkin syntax, that will become an issue sooner rather than later.*Even the most recent version of my project that only uses
cucumber
4.x andcucumber-gherkin
won't work becausecucumber-gherkin
doesn't work on JRuby 9.1.7 (#1064).Your Environment
cuke_linter
, you'll get a twofer and encounter gherkin: Encoding issues on Windows #1065.The text was updated successfully, but these errors were encountered: