This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 304594 - [core] Make p2 buildable with tycho
Summary: [core] Make p2 buildable with tycho
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal with 6 votes (vote)
Target Milestone: Kepler   Edit
Assignee: Anthony Dahanne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 16:56 EST by Pascal Rapicault CLA
Modified: 2012-11-21 10:38 EST (History)
13 users (show)

See Also:


Attachments
fix additionnal pom versions , fix paths in the aggregator, fix ui.sdk manifest (13.44 KB, patch)
2011-08-11 23:14 EDT, Anthony Dahanne CLA
pascal: iplog+
Details | Diff
Updating org.eclipse.equinox.frameworkadmin.equinox version in the pom (978 bytes, patch)
2011-08-30 10:02 EDT, Anthony Dahanne CLA
no flags Details | Diff
Changing the packaging of ie.wombat.jbdiff.test from eclipse-plugin to eclipse-test-plugin (870 bytes, patch)
2011-08-30 10:13 EDT, Anthony Dahanne CLA
pascal: iplog+
Details | Diff
added indigo repos in parent, configured tycho surefire plugin (4.29 KB, patch)
2011-09-19 04:02 EDT, Anthony Dahanne CLA
pascal: iplog+
Details | Diff
upgraded tycho from 0.12.0 to 0.13.0 for p2 build (4.36 KB, patch)
2011-10-05 15:07 EDT, Anthony Dahanne CLA
no flags Details | Diff
make the tests bundle download an eclipse platform before executing the tests (6.17 KB, patch)
2011-10-05 18:07 EDT, Anthony Dahanne CLA
pascal: iplog+
Details | Diff
Syncing of pom.xml version numbers with MANIFEST.MF/similar. (1.87 KB, patch)
2011-11-06 13:56 EST, Ivar Refsdal CLA
pascal: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2010-03-03 16:56:12 EST
In order to help external contributions we should try to make p2 buildable with tycho
Comment 1 Jeff McAffer CLA 2010-03-04 08:23:02 EST
I'm not at all opposed to this but the description could be a little more informative. What about p2 is not buildable by Tycho?  What needs to change? How? How would this ease contributions?
Comment 2 Tobias Oberlies CLA 2011-08-01 16:09:06 EDT
I have updated the POMs so that I could at least build the publisher bundles with Tycho. In this way, I can do changes in p2 and immediately try them out in Tycho (cf. bug 341572). This is obviously a very special use case. 

In general I think the idea is that people can easily run the central build and tests locally, so that as a contributor I can verify my proposed paches by just calling @mvn clean verify@ in the rt.equinox.p2 repository root.

I haven't looked into building all of p2 with Tycho yet, but now that the p2 Sources are in Git, I probably will eventually - I want my local Hudson to run the p2 tests for me :-)
Comment 3 Anthony Dahanne CLA 2011-08-11 23:14:52 EDT
Created attachment 201366 [details]
fix additionnal pom versions , fix paths in the aggregator, fix ui.sdk manifest

Continuing the work of Tobias (http://git.eclipse.org/c/equinox/rt.equinox.p2.git/commit/?id=cdb395b87307f3df0b9a2415f2722801fc836a6f)  , this patch provides :
* fix pom versions so that they are all in sync with manifests versions
* replaces in ui.sdk the require-bundle on org.eclipse.compare with 2 import packages (actually it is because mysteriously tycho will not find the bundle org.eclipse.compare in indigo releases composite repo -- I manually checked it was in content.xml; oh well; import packages are more modular anyway)
* fix the paths in the aggregator; a bit like you already did Tobias (../../bundles for bundles and ../../features for features )

After this patch is committed, as  a p2 user I may :
git clone http://git.eclipse.org/gitroot/equinox/rt.equinox.p2.git
cd org.eclipse.equinox.p2-parent && mvn clean install
cd ../org.eclipse.equinox.p2-aggregator  && mvn clean install

(perfect for CI)

and it's a success

Next steps : changing the packaging of the test modules from eclipse-plugin to eclipse-test-plugin ; and configure the unit and integrations tests for tycho surefire -- Pascal, are the tests up to date, and do they run in the IDE (I could not launch org.eclipse.equinox.frameworkadmin.test test suite in my IDE - I got many errors :-/ )
Comment 4 Pascal Rapicault CLA 2011-08-12 05:02:03 EDT
I like to wake up and find contribs like that  :) Thx Anthony
Comment 5 Pascal Rapicault CLA 2011-08-12 05:02:24 EDT
Comment on attachment 201366 [details]
fix additionnal pom versions , fix paths in the aggregator, fix ui.sdk manifest

