Bug 429355 - Allow auto "source features" a method to specify "requires" other source features.
Summary: Allow auto "source features" a method to specify "requires" other source feat...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-28 14:06 EST by David Williams CLA
Modified: 2021-04-28 16:51 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2014-02-28 14:06:40 EST
For complete background on use-case, see bug 419647, bug 429348, and bug 429353. 

We in the platform have cases where we want to "require" the code features for EMF and ECF. On the one hand, we definitely want to include a version of code, with its matching source, in particular distributions, but at the same allow users or adapters to later include some other version of EMF or ECF (code and source). 

We can include "requires" in the feature than generate code only, but the "automatic source feature" that Tycho generates does not include (or require) the "source features" for the "code features" we require -- rightly so, as default behavior. 

But, we would like the ability to have a section in source feature, that said something like 

   <requires>
      <import feature="org.eclipse.emf.common.source" version="2.7.0" match="compatible"/>
      <import feature="org.eclipse.emf.ecore.source" version="2.7.0" match="compatible"/>
   </requires>

since the code feature says something like 

   <requires>
      <import feature="org.eclipse.emf.common" version="2.7.0" match="compatible"/>
      <import feature="org.eclipse.emf.ecore" version="2.7.0" match="compatible"/>
   </requires>
Comment 1 David Williams CLA 2014-02-28 14:18:17 EST
I should mention, that at first blush, and easy implementation would simply "copy" all "requires" elements to the source feature, adding ".source" to the end of the features ... but, as you probably know, not ALL projects follow that same convention. Such as see ECF example in bug 429353. 

So, I'm thinking it could become part of the feature.properties (which already allows overrides for some fields) ... or perhaps a separate "file to be included" in source feature, or just directly as part of the configuration of 
tycho-source-feature-plugin. 

tycho-source-feature-plugin already allows "plugins" to be "included" or "excluded" so this could be as simple as as a new "list" under configuration, say 

 <configuration>
   <requires>
      <import feature="org.eclipse.ecf.core.source.feature" version="1.1.0" match="compatible"/>
      ....
   </requires>
Comment 2 Tobias Oberlies CLA 2014-03-03 05:17:07 EST
Let me try to summarize this (to check if I got it right):
You want to have your source features require other source features, so that someone who has the sources of your bundles also gets the sources of the dependencies of your bundles.

So you want to extend the current behaviour ("includes all features included by <originalFeature>, but each with .source appended to each feature id" [1]) also to referenced features in <originalFeature>, right?

[1] https://www.eclipse.org/tycho/sitedocs-extras/tycho-source-feature-plugin/source-feature-mojo.html
Comment 3 David Williams CLA 2014-03-03 08:38:17 EST
(In reply to Tobias Oberlies from comment #2)
> Let me try to summarize this (to check if I got it right):
> You want to have your source features require other source features, so that
> someone who has the sources of your bundles also gets the sources of the
> dependencies of your bundles.
> 
> So you want to extend the current behaviour ("includes all features included
> by <originalFeature>, but each with .source appended to each feature id"
> [1]) also to referenced features in <originalFeature>, right?
> 
> [1]
> https://www.eclipse.org/tycho/sitedocs-extras/tycho-source-feature-plugin/
> source-feature-mojo.html

Yes, I _think_ your summary is correct. 

I might add, the important characteristic to is "include" those referenced features, but with a "requires" statement, so that there is not "lock in" to some exact version, but allows others to package slightly different versions (of source, and code) -- which might be required "post release".
Comment 4 Tobias Oberlies CLA 2014-03-03 10:24:42 EST
(In reply to comment #3)
> I might add, the important characteristic to is "include" those referenced
> features, but with a "requires" statement, so that there is not "lock in" to
> some exact version, but allows others to package slightly different versions (of
> source, and code) -- which might be required "post release".
Sure, this absolutely makes sense: the source feature should mirror the dependencies of the binaries feature, i.e. use the same kind of dependency ("include", or "requires" with the respective version match).

I'm wondering if there is a particular reason to not also generate the "requires" dependencies into the source features.
@Jan: Is there a reason other than "this hasn't been implemented yet"?
Comment 5 Jan Sievers CLA 2014-03-03 10:40:53 EST
(In reply to Tobias Oberlies from comment #4)
> (In reply to comment #3)
> > I might add, the important characteristic to is "include" those referenced
> > features, but with a "requires" statement, so that there is not "lock in" to
> > some exact version, but allows others to package slightly different versions (of
> > source, and code) -- which might be required "post release".
> Sure, this absolutely makes sense: the source feature should mirror the
> dependencies of the binaries feature, i.e. use the same kind of dependency
> ("include", or "requires" with the respective version match).
> 
> I'm wondering if there is a particular reason to not also generate the
> "requires" dependencies into the source features.
> @Jan: Is there a reason other than "this hasn't been implemented yet"?

not that I know of. I agree the request to take over the required features with ".source" appended into the generated source feature makes sense.

Not sure if we should change the default behaviour though. Cryptic error messages may come up in case the required source feature is not available, see related bug 379801 .
Comment 6 Mickael Istria CLA 2021-04-08 18:03:34 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.