Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353399 - Feature require import show warn, not fail.
Summary: Feature require import show warn, not fail.
Status: CLOSED WONTFIX
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: 353889
Blocks:
  Show dependency tree
 
Reported: 2011-07-29 08:00 EDT by Niels Bech Nielsen CLA
Modified: 2021-04-28 16:54 EDT (History)
3 users (show)

See Also:


Attachments
Mimized pom building a feature (1.95 KB, text/xml)
2011-07-29 08:04 EDT, Niels Bech Nielsen CLA
no flags Details
Simple feature with non-existing requires feature (494 bytes, text/xml)
2011-07-29 08:05 EDT, Niels Bech Nielsen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niels Bech Nielsen CLA 2011-07-29 08:00:58 EDT
Build Identifier: tycho 0.12.0

Tycho P2 resolver tries to resolve feature.requires properties even though they are installation properties and only warnings in PDE

Reproducible: Always

Steps to Reproduce:
I specify a simple feature with a simple requires section:
   <requires>
      <import feature="com.example.nonexisting"/>
   </requires>
 
 
This generates a warning in PDE but allows me to build it none-the-less.
 
With tycho 0.12.0 passing a tycho.targetPlatform that doesn't contain the feature it compiles fine.
If I remove the tycho.targetPlatform and use the p2 resolver, it fails with a missing dependency.
Comment 1 Niels Bech Nielsen CLA 2011-07-29 08:04:50 EDT
Created attachment 200587 [details]
Mimized pom building a feature

Minimized configuration for building the feature.
Should be fairly basic. 
add -Dtycho.platform to avoid the problem.
Comment 2 Niels Bech Nielsen CLA 2011-07-29 08:05:31 EDT
Created attachment 200588 [details]
Simple feature with non-existing requires feature
Comment 3 Tobias Oberlies CLA 2011-08-02 09:38:30 EDT
This is somewhat intentional: Tycho resolves project dependencies in the same way as they will be resolved at install time. You won't be able to install the feature with the reference to "com.example.nonexisting", and Tycho already lets you know during the build.

It would not be absolutely necessary to really resolve feature *dependencies*, but I don't think we would gain much if we did: The feature *inclusions* have to be resolved, because Tycho has to fill in the exact versions of the included plugins.

Unless there is an important use case for the behaviour you are requesting, the behaviour of Tycho probably won't be changed. About the indications you are giving: 
- The PDE also just warns if inclusions are not present (which must be an error in Tycho; see above).
- The local resolver (which is entailed by "-Dtycho.targetPlatform") is deprecated and hence may have diverged from the recommended p2 resolver.
Comment 4 Tobias Oberlies CLA 2011-08-04 10:05:33 EDT
Having thought about this proposal (and the good discussion between Igor and Niels on the mailing list [1]), I now think that is is doable - if we should implement bug 353889.

I am undecided the warning (rather than an error) should be the default - but it should at least be an option.

[1] http://dev.eclipse.org/mhonarc/lists/tycho-user/msg00584.html
Comment 5 Burkhard Weber CLA 2013-11-05 07:41:48 EST
Does tycho 0.19.0 already provide such an option to change the default behavior from error to warning?
Comment 6 Tobias Oberlies CLA 2013-11-05 12:03:17 EST
(In reply to comment #5)
> Does tycho 0.19.0 already provide such an option to change the default behavior
> from error to warning?
The status of this issue is correct. It's not resolved, so this feature is not implemented.
Comment 7 Mickael Istria CLA 2020-06-29 08:44:05 EDT
Tycho tries to stick to a dependency resolution that's similar to what's going to happen at runtime. This allows the developers to anticipate more errors their users might face with dep management. It's not something we should change.