Can't cleanup due to circular dependency between cucumber and gherkin gems

51 views
Skip to first unread message

moritz

unread,
Sep 26, 2010, 10:05:36 PM9/26/10
to Cukes
There is a circular dependency between the cucumber and gherkin gems
that makes cleanup hard:

You have requested to uninstall the gem:
cucumber-0.8.5
...
gherkin-2.1.5 depends on [cucumber (~> 0.8.5)]
...

You have requested to uninstall the gem:
gherkin-2.1.5
cucumber-0.8.5 depends on [gherkin (~> 2.1.4)]

Even though, I have newer versions in the gem repository

cucumber (0.9.0, 0.8.5)
gherkin (2.2.4, 2.1.5)

neither of them would meet the '~>' requirement.

A similar circular dependency is present in the new gems as well.
Could this possibly be relaxed on one end using '>='? That would make
cleanup easier, as it is not always easy to discern that it is ok to
use 'Y' on the continue question.


Matt Wynne

unread,
Sep 27, 2010, 4:52:21 AM9/27/10
to cu...@googlegroups.com

Why does gherkin depend on Cucumber? As far as I can see, it only needs Cucumber for its tests, so that shouldn't be a production dependency.

>
>
> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>

cheers,
Matt

http://blog.mattwynne.net
+44(0)7974 430184

moritz

unread,
Sep 27, 2010, 4:19:07 PM9/27/10
to Cukes
If you say that one dependency can disappear that would even be
better. Circular dependencies are evil. So this is a bug?
> > For more options, visit this group athttp://groups.google.com/group/cukes?hl=en.

aslak hellesoy

unread,
Sep 27, 2010, 4:50:53 PM9/27/10
to cu...@googlegroups.com
On Mon, Sep 27, 2010 at 10:19 PM, moritz <a5s...@yahoo.com> wrote:
If you say that one dependency can disappear that would even be
better.  Circular dependencies are evil.  So this is a bug?

On Sep 27, 1:52 am, Matt Wynne <m...@mattwynne.net> wrote:
> On 27 Sep 2010, at 03:05, moritz wrote:
>
>
>
>
>
> > There is a circular dependency between the cucumber and gherkin gems
> > that makes cleanup hard:
>
> > You have requested to uninstall the gem:
> >    cucumber-0.8.5
> > ...
> > gherkin-2.1.5 depends on [cucumber (~> 0.8.5)]
> > ...
>
> > You have requested to uninstall the gem:
> >    gherkin-2.1.5
> > cucumber-0.8.5 depends on [gherkin (~> 2.1.4)]
>
> > Even though, I have newer versions in the gem repository
>
> > cucumber (0.9.0, 0.8.5)
> > gherkin (2.2.4, 2.1.5)
>
> > neither of them would meet the '~>' requirement.
>
> > A similar circular dependency is present in the new gems as well.
> > Could this possibly be relaxed on one end using '>='?  That would make
> > cleanup easier, as it is not always easy to discern that it is ok to
> > use 'Y' on the continue question.
>
> Why does gherkin depend on Cucumber? As far as I can see, it only needs Cucumber for its tests, so that shouldn't be a production dependency.
>

cucumber has a runtime dependency on gherkin. gherkin has a development dependency on cucumber (for running gherkin's cucumber features).


I'm not sure I understand what the problem is. Are you worried about when to answer 'Y' when you uninstall a gem?

Aslak

moritz

unread,
Sep 27, 2010, 5:29:25 PM9/27/10
to Cukes
First, if you cleanup a bunch of gems, it is not immediately obvious
why the cucumber/gherkin combination would not uninstall, and yes, it
requires more attention and more careful analysis, if you have to
answer 'Y'. Normally, I would always opt for 'n'.

For example, gherkin 2.2 came out first and even though it was locally
installed, I couldn't uninstall gherkin 2.1.5, because cucumber 0.8
depended on it (~> 2.1.4). That was as expected and correct.

But even after cucumber 0.9 being available, which is now depending on
gherkin 2.2, again via ~>, the circular dependency, using ~> in both
directions keeps the old pair from being easily removed.

I think that relaxing maybe the development dependency from ~> to >=
would fix the issue, but you would have to decide if that is
semantically possible or would break something.
> https://rubygems.org/gems/gherkinhttps://rubygems.org/gems/cucumber
>
> I'm not sure I understand what the problem is. Are you worried about when to
> answer 'Y' when you uninstall a gem?
>
> Aslak
>
>
>
>
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups "Cukes" group.
> > > > To post to this group, send email to cu...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > cukes+un...@googlegroups.com <cukes%2Bunsu...@googlegroups.com>.
> > > > For more options, visit this group athttp://
> > groups.google.com/group/cukes?hl=en.
>
> > > cheers,
> > > Matt
>
> > >http://blog.mattwynne.net
> > > +44(0)7974 430184
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Cukes" group.
> > To post to this group, send email to cu...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cukes+un...@googlegroups.com <cukes%2Bunsu...@googlegroups.com>.

aslak hellesoy

unread,
Sep 27, 2010, 6:01:41 PM9/27/10
to cu...@googlegroups.com
On Mon, Sep 27, 2010 at 11:29 PM, moritz <a5s...@yahoo.com> wrote:
First, if you cleanup a bunch of gems, it is not immediately obvious
why the cucumber/gherkin combination would not uninstall,

What exactly do you mean by "would not uninstall"? Are you getting error messages? What rubygems version are you using?
 
and yes, it
requires more attention and more careful analysis, if you have to
answer 'Y'.  Normally, I would always opt for 'n'.

For example, gherkin 2.2 came out first and even though it was locally
installed, I couldn't uninstall gherkin 2.1.5, because cucumber 0.8
depended on it (~> 2.1.4).  That was as expected and correct.

But even after cucumber 0.9 being available, which is now depending on
gherkin 2.2, again via ~>, the circular dependency, using ~> in both
directions keeps the old pair from being easily removed.


I just installed cucumber (after first having uninstalled both gherkin and cucumber)

gem install cucumber

Now let's uninstall them:

gem uninstall cucumber gherkin

(Answer Y to a couple of questions).

The worst that can happen here is that some other gem you have (that depends on cucumber or gherkin) will stop working until you install cucumber or gherkin again. What's the problem with that?
 
I think that relaxing maybe the development dependency from ~> to >=
would fix the issue, but you would have to decide if that is
semantically possible or would break something.


We used >= before, but that makes it harder to do minor releases without people accidentally getting them when they shouldn't. The ~> scheme works great because then people only get patch upgrades.
 
To unsubscribe from this group, send email to cukes+un...@googlegroups.com.

moritz

unread,
Sep 27, 2010, 6:40:33 PM9/27/10
to Cukes
As with everything, there are tradeoffs. I will answer 'Y' when the
next major cucumber/gherkin release comes along.
> > cukes%2Bunsu...@googlegroups.com<cukes%252Buns...@googlegroups.com >
> > >.
> > > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/cukes?hl=en.
>
> > > > > cheers,
> > > > > Matt
>
> > > > >http://blog.mattwynne.net
> > > > > +44(0)7974 430184
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Cukes" group.
> > > > To post to this group, send email to cu...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > cukes+un...@googlegroups.com<cukes%2Bunsu...@googlegroups.com><
> > cukes%2Bunsu...@googlegroups.com<cukes%252Buns...@googlegroups.com >
Reply all
Reply to author
Forward
0 new messages