Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 565799

Summary: Upgrade Tycho to 1.7.0 will longer build plugin based product with native launcher
Product: z_Archived Reporter: J Clausius <jeffc>
Component: TychoAssignee: Christoph Laeubrich <laeubi>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, christian.dietrich.opensource, laeubi, mistria
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
tycho-1.7.0 build error for RCP plugin based .product file none

Description J Clausius CLA 2020-08-03 17:50:52 EDT
Created attachment 283791 [details]
tycho-1.7.0 build error for RCP plugin based .product file

Bug Details: 

Original setup which was working:
Tycho's version in a pom.xml set to Tycho 1.2.0
Eclipse P2 Repository was Eclipse 2018-09 for RCP
<app>.product file is plugins based product and set to use Native Launchers ( usesFeatures="false" and includeLaunchers="true" )

Builds take place on an Ubuntu 12.04 machine and work successfully for Mac, Linux and Windows version and produce correct output

--

A new Ubuntu 20.04 based system
Installed Maven 3.6.3
Updated the main build for pom.xml to Tycho 1.7.0
Updated the main build for pom.xml for Eclipse P2 repository 2020-03 (4.15)
<app>.product was modified to account for new entries in <plugins> and <configurations>

Builds now FAIL with the following error message:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-p2-publisher-plugin:1.7.0:publish-products (default-publish-products) on project <app>.product: Unable to locate feature 'org.eclipse.equinox.executable'. This feature is required for native product launchers

--

Thinking something had changed, a build was also tried on a Mac OS X (10.14.5) with the same setup.  Attached is an excerpt of the failure with the "-e" flag. (with windows LF in case it is desired)
--

Seems there were some issues in the past that may have been resolved since builds were working with Tycho 1.2.0, but maybe now have regressed back into 1.7.0 regarding plugin based .product files.
Comment 1 J Clausius CLA 2020-08-03 18:09:01 EDT
Note, none of the "launcher" type plugins are listed in the <app>.product file - which is handy since it does not necessarily require three different <app>.product files for each platform.  Again, this applies to both the successful builds with Tycho 1.2.0 and failed builds using Tycho 1.7.0.
Comment 2 J Clausius CLA 2020-08-04 10:44:53 EDT
Some additional info... I don't know how to classify this bug.

When Maven is run with pom.xml using Tycho 1.7.0 and P2 repository for Eclipse 2018-09 (Eclipse 4.9) will build the RCP app successfully.

However, when running Tycho 1.7.0 and P2 repository for Eclipse 2018-12 (Eclipse 4.10) with updated plugins / configurations the RCP build will fail in same way as with Eclipse 4.15.

So, did the launcher locations / processes change in Eclipse 4.10 that is incompatible with what Tycho is looking for?
Comment 3 Alexander Kurtakov CLA 2020-08-04 10:47:07 EDT
Can you share some reproducer? One guess I can think of is your configuration tries to build x86 products but newer Eclipse versions are x86_64 only.
Comment 4 Alexander Kurtakov CLA 2020-08-04 10:48:42 EDT
See bug 536766 for the removal of x86.
Comment 5 J Clausius CLA 2020-08-04 11:19:14 EDT
Not sure the x86 issue is relevant.   Is there a way to tell that I'm not seeing?


The <app>.product file which I tested on an actual Mac doesn't try to build either Linux or Windows.  In the plugins section, the only entries platform related is:


<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
...
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
...
<plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
...
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
...
<plugin id="org.eclipse.ui.cocoa" fragment="true"/>
...

