Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Remove p2 Folder in Materialized Products

See also http://stackoverflow.com/questions/8583710/tycho-puts-p2-folder-in-the-product-with-eclipse-repository-and-tycho-p2-direc


> In the materialized product folders I'm a little bothered about this
> additional eclipsec.exe, which I managed to remove via a
> productfilename.p2.inf and the entry
> 
> instructions.configure=org.eclipse.equinox.p2.touchpoint.natives.remove(pa
> th:${installFolder}/eclipsec.exe);

This is a hack and only works by chance: p2 doesn't guarantee any order in which touchpoints are executed, so your deletion may be executed before the file is created through a touchpoint on the IU which brings the executable.

The proper solution needs some investment in how p2 publishes products to no longer couple the eclipsec.exe to the eclipse.exe.

Regards
Tobias


> -----Original Message-----
> From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-
> bounces@xxxxxxxxxxx] On Behalf Of Mirko Swillus
> Sent: Donnerstag, 15. November 2012 18:41
> To: Tycho user list
> Subject: [tycho-user] Remove p2 Folder in Materialized Products
> 
> Hej,
> 
> I'm using Tycho 0.16.0. and eclipse-repository to build a lot of
> products, which works very well so far.
> 
> In the materialized product folders I'm a little bothered about this
> additional eclipsec.exe, which I managed to remove via a
> productfilename.p2.inf and the entry
> 
> instructions.configure=org.eclipse.equinox.p2.touchpoint.natives.remove(pa
> th:${installFolder}/eclipsec.exe);
> 
> Now I got an additional folder named "p2" below the $installFolder,
> which I do not need either, because we do not use the update feature
> within the products. This folder is with its 50Mb quite big, because the
> cache below org.eclipse.equinox.p2.core contains a self made JRE
> feature, which contains a complete JRE within its rootfiles (we are
> using this approach as an replacement for PDEs "Bundle JRE"-Feature). So
> I just thought of deleting this folder with the same mechanism that
> works for eclipsec.exe, I extended productfilename.p2.inf like so:
> 
> instructions.configure=\
> org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/ecl
> ipsec.exe);\
> org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/p2/
> );\
> 
> Unfortunately, this throws an IOException (see output from "mvn clean
> verify" [0], and the .log [1]).
> 
> Obviously, p2 first backups each file that it's going to remove, and
> while this backup the IOException occurs (some sort of concurrency
> problem maybe). Having a look at the source of p2's RemoveAction, I
> guess this behavior is not configurable.
> 
> So what would you suggest to do? Is there another approach to suppress
> the generation of a p2 folder in materialized products? Any help would
> be greatly appreciated! Regards,
> 
> Mirko Swillus
> 
> 
> [0] Output from "mvn clean verify":
> 
> ...
> An error occurred while configuring the installed items
>    session context was:(profile=DefaultProfile,
> phase=org.eclipse.equinox.internal.p2.engine.phases.Configure,
> operand=null --> [R]com.foo.casy.product
> 2.0.2.SNAPSHOT-201211151629,
> action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.RemoveAc
> tion).
>    Backup of file
> C:\Users\mirkos\workspaces\com.foo.build\com.foo.build\com.foo.products\ta
> rget\products\com.foo.casy.product\win32\win32\x86\someproduct\p2
> failed.
>    Caused by:  java.io.IOException: Der Prozess kann nicht auf die Datei
> zugreifen, da ein anderer Prozess einen Teil der Datei gesperrt hat
>    Application failed, log file location:
> C:\Users\mirkos\workspaces\com.foo.build\com.foo.build\workspace\.metadata
> \.log
> ...
> 
> [1] the workspace .log (please excuse German OS locale):
> 
> !SESSION 2012-11-15 17:30:21.294
> -----------------------------------------------
> eclipse.buildId=unknown
> java.version=1.7.0_05
> java.vendor=Oracle Corporation
> BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
> Framework arguments:  -eclipse.keyring
> C:\Users\mirkos\AppData\Local\Temp\tycho6133239347861452277secure_storage
> Command-line arguments:  -eclipse.keyring
> C:\Users\mirkos\AppData\Local\Temp\tycho6133239347861452277secure_storage
> 
> !ENTRY org.eclipse.equinox.p2.touchpoint.natives 4 0 2012-11-15
> 17:30:21.295
> !MESSAGE Backup store modified externally! 11 items out of 10 items
> restored. Remaining items can not be found.
> 
> !ENTRY org.eclipse.equinox.p2.engine 4 4 2012-11-15 17:30:21.296
> !MESSAGE An error occurred while committing the engine session for
> profile: DefaultProfile.
> !SUBENTRY 1 org.eclipse.equinox.p2.touchpoint.natives 4 0 2012-11-15
> 17:30:21.296
> !MESSAGE Restore of backup failed - see log for details. Backup
> directory name: DefaultProfile_27609d034ee0_c0a80a83e929.
> !STACK 0
> java.io.IOException: Errors while restoring - see earlier logged errors
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.close(Backu
> pStore.java:489)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.restore(Bac
> kupStore.java:452)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.LazyBackupStore.restore
> (LazyBackupStore.java:53)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.NativeTouchpoint.rollba
> ck(NativeTouchpoint.java:108)
> 	at
> org.eclipse.equinox.internal.p2.engine.EngineSession.rollback(EngineSessio
> n.java:194)
> 	at
> org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:84)
> 	at
> org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
> 	at
> org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.e
> xecutePlan(PlanExecutionHelper.java:41)
> 	at
> org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.e
> xecutePlan(PlanExecutionHelper.java:23)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.executePl
> an(DirectorApplication.java:767)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.planAndEx
> ecute(DirectorApplication.java:760)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.performPr
> ovisioningActions(DirectorApplication.java:747)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.run(Direc
> torApplication.java:1040)
> 	at
> org.eclipse.tycho.p2.tools.director.DirectorApplicationWrapper$DirectorApp
> licationWrapperCommand.execute(DirectorApplicationWrapper.java:43)
> 	at
> org.eclipse.tycho.plugins.p2.director.DirectorMojo.execute(DirectorMojo.ja
> va:116)
> 	at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuild
> PluginManager.java:101)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :209)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :153)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :145)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Li
> fecycleModuleBuilder.java:84)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Li
> fecycleModuleBuilder.java:59)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(L
> ifecycleStarter.java:183)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStar
> ter.java:161)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.
> java:290)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230
> )
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launche
> r.java:409)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> 
> !ENTRY org.eclipse.equinox.p2.engine 4 4 2012-11-15 17:30:21.307
> !MESSAGE An error occurred while configuring the installed items
> !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2012-11-15 17:30:21.308
> !MESSAGE session context was:(profile=DefaultProfile,
> phase=org.eclipse.equinox.internal.p2.engine.phases.Configure,
> operand=null --> [R]com.foo.casy.product 2.0.2.SNAPSHOT-201211151629,
> action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.RemoveAc
> tion).
> !SUBENTRY 1 org.eclipse.equinox.p2.touchpoint.natives 4 0 2012-11-15
> 17:30:21.308
> !MESSAGE Backup of file
> C:\Users\mirkos\workspaces\com.foo.build\com.foo.build\com.foo.products\ta
> rget\products\com.foo.casy.product\win32\win32\x86\someproduct\p2
> failed.
> !STACK 0
> java.io.IOException: Der Prozess kann nicht auf die Datei zugreifen, da
> ein anderer Prozess einen Teil der Datei gesperrt hat
> 	at java.io.FileInputStream.readBytes(Native Method)
> 	at java.io.FileInputStream.read(FileInputStream.java:220)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.Util.copyStream(Util.ja
> va:219)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.moveToBacku
> p(BackupStore.java:269)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backup(Back
> upStore.java:243)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backupAll(B
> ackupStore.java:301)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backupAll(B
> ackupStore.java:299)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backupAll(B
> ackupStore.java:299)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backupAll(B
> ackupStore.java:299)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.BackupStore.backupAll(B
> ackupStore.java:299)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.LazyBackupStore.backupA
> ll(LazyBackupStore.java:79)
> 	at
> org.eclipse.equinox.internal.p2.touchpoint.natives.actions.RemoveAction.ex
> ecute(RemoveAction.java:37)
> 	at
> org.eclipse.equinox.internal.p2.engine.ParameterizedProvisioningAction.exe
> cute(ParameterizedProvisioningAction.java:35)
> 	at
> org.eclipse.equinox.internal.p2.engine.Phase.mainPerform(Phase.java:174)
> 	at
> org.eclipse.equinox.internal.p2.engine.Phase.perform(Phase.java:92)
> 	at
> org.eclipse.equinox.internal.p2.engine.PhaseSet.perform(PhaseSet.java:47)
> 	at
> org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:75)
> 	at
> org.eclipse.equinox.internal.p2.engine.Engine.perform(Engine.java:44)
> 	at
> org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.e
> xecutePlan(PlanExecutionHelper.java:41)
> 	at
> org.eclipse.equinox.internal.provisional.p2.director.PlanExecutionHelper.e
> xecutePlan(PlanExecutionHelper.java:23)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.executePl
> an(DirectorApplication.java:767)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.planAndEx
> ecute(DirectorApplication.java:760)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.performPr
> ovisioningActions(DirectorApplication.java:747)
> 	at
> org.eclipse.equinox.internal.p2.director.app.DirectorApplication.run(Direc
> torApplication.java:1040)
> 	at
> org.eclipse.tycho.p2.tools.director.DirectorApplicationWrapper$DirectorApp
> licationWrapperCommand.execute(DirectorApplicationWrapper.java:43)
> 	at
> org.eclipse.tycho.plugins.p2.director.DirectorMojo.execute(DirectorMojo.ja
> va:116)
> 	at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuild
> PluginManager.java:101)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :209)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :153)
> 	at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java
> :145)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Li
> fecycleModuleBuilder.java:84)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(Li
> fecycleModuleBuilder.java:59)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(L
> ifecycleStarter.java:183)
> 	at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStar
> ter.java:161)
> 	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
> 	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> 	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
> 	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
> 	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
> 57)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
> pl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.
> java:290)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230
> )
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launche
> r.java:409)
> 	at
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top