Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Why are optional dependencies in Xtext greedy?
Why are optional dependencies in Xtext greedy? [message #1221733] Wed, 18 December 2013 10:12 Go to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Hi,

I am trying to build a product based on Xtext, without JDT ui. I am using Tycho for the build, and I have configured my target platform to ignore optional dependencies. However, p2 still installs the jdt.ui bundle in the final product.

After some time investigating this, I saw that Xtext uses optional, greedy dependencies, but the default since Juno M1 is that optional dependencies are non-greedy. This is what causes jdt.ui to be included even if it is marked optional.

I have solved this by filtering out jdt.ui, but still I was wondering:
Why are you using optional greedy dependencies?

Thank you,
Matthieu
Re: Why are optional dependencies in Xtext greedy? [message #1222367 is a reply to message #1221733] Fri, 20 December 2013 08:54 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
It is for backwards compatibility. Especially with regards to the
experience after updating. If we had followed the new convention and
have optional deps non greedy, a lot of people would have had to add
explicit dependencies.

Sven

Am 18/12/13 11:12, schrieb Matthieu Wipliez:
> Hi,
>
> I am trying to build a product based on Xtext, without JDT ui. I am
> using Tycho for the build, and I have configured my target platform to
> ignore optional dependencies. However, p2 still installs the jdt.ui
> bundle in the final product.
>
> After some time investigating this, I saw that Xtext uses optional,
> greedy dependencies, but the default since Juno M1 is that optional
> dependencies are non-greedy. This is what causes jdt.ui to be included
> even if it is marked optional.
>
> I have solved this by filtering out jdt.ui, but still I was wondering:
> Why are you using optional greedy dependencies?
>
> Thank you,
> Matthieu


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Why are optional dependencies in Xtext greedy? [message #1454543 is a reply to message #1222367] Tue, 28 October 2014 14:14 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Sven Efftinge wrote on Fri, 20 December 2013 03:54
It is for backwards compatibility. Especially with regards to the
experience after updating. If we had followed the new convention and
have optional deps non greedy, a lot of people would have had to add
explicit dependencies.

Sven

Hi Sven,

I understand. Nevertheless, that was last year ^^
Now is there any chance to make Xtext follow the new convention? Developers of Xtext-based products could then decide whether to bundle JDT with their product, it is simply a matter of including the JDT feature or not. I'd say this is a rather minor modification Smile

Cheers,
Matthieu
Re: Why are optional dependencies in Xtext greedy? [message #1454547 is a reply to message #1222367] Tue, 28 October 2014 14:16 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Sven Efftinge wrote on Fri, 20 December 2013 03:54
It is for backwards compatibility. Especially with regards to the
experience after updating. If we had followed the new convention and
have optional deps non greedy, a lot of people would have had to add
explicit dependencies.

Sven

Hi Sven,

I understand. Nevertheless, that was last year ^^
Now is there any chance to make Xtext follow the new convention? Developers of Xtext-based products could then decide whether to bundle JDT with their product, it is simply a matter of including the JDT feature or not. I'd say this is a rather minor modification Smile

Cheers,
Matthieu
Re: Why are optional dependencies in Xtext greedy? [message #1454611 is a reply to message #1454547] Tue, 28 October 2014 15:25 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Hi Matthieu,

I think even if "that was last year",
Svens point is still valid for the sake of existing code in the world.
Still for APIs and functionality there is a commitment to support compatibility issues.

Just had the fun to make some 800 "minor modifications" caused by a broken compatibility promise
Re: Why are optional dependencies in Xtext greedy? [message #1454644 is a reply to message #1454611] Tue, 28 October 2014 16:07 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Uli Merkel wrote on Tue, 28 October 2014 11:25
Still for APIs and functionality there is a commitment to support compatibility issues.


Uli, I feel like I'm missing something here. What compatibility are you referring to, and how making optional dependencies non-greedy would impact compatibility?
By default, product builds pull all optional dependencies unless specified otherwise. This won't change, greedy or not. What changes is that if you don't want optional dependencies (for example I don't want JDT in my product), that is if you specify *explicitly* something, then it will behave as expected (not including something that is marked as optional).

Users of plugins supporting Xtext-based DSLs either already have JDT (since it is installed when you install Xtext), or they don't if they're using a product that explicitly filters out JDT (like I did in my product). If they already have JDT, changing from greedy to non-greedy won't make a difference for them.

So, the only thing that would change, as far as I can see, is for developers who make Xtext-based plugins that rely on JDT, but who are not aware of it, and who don't use Xbase (if they use Xbase, they are well aware that JDT is required). So for those, for compatibility, maybe the generator could add requirements to jdt.core/jdt.ui? Or maybe there is even another way, maybe something simpler than specify x-installation:="greedy" on every optional dependency Wink

Uli Merkel wrote on Tue, 28 October 2014 11:25
Just had the fun to make some 800 "minor modifications" caused by a broken compatibility promise


I know that this is painful. Xtext is an *awesome* framework, and I've been using it for a few years already, even at versions pre-1.0, when things used to break at almost every release ^^
Re: Why are optional dependencies in Xtext greedy? [message #1455254 is a reply to message #1454644] Wed, 29 October 2014 07:06 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
Think there is some misunderstanding:

the "800 minor changes" were caused by a "commercial" product, but not XTEXT.
Re: Why are optional dependencies in Xtext greedy? [message #1455308 is a reply to message #1455254] Wed, 29 October 2014 08:21 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
It was not a misunderstanding, I know that the broken compatibility was in a third-party product. I was being a bit sarcastic, I'm sorry. Since version 2.0 Xtext has been scrupulously backward compatible,

Which is why I made a proposition to keep that backward compatibility. Another proposition (along the same idea) would be to add a property to the MWE2 workflow like "isJdtRequired", implicitly true (when not specified), can be overridden and set to false to remove dependency on JDT. It could even change the default bindings for IAllContainersState, IResourceSetProvider, and IResourceForEditorInputFactory.
Re: Why are optional dependencies in Xtext greedy? [message #1478218 is a reply to message #1455308] Tue, 18 November 2014 13:50 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Matthieu Wipliez wrote on Wed, 29 October 2014 04:21
Which is why I made a proposition to keep that backward compatibility.

Another way would be to explicitly make the Xtext SDK feature depend on JDT. Or a feature "Xtext with JDT integration" (this is what the p2 guys seem to recommend on this page).

Developers using the Xtext feature wouldn't have to worry about the JDT, and others (like me) using only certain plugins wouldn't have to worry about the JDT being silently installed.

I'm probably not alone in having a DSL that does not require JDT (at least I hope ^^), and I'm trying to propose alternative solutions that maintain backward compatibility. So what do you say? Will you consider the changes I propose, please?
Re: Why are optional dependencies in Xtext greedy? [message #1691824 is a reply to message #1478218] Thu, 09 April 2015 23:40 Go to previous messageGo to next message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
I am facing the same issue with an RCP product that is totally unrelated to JDT. So should there be a formal bug opened for this ?

Not sure I want to add jdt and jdt.dbug, etc for the sake of having Xtext.

Thanks
Alain
Re: Why are optional dependencies in Xtext greedy? [message #1691825 is a reply to message #1691824] Fri, 10 April 2015 00:01 Go to previous messageGo to next message
Matthieu Wipliez is currently offline Matthieu WipliezFriend
Messages: 30
Registered: March 2010
Member
Alain Picard wrote on Thu, 09 April 2015 19:40
should there be a formal bug opened for this ?

Yes I think it is time, since I'm no longer alone in having reported this problem Smile

see here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=464344
Re: Why are optional dependencies in Xtext greedy? [message #1691826 is a reply to message #1691825] Fri, 10 April 2015 00:20 Go to previous message
Alain Picard is currently offline Alain PicardFriend
Messages: 266
Registered: July 2009
Senior Member
I upvoted your bug entry, as JDT even requires o.e.debug.ui, it's like throwing the kitchen sink in your app.

Previous Topic:test of DSL does not run with maven
Next Topic:How to remove Xtext nature of only few files in the project
Goto Forum:
  


Current Time: Thu Apr 25 13:42:51 GMT 2024

Powered by FUDForum. Page generated in 0.03895 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top