---------------
Comment 6 J Clausius CLA 2020-08-04 11:19:32 EDT
(In reply to Alexander Kurtakov from comment #4)
> See bug 536766 for the removal of x86.


Not sure the x86 issue is relevant.   Is there a way to tell that I'm not seeing?


The <app>.product file which I tested on an actual Mac doesn't try to build either Linux or Windows.  In the plugins section, the only entries platform related is:


<plugin id="org.eclipse.core.filesystem.macosx" fragment="true"/>
...
<plugin id="org.eclipse.e4.ui.workbench.renderers.swt.cocoa" fragment="true"/>
...
<plugin id="org.eclipse.equinox.security.macosx" fragment="true"/>
...
<plugin id="org.eclipse.swt.cocoa.macosx.x86_64" fragment="true"/>
...
<plugin id="org.eclipse.ui.cocoa" fragment="true"/>
Comment 7 J Clausius CLA 2020-08-04 11:27:42 EDT
(In reply to Alexander Kurtakov from comment #3)
> Can you share some reproducer? One guess I can think of is your
> configuration tries to build x86 products but newer Eclipse versions are
> x86_64 only.

What do you need as a reproducer?  

Also, I have some more additional info I'm adding as a new comment, perhaps that may lead to what's changed or what I need to do as a work-around.
Comment 8 J Clausius CLA 2020-08-04 11:32:37 EDT
New, New information...

If I let Eclipse (even 4.9) change the "<configurations>" section, I can reproduce the problem in builds.

The working "configurations" section had the following:

<configurations>
  <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
  <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.ds" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>

-------------

If I re-do the .product file with an updated version of Eclipse, the Eclipse IDE changes this to:

<configurations>
  <plugin id="org.apache.felix.scr" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.core.runtime" autoStart="true" startLevel="0" />
  <plugin id="org.eclipse.equinox.common" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.event" autoStart="true" startLevel="2" />
  <plugin id="org.eclipse.equinox.simpleconfigurator" autoStart="true" startLevel="1" />
</configurations>


Some updated articles have suggested that org.eclipse.equinox.ds has been deprecated and instead should use org.apache.felix.scr.


Does that change have anything to do with being able to locate launchers?
Comment 9 Mickael Istria CLA 2020-08-04 11:43:30 EDT
If you think it's a bug in Tycho between 1.2.0 and 1.7.0, then please try various versions of Tycho to identify which one exactly introduced the regression.
Also, please try smaller increments: I see you change Tycho version and Eclipse target version at the same time. Can you please try those separately to identify which one of those 2 changes cause the issue.

Then, please share the very minimal project to reproduce the issue. I imagine that the module containing the .product file, stripped from all your specific content and listing the 2020-03 file as TP could be enough.
Comment 10 J Clausius CLA 2020-08-04 11:58:51 EDT
(In reply to J Clausius from comment #8)
> New, New information...
> 
> If I let Eclipse (even 4.9) change the "<configurations>" section, I can
> reproduce the problem in builds.
<SNIP>
> 
> 
> Does that change have anything to do with being able to locate launchers?

To recap:

1) The "old" <configurations> WORKS when building against Eclipse 4.9 P2 repository.  
2) The "new" <configurations> DOES NOT work when building against against Eclipse 4.9 P2 repository.  

3) The "old" <configurations> DOES NOT work when building against against Eclipse 4.10 P2 repository.
4) The "new" <configurations> DOES NOT work when building against against Eclipse 4.10 P2 repository.

----

