Bug 392408 - Include switch for treating optional dependencies greedy.
Summary: Include switch for treating optional dependencies greedy.
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-19 02:43 EDT by Timo Rohrberg CLA
Modified: 2021-04-28 16:55 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Rohrberg CLA 2012-10-19 02:43:31 EDT
Hello everybody,

based on the discussion on bug 351842 [1] and in the Tycho-User mailing list [2], I would like to request a switch to the "optionalDependencies" tag of the target-platform-configuration plugin to treat optional dependencies greedy, i.e. it should try to resolve all optional dependencies, and if they are not present in the target platform, omit them.

It would be really cool if you could include such a behavior in the next Tycho release...

Thank you very much.

Best Regards
Timo

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=351842#c16
[2] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg03471.html
Comment 1 Igor Fedorenko CLA 2012-10-19 06:44:51 EDT
I am not sure I like this idea. Currently Tycho build will either produce predetermined build results or fail because of missing dependencies. With optional greedy dependencies, however, Tycho build may produce different results depending on the contents of the remote repositories.
Comment 2 Timo Rohrberg CLA 2012-10-19 06:52:13 EDT
Generally, I agree with Igor that predetermined build results are better than indetermined ones. And treating optional dependencies in a greedy way indeed breaks with the idea of always delivering pretermined results. With the configuration I described in [1], my builds are working quite smoothly and reliably. However, when Tobias came up with the idea, I thought it would be nice to get rid of all the configuration overhead introduced by optional dependencies. And the latter are just necessary in my situation (RCP/RAP single-sourcing scenario), which is a classic "just-one-of-many-alternatives" scenario.

Are there any alternative ideas how to support such scenarios?
Comment 3 Tonny Madsen CLA 2012-10-30 11:00:16 EDT
If it helps, you could consider adding a list of the bundles that might be consumed greedily.

Or even more advanced (and more controled and stable), a set of alternative "solutions" that could be accepted. For the case from the mailing list [1] that would then be (org.eclipse.ui,org.eclipse.ui.view) || (org.eclipse.rap.ui,org.eclipse.rap.ui.view) where "||" is exclusive or... (the syntax should of cause be Maven like...)

[1] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg03471.html
Comment 4 Tobias Oberlies CLA 2012-11-09 09:35:13 EST
(In reply to comment #1)
> With optional greedy dependencies, however, Tycho build may produce different 
> results depending on the contents of the remote repositories.
The build is anyway not guaranteed to be the same if your target platform changes, e.g. because of a remote repository change. (And it isn't the same in practice.) Optional greedy dependencies don't make this any "worse" than it is today.
Comment 5 Mickael Istria CLA 2021-04-08 18:06:30 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.