Patch applied.
Comment 6 Pascal Rapicault CLA 2011-08-12 19:26:39 EDT
Anthony, please ignore the fwkadmin tests for now. I'll investigate what is going on. I suspect it is just a setup issue.
Comment 7 Anthony Dahanne CLA 2011-08-30 10:02:14 EDT
Created attachment 202422 [details]
Updating org.eclipse.equinox.frameworkadmin.equinox version in the pom
Comment 8 Anthony Dahanne CLA 2011-08-30 10:13:11 EDT
Created attachment 202423 [details]
Changing the packaging of ie.wombat.jbdiff.test from eclipse-plugin to eclipse-test-plugin

Added 2 patches :
* 202422 : syncing the version of fwkadmin
* this patch : ie.wombat.jbdiff.test as eclipse-test-plugin; tycho surefire can run those tests just fine without any extra configuration

I have 2 questions : 

* the Java binary diff tool (ie.wombat.jbdiff) could be, if its code does not change anymore (? I did not check the history...) stored in a p2 repo instead of being part of the p2 master git repo.
* the bundle org.eclipse.core.tests.harness is required for many tests; in the IDE, it is imported from CVS, thanks to this PSF file : org.eclipse.equinox.p2.releng/projectSet.psf  : 
<project reference="1.0,:pserver:dev.eclipse.org:/cvsroot/eclipse,org.eclipse.core.tests.harness,org.eclipse.core.tests.harness"/>
Does anyone of you know if this bundle (along with other core.tests bundles) is exported to a p2 repo ? because AFAIK, Tycho does not understand PSF files...
Comment 9 Kim Moir CLA 2011-08-30 10:21:52 EDT
The org.eclipse.core.tests.harness bundle is included in our regular build repositories.  

http://wiki.eclipse.org/Eclipse_Project_Update_Sites
Comment 10 Anthony Dahanne CLA 2011-08-31 04:35:37 EDT
OK !
thanks Kim for the link ! http://download.eclipse.org/eclipse/updates/3.7 or http://download.eclipse.org/eclipse/updates/3.8milestones are what I was looking for !
Comment 11 Anthony Dahanne CLA 2011-09-19 04:02:17 EDT
Created attachment 203571 [details]
added indigo repos in parent, configured tycho surefire plugin

with this patch, I was able to run successfully all tests in org.eclipse.equinox.p2.tests (1765 tests) except :
test233240_artifactsDeleted (expected 6 but was 3)
from36To37 (NPE)
install37From36 (Could not find the verifier bundle)

thing is, I also had to download and copy to /home/anthony/Téléchargements/eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz an indigo release

I am still wondering what would be the best way to get during the build this indigo release... I am thinking an ant script in Hudson (preliminary step), checking for this archive, if not there, it would download it; but maybe there is a maven tip to make this download step part of the maven build...

anyway, it's moving forward ;-)
Comment 12 Pascal Rapicault CLA 2011-09-19 08:40:42 EDT
Comment on attachment 202423 [details]
Changing the packaging of ie.wombat.jbdiff.test from eclipse-plugin to eclipse-test-plugin

jbdiff changed applied. Thx
Comment 13 Pascal Rapicault CLA 2011-09-24 21:24:43 EDT
Comment on attachment 203571 [details]
added indigo repos in parent, configured tycho surefire plugin

Applied.
Comment 14 Anthony Dahanne CLA 2011-10-05 15:07:15 EDT
Created attachment 204623 [details]
upgraded tycho from 0.12.0 to 0.13.0 for p2 build

the (main) reason to upgrade now is to allow the use of the –Dmaven.test.failure.ignore argument to let tycho surefire plugin (the test launcher) not to fail when there is a test failure or error; that way we can envision an Hudson build, even if some errors or failures remain in the tests...

you can follow this discussion about the resolution:=optional attribute that tycho 0.13.0 interprets as "do not include at compile time" since 0.13.0 ; I got over it using the jars.extra.classpath in build.properties, thanks to Brian
http://dev.eclipse.org/mhonarc/lists/p2-dev/msg04475.html
Comment 15 Igor Fedorenko CLA 2011-10-05 15:43:58 EDT
(In reply to comment #14)
> Created attachment 204623 [details]
> upgraded tycho from 0.12.0 to 0.13.0 for p2 build
> 
> the (main) reason to upgrade now is to allow the use of the
> –Dmaven.test.failure.ignore argument to let tycho surefire plugin (the test
> launcher) not to fail when there is a test failure or error; that way we can
> envision an Hudson build, even if some errors or failures remain in the
> tests...
> 

FYI, you can use -fae or -fn mvn invocation option to get more or less the same result. This is standard maven functionality and works for any Tycho version.
Comment 16 Anthony Dahanne CLA 2011-10-05 18:07:48 EDT
Created attachment 204645 [details]
make the tests bundle download an eclipse platform before executing the tests

first, thanks Igor for reminding me those maven switches... well anyway, I guess it's good that p2 build uses the latest tycho ;-)
this patch add a maven ant runner step, to download an eclipse platform that is needed by p2 migration tests.
if you are using windows, append -Dplatform.archive.name=eclipse-indigo-platform.zip to your mvn command.
As far as I know, it is the best way (to download the eclipse archive using ant) to make those p2 migration tests run...

To demo the impact of those 2 last patches (tycho 0.13.0 and the ant task to download the eclipse platfrom), I cloned the p2 git repo to my github account and applied them; and I set up a CI build that :
* git clone http://github.com/anthonydahanne/make-p2-buildable-with-tycho.git
* mvn clean install -f org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-parent/pom.xml
* mvn clean -f org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-aggregator/pom.xml -Dmaven.test.failure.ignore=true

and the result is there :
http://ci.dahanne.net/job/make-p2-buildable-with-tycho/lastCompletedBuild/testReport/

3 tests are not passing, and some test bundles are still commented, but I think we could set up a CI build on hudson.eclipse.org for this, IMO that would help see the progress made.
Should I create a BZ entry for that ? (once the patches are accepted ?)
Comment 17 Ivar Refsdal CLA 2011-11-06 13:56:48 EST
Created attachment 206500 [details]
Syncing of pom.xml version numbers with MANIFEST.MF/similar.

Hi Anthony Dahanne & everybody else.
I used Dahanne's git repo and the instructions posted worked /fairly/ well.

This is to say that there seems to be a few silent failures, at least I did not spot them when doing:
mvn clean install -f org.eclipse.equinox.p2.releng/org.eclipse.equinox.p2-aggregator/pom.xml -Dmaven.test.failure.ignore=true
For example the p2.sdk would not build.

The problem is that the versions of pom.xml and the corresponding META-INF/MANIFEST.MF is out of sync. The problematic poms can be detected with the following:

mvn org.eclipse.tycho:tycho-packaging-plugin:0.13.0:validate-version -f ./features/org.eclipse.equinox.p2.sdk/pom.xml
mvn org.eclipse.tycho:tycho-packaging-plugin:0.13.0:validate-version -f ./features/org.eclipse.equinox.p2.user.ui/pom.xml
mvn org.eclipse.tycho:tycho-packaging-plugin:0.13.0:validate-version -f ./bundles/org.eclipse.equinox.p2.tests.ui/pom.xml

Apply the patch and no errors for all three using Dahanne's repo.
The last won't compile in rt.equinox.p2 for other reasons it seems.

(PS: My first patch so... Hopefully works.)
Comment 18 Pascal Rapicault CLA 2011-11-21 23:27:11 EST
Comment on attachment 204645 [details]
make the tests bundle download an eclipse platform before executing the tests

Patch applied
Comment 19 Pascal Rapicault CLA 2011-11-21 23:27:21 EST
Comment on attachment 206500 [details]
Syncing of pom.xml version numbers with MANIFEST.MF/similar.

Patch applied. Thc
Comment 20 Ian Bull CLA 2012-05-09 11:25:15 EDT
This will happen as part of the CBI during Kepler.
Comment 21 Pascal Rapicault CLA 2012-11-21 10:38:25 EST
A big part of this work has been done in the past, though it has been irregularly working because it lacked attention and was never used as a primary way to build p2. 
Since then the CBI changes have occurred and have introduced other issues that are being described in bug #382006.

Closing this bug and tracking additional work in bug #382006.