Hopeful this information can lead to suggestions on how to proceed or if this is even actually a bug, since that data in the <app>.product file has indeed changed.
Comment 11 J Clausius CLA 2020-08-04 12:01:57 EDT
(In reply to Mickael Istria from comment #9)
> If you think it's a bug in Tycho between 1.2.0 and 1.7.0, then please try
> various versions of Tycho to identify which one exactly introduced the
> regression.
> Also, please try smaller increments: I see you change Tycho version and
> Eclipse target version at the same time. Can you please try those separately
> to identify which one of those 2 changes cause the issue.
> 
> Then, please share the very minimal project to reproduce the issue. I
> imagine that the module containing the .product file, stripped from all your
> specific content and listing the 2020-03 file as TP could be enough.

I did some more testing... There was a change between Eclipse RCP 4.9 and Eclipse 4.10 that causes the build failure in Tycho.

Also note, there was a change in what the IDE recommended for "configurations" in generating content in the <app>.product file. But the "old" configurations using org.eclipse.equinox.ds doesn't work in 4.10 either.

Hopefully there's enough data to look at this or tell me what I should do for my next steps.
Comment 12 J Clausius CLA 2020-08-04 12:04:34 EDT
(In reply to Mickael Istria from comment #9)
> If you think it's a bug in Tycho between 1.2.0 and 1.7.0, then please try
> various versions of Tycho to identify which one exactly introduced the
> regression.
> Also, please try smaller increments: I see you change Tycho version and
> Eclipse target version at the same time. Can you please try those separately
> to identify which one of those 2 changes cause the issue.
> 
> Then, please share the very minimal project to reproduce the issue. I
> imagine that the module containing the .product file, stripped from all your
> specific content and listing the 2020-03 file as TP could be enough.

The details are in comment #8 and comment #10
Comment 14 J Clausius CLA 2020-08-04 12:16:12 EDT
Note, in order to keep things stable, all the tests in comment #8 and info in comment #10 were done with Tycho 1.7.0.  That was constant throughout those tests.
Comment 15 J Clausius CLA 2020-08-04 12:16:42 EDT
(In reply to Mickael Istria from comment #13)
> Did you see
> https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.
> isv%2Fporting%2Feclipse_4_10_porting_guide.html ?

No, but I'll pour over them now.  TY!
Comment 16 J Clausius CLA 2020-08-04 12:27:18 EDT
(In reply to Mickael Istria from comment #13)
> Did you see
> https://help.eclipse.org/2020-06/index.jsp?topic=%2Forg.eclipse.platform.doc.
> isv%2Fporting%2Feclipse_4_10_porting_guide.html ?

The highlights don't look like they address the problems found here.

It might have to to do with a change in launcher locations and how app.product's <configurations> section is re-configuring start levels, and where launchers for those start levels are located when Tycho goes to put things together.
Comment 17 J Clausius CLA 2020-08-05 09:30:55 EDT
(In reply to Mickael Istria from comment #9)
> If you think it's a bug in Tycho between 1.2.0 and 1.7.0, then please try
> various versions of Tycho to identify which one exactly introduced the
> regression.
> Also, please try smaller increments: I see you change Tycho version and
> Eclipse target version at the same time. Can you please try those separately
> to identify which one of those 2 changes cause the issue.
> 
> Then, please share the very minimal project to reproduce the issue. I
> imagine that the module containing the .product file, stripped from all your
> specific content and listing the 2020-03 file as TP could be enough.

I think the Tycho issue started with this change - https://bugs.eclipse.org/bugs/show_bug.cgi?id=538737

So, the question is, has Tycho been modified to account for these changes and can find launchers in new plugin locations when org.eclipse.equinox.ds has been replaced with org.apache.felix.scr ?
Comment 18 Mickael Istria CLA 2020-08-05 09:39:29 EDT
(In reply to J Clausius from comment #17)
> So, the question is, has Tycho been modified to account for these changes
> and can find launchers in new plugin locations when org.eclipse.equinox.ds
> has been replaced with org.apache.felix.scr ?

I checked the code base, and the case of `useFeatures="false"` is not covered by any test as far as I could see. So it's very probable that there is some bug and that strictly nothing was changed on that matter; while some change is necessary.
I suggest you start looking at Tycho codebase and how it generates launchers, and `mvnDebug ...` to see it running, so you'll probably be able to contribute a patch that fixes that. I also suggest that before working on a fix, you work on some test case (in tycho-its for instance) to reproduce that issue, so at least there will be some coverage now.
Comment 19 Christoph Laeubrich CLA 2020-08-05 10:39:45 EDT
I'm generating plugin based products with tycho 2.0 without a problem. according to your tests there is a working product configuration for this, so why not use it?
Comment 20 J Clausius CLA 2020-08-05 10:45:54 EDT
(In reply to Christoph Laeubrich from comment #19)
> I'm generating plugin based products with tycho 2.0 without a problem.
> according to your tests there is a working product configuration for this,
> so why not use it?

Ues Tycho 2.0?  Is it out yet?  I thought 1.7.0 was the latest?
Comment 21 Christoph Laeubrich CLA 2020-08-05 10:50:09 EDT
I'll do some testing / investigation on this. I think we can try to use the "RCP 4 Demo Application" generated by the wizard that produces a plugin based product.
Anyways, there might be a problem because the launcher feature is later installed via P2, in fact AFAIK it could also be copied to the right locations instead.
Comment 22 J Clausius CLA 2020-08-05 10:53:18 EDT
(In reply to Christoph Laeubrich from comment #21)
> I'll do some testing / investigation on this. I think we can try to use the
> "RCP 4 Demo Application" generated by the wizard that produces a plugin
> based product.
> Anyways, there might be a problem because the launcher feature is later
> installed via P2, in fact AFAIK it could also be copied to the right
> locations instead.

If you hold tight, I am in the process of doing that very thing.  I was going to post it to https://bugs.eclipse.org/bugs/show_bug.cgi?id=538737, so I can also post a link here as well.
Comment 23 Christoph Laeubrich CLA 2020-08-05 11:36:35 EDT
I created an example as noted before here [1], this builds with 1.7.0 as well as 2.0.0-SNAPSHOT a bundle based product[2] (E4 Example product)
and native launcher artifact without any errors for windows, linux and macos.

@Mickael Istria: can you transform this into an IT for tycho?

[1] https://github.com/laeubi/tycho-bugs/tree/bundle-product
[2] https://raw.githubusercontent.com/laeubi/tycho-bugs/bundle-product/bundle-product/releng/product/test.e4.application.product
Comment 24 Mickael Istria CLA 2020-08-05 11:59:27 EDT
(In reply to Christoph Laeubrich from comment #23)
> @Mickael Istria: can you transform this into an IT for tycho?

Sorry, I'm not available to work on this issue at the moment. I suggest you try to mimic other tests that involve products, and ping me on Gerrit if you face some issues.
Comment 25 J Clausius CLA 2020-08-05 18:08:32 EDT
(In reply to Christoph Laeubrich from comment #21)
> I'll do some testing / investigation on this. I think we can try to use the
> "RCP 4 Demo Application" generated by the wizard that produces a plugin
> based product.
> Anyways, there might be a problem because the launcher feature is later
> installed via P2, in fact AFAIK it could also be copied to the right
> locations instead.

OK... I have a demo project and it is actually working.  Sorry it took so long, but it took the longest time to try to figure out issues to get past a few errors Eclipse 2020-06 Editor introduced in the .product file:

a)  [INFO] --- tycho-p2-publisher-plugin:1.7.0:publish-products (default-publish-products) @ com.sourcegear.tycho.build.product ---
[ERROR] Cannot resolve dependencies of product com.sourcegear.tycho.product:
[ERROR]   eclipse-plugin artifact with ID "javax.xml" and version matching "0.0.0" was not found in the target platform

-- 
This is resolved by manually removing "javax.xml" that the Eclipse 2020-06 keeps placing in the .product file when clicking the "Add Required Plug-ins" button within the Product Editor


b) After using "Add Recommended..." in the Start Levels section, the following error is generated:

[INFO] Installing product com.sourcegear.tycho.product for environment linux/gtk/x86_64 to /home/user/eclipse-workspace-tycho-example/com.sourcegear.tycho.build.product/target/products/com.sourcegear.tycho.product/linux/gtk/x86_64
Installing com.sourcegear.tycho.product 1.0.0.202008052145.
Installation failed.
Cannot complete the install because one or more required items could not be found.
	Software being installed: SourceGear Tycho Sample 1.0.0.202008052145 (com.sourcegear.tycho.product 1.0.0.202008052145)
	Missing requirement: toolinggtk.linux.x86_64org.eclipse.equinox.simpleconfigurator 1.0.0.202008052145 requires 'osgi.bundle; org.eclipse.equinox.simpleconfigurator 1.3.500.v20200211-1505' but it could not be found
	Cannot satisfy dependency:
		From: SourceGear Tycho Sample 1.0.0.202008052145 (com.sourcegear.tycho.product 1.0.0.202008052145)
		To: org.eclipse.equinox.p2.iu; toolingcom.sourcegear.tycho.product.configuration [1.0.0.202008052145,1.0.0.202008052145]
	Cannot satisfy dependency:
		From: toolingcom.sourcegear.tycho.product.configuration 1.0.0.202008052145
		To: org.eclipse.equinox.p2.iu; toolinggtk.linux.x86_64org.eclipse.equinox.simpleconfigurator [1.0.0.202008052145,1.0.0.202008052145]

-- 

This was resolved by manually adding "org.eclipse.equinox.simpleconfigurator"  to the Plug-ins and Fragments section of the .product file.

-- 

With those two manual changes (going against what the IDE generates), "mvn clean install" DOES work, and I am able to generate working binary executables for launchers.  I can provide the sample files / project if needed.



In regards to the overall bug, I noticed in the normal RCP demo, the dependencies within plugin.xml have changed.  I'm going to diff that against my original plugin.xml, make changes and see if that is the root cause of the original problem.
Comment 26 Christian Dietrich CLA 2020-08-06 00:54:39 EDT
can you please provide the sample project that is reproducing the error?
Comment 27 Christoph Laeubrich CLA 2020-08-06 00:58:59 EDT
I don't think there is any error in tycho.

Eclipse PDE simply ignores missing dependencies in a product if the for example do not match the desired platform, tycho does not.

Also the generated sample product is not always optimal nor minimal, and as I have shown (and J Clausius has also proven) it is possible to build a plugin based product with proper product configuration.
Comment 28 Mickael Istria CLA 2020-08-06 01:03:29 EDT
I'm marking it as Invalid as there seems to be nothing to change in Tycho and bug description matches an invalid issue that apparently cannot be reproduced with a correct .product file.
You can keep using this big for discussion though.
Comment 29 J Clausius CLA 2020-08-07 14:29:34 EDT
Just a follow up.  I think the problem had to do with the "Add Required Plug-ins" button adds to the list of <plugin> items and the Start Levels for "Add Recommended..." of the .product files in the Product Configuration Editor.

I had removed ALL of the plugins on the "Cotents" tab, Added the single 'top' level plugin of my app, and then click "Add Required Plug-ins".  I did the same sort of thing in the "Configuration" tab, removed ALL of the Start Levels items, and clicked "Add Recommended..."

The org.eclipse.equinox.simpleconfigurator was never added, and was causing some of the problems when running Maven from the command line.  I compared my original app's generated list compared against a Sample RCP App I let Eclipse create and was able to determine the missing pieces.

I don't know if that is a bug in the Product Configuration Editor or perhaps something else was missing in required bundles in my own MANIFEST.MF file, but am listing the details here in case it helps anyone else out.