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

Bug 366430

Summary: Building EPP packages with Tycho
Product: [Technology] EPP Reporter: Cedric Brun <cedric.brun>
Component: PackagerAssignee: Project Inbox <epp.packager-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_williams, gamma32, gunnar, Lars.Vogel, mike.milinkovich, mknauer, steffen.pingel, thanh.ha
Version: unspecified   
Target Milestone: 1.4.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 405828    
Attachments:
Description Flags
EPP modeling based on Tycho v0.1
none
tycho.patch
none
epp-tycho.patch none

Description Cedric Brun CLA 2011-12-12 11:32:04 EST
As discussed on the mailling list I was digging through the Eclipse Marketplace lately and found that most reported installation errors are coming from EPP packages with error messages like, for instance :

Cannot complete the install because one or more required items could not be found. Software currently installed: Shared profile 1.0.0.1323208539966 (SharedProfile_epp.package.java 1.0.0.1323208539966) Missing requirement: Shared profile 1.0.0.1323208539966 (SharedProfile_epp.package.java 1.0.0.1323208539966) requires 'org.maven.ide.eclipse [1.0.100.20110804-1717]' but it could not be found

As far as I know the current package building mechanism involves a feature  (for instance epp.modeling) including the other features. Problem arise when somebody want's to install a newer version of one of the included feature, p2 then would have to "un-install the whole epp feature" If I'm not mistaken.

On the other hand I had pretty good experiences lately with Tycho exporting 'Eclipse IDE like' product with .product files. In this case the .product holds all the feature references to include.
Comment 1 Cedric Brun CLA 2011-12-12 11:38:03 EST
Created attachment 208269 [details]
EPP modeling based on Tycho v0.1

Here is a first draft of how it can be made. 

It's building the Indigo EPP modeling package using Tycho (launch mvn clean package in org.eclipse.epp.package.modeling.build) 

Known issues so far : 
 No welcome page
 I did not filled the about dialog correctly
 I get an NPE from tycho when trying to build the linux 64 bit package. It need further investigation ...
Comment 2 Cedric Brun CLA 2011-12-13 08:28:51 EST
For references, Igor pushed the experiment here:

https://github.com/ifedorenko/org.eclipse.epp
Comment 3 Cedric Brun CLA 2012-02-27 12:25:29 EST
Welcome page and about : I was not including the modeling package feature, now fixed.

NPE : not reproduced with Tycho 0.14 but building the MacOS package

Product you can't update : to avoid this I had to remove all the feature I want from the product file and add them as advices in the p2.inf file. As usual, It makes sense once you figured it out.

I ends up with a working build for Indigo. The modeling package looks good.

Unfortunately moving it to Juno I ends up with :

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: org.eclipse.epp.package.modeling.product 4.2.0.qualifier
[ERROR]   Missing requirement: org.eclipse.epp.package.modeling.product 4.2.0.qualifier requires 'org.eclipse.equinox.executable.feature.group 0.0.0' but it could not be found
[ERROR]
Comment 4 David Williams CLA 2012-02-27 12:37:51 EST
(In reply to comment #3)
> 
> Product you can't update : to avoid this I had to remove all the feature I want
> from the product file and add them as advices in the p2.inf file. As usual, It
> makes sense once you figured it out.
> 

This could be done with current system, right? (Not specific to Tycho builds?) 

I think the general idea intersects with bug 345503 ... that is, there is certain amount of "policy" related to what can be updated and what can not. My guess is that most package maintainers would want the ability to "update sub features" ... but, would just encourage the broader discussion (if I'm reading this right). 

Thanks!
Comment 5 Thanh Ha CLA 2013-06-19 10:30:20 EDT
Created attachment 232542 [details]
tycho.patch

Attached patch builds all of the EPP packages using Tycho minus the parallel package which I had problems finding a dependency for which I'll explain below. It is based off of Igor's initial work from comment 2.

For the parallel package it couldn't find the dependency org.eclipse.linuxtools.changelog.c_0.0.0 and threw this error:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.18.0:package-feature (default-package-feature) on project org.eclipse.epp.package.parallel.feature: Execution default-package-feature of goal org.eclipse.tycho:tycho-packaging-plugin:0.18.0:package-feature failed: Could not resolve feature org.eclipse.linuxtools.changelog.c_0.0.0; Path to dependency: -> [Help 1]


I'm not sure where this comes from but in this patch I used the repo at http://download.eclipse.org/releases/kepler to resolve dependencies which I'm not sure if it's correct or not but it contained all the dependencies for the other bundles.

I'm also not sure if the product files are correct for the various packages since I reused Igor's initial work for the Java package.
Comment 6 Thanh Ha CLA 2013-07-31 11:45:11 EDT
I'd like to provide patches for signing via bug 405828 but before that can happen we need EPP producing CBI builds. Would it be possible to have these Tycho patches looked at so we can fix any outstanding issues and have it merged into EPP?
Comment 7 Markus Knauer CLA 2013-07-31 12:39:22 EDT
The main problem that I'm seeing right now is that we are basically duplicating the .product files because Tycho expects them to be in their own directory, whereas Buckminster uses a different structure. If we find a way to satisfy both, Tycho and Buckminster, without duplicating the .product files, I'd be happy to apply this patch.

(Personally, I'm not against changing the underlying build system, but this needs to be discussed, decided, and done first.)
Comment 8 Thanh Ha CLA 2013-07-31 13:35:43 EDT
(In reply to comment #7)
> The main problem that I'm seeing right now is that we are basically
> duplicating the .product files because Tycho expects them to be in their own
> directory, whereas Buckminster uses a different structure. If we find a way
> to satisfy both, Tycho and Buckminster, without duplicating the .product
> files, I'd be happy to apply this patch.
> 
> (Personally, I'm not against changing the underlying build system, but this
> needs to be discussed, decided, and done first.)

Fair enough. I have an idea on how to get around the duplicate product file issue but it does have some issues.

Use symlinks to point to the product files located in the feature. I tested a quick test build of the java product and it appears to work just fine. I will do a larger test and submit another patch if it works out.


Unfortunately the side effect of this is that on Windows systems that don't support symlinks these links of course will fail. I'm not sure how big an issue this would be, do people build EPP on Windows with Maven/Tycho?

Considering there is no Maven/Tycho build today for EPP maybe this isn't "major" and can be documented, and this wouldn't affect the existing build (as far as I know).
Comment 9 Thanh Ha CLA 2013-07-31 13:40:38 EDT
(In reply to comment #8)
> Unfortunately the side effect of this is that on Windows systems that don't
> support symlinks these links of course will fail. I'm not sure how big an
> issue this would be, do people build EPP on Windows with Maven/Tycho?
> 
> Considering there is no Maven/Tycho build today for EPP maybe this isn't
> "major" and can be documented, and this wouldn't affect the existing build
> (as far as I know).

In case anyone's interested here's an interesting stackoverflow I found on the topic of symlinks on Windows:

http://stackoverflow.com/questions/5917249/git-symlinks-in-windows
Comment 10 Markus Knauer CLA 2013-07-31 13:54:18 EDT
(In reply to comment #8)
> Use symlinks to point to the product files located in the feature. I tested
> a quick test build of the java product and it appears to work just fine. I
> will do a larger test and submit another patch if it works out.

Yeah, I thought about that, too, but I've no experience with symlinks and Git. Maybe it works just fine... then it would be a perfect solution for this (intermediate) issue.

> Unfortunately the side effect of this is that on Windows systems that don't
> support symlinks these links of course will fail. I'm not sure how big an
> issue this would be, do people build EPP on Windows with Maven/Tycho?
> 
> Considering there is no Maven/Tycho build today for EPP maybe this isn't
> "major" and can be documented, and this wouldn't affect the existing build
> (as far as I know).

I'm not aware of anyone using Windows to run the EPP build. At eclipse.org and on my own machine they are running on Linux anyway. And in the long run, I'd like to switch to Tycho, which means we do not have to support two systems in parallel forever.
Comment 11 Thanh Ha CLA 2013-08-01 13:53:36 EDT
Created attachment 234031 [details]
epp-tycho.patch

Updated patch to use symlinks instead of duplicating the products.
Comment 12 Markus Knauer CLA 2013-08-17 11:03:41 EDT
(In reply to comment #11)
> Created attachment 234031 [details]
> epp-tycho.patch

I pushed this patch to master now (and updated version numbers here and there, added .project files, etc.)

But I have to say that Eclipse and/or EGit isn't designed for symlinks... the idea is great and it's Eclipse that should improve here because it just doesn't work and causes trouble and problems. :(

Anyway, I'd like to move forward, and this means to accept these problems for a transition period.
Comment 13 Thanh Ha CLA 2013-08-19 14:26:11 EDT
(In reply to comment #12)
> (In reply to comment #11)
> > Created attachment 234031 [details]
> > epp-tycho.patch
> 
> I pushed this patch to master now (and updated version numbers here and
> there, added .project files, etc.)
> 
> But I have to say that Eclipse and/or EGit isn't designed for symlinks...
> the idea is great and it's Eclipse that should improve here because it just
> doesn't work and causes trouble and problems. :(
> 
> Anyway, I'd like to move forward, and this means to accept these problems
> for a transition period.

Thanks Markus, I am able to build EPP with the merged patch. Of course with the exception of the parallel package issue I mentioned in comment 5.
Comment 14 Hendrik Still CLA 2013-11-17 14:07:34 EST
I was able to run a maven build with small changes, but I'm not sure if the results are comparable to the standart builds. 

Changes I made:
1. I removed the parallel package from the build 
2. I'm on Maven 3.1.1, I changed the version to Tycho 0.19.0, because Tycho 0.18.0 does not work with Maven 3.1.1
3. I added the code recommenders repository, which is part of the Java Package

I did not test every package, but the Java Package seems to work like expected.
The CPP Package seems a little bit strange, for example it is not possible to create a new project. 

So, how far is the EPP Packaging with Tycho?
Comment 15 Markus Knauer CLA 2013-11-17 15:15:03 EST
(In reply to Hendrik Still from comment #14)
> 1. I removed the parallel package from the build 

The Parallel package defines some optional dependencies to artifacts that are not in the repositories; Tycho has it's own way of interpreting 'optional', but even if this behaviour is changed the feature doesn't resolve properly.

With my changes over the last few days the packages can be built, and a test-run of a temporary Hudson job is successful (with the exception of the Parallel package), including signed bundles and signed binaries, but there's a difference between 'build finishes successful' and the results. Still lot of work to do.



[1] https://hudson.eclipse.org/hudson/user/mknauer/my-views/view/EPP/job/luna.epp-tycho-build/
Comment 16 Markus Knauer CLA 2013-12-18 09:11:36 EST
The new packages for Luna M4 will be built using Tycho. The Hudson job is running on the EPP HIPP instance [1].

Documentation, Wiki, etc. still need to be updated, but with the main topic of the bug being addressed, I'm going to close this bug as fixed.


[1] https://hudson.eclipse.org/packaging/job/luna.epp-tycho-build/
Comment 17 Hendrik Still CLA 2013-12-18 09:48:17 EST
Thanks for the update.
Do the EPP packages support root level features, to allow independent updates of single features? 
Because there is currently a open tycho bug(bug 361772) for this problem.
Comment 18 Hendrik Still CLA 2013-12-18 09:49:35 EST
> Because there is currently a open tycho bug(bug 361772) for this problem.

Sorry this was the wrong bug.
I meant bug 361722
Comment 19 Markus Knauer CLA 2013-12-18 13:36:55 EST
No, we are currently using Tycho 0.19.