Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Can't install features in RCP(read-only installation)
Can't install features in RCP [message #1804939] Wed, 03 April 2019 14:02 Go to next message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 8
Registered: March 2016
Junior Member
Hi P2 folks,

I'm facing a disturbing issue with my RCP product on Linux during installation of 3rd party features when the installation location is read-only (in /opt resulting from .rpm/.deb installation).

The attached snipped allows to reproduce the issue, following the next steps. It is based on the RCP Mail Application slightly modified to reproduce my issue.

  1. Export the product in Eclipse
  2. Make the installation read-only.
    For example:
    chown -R root:root eclipse-rcp-root/
    chmod -R o+rx eclipse-rcp-root/
  3. Launch the Mail app as non-root user
  4. Try to install 3rd party sw (Git integration for Eclipse for sample)

Install will fails with such errors:
An error occurred while installing the items
session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.eclipse.ui.tutorials.rcp.part3 1.0.0, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.RemoveAction).
Backup of file /opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.ui.tutorials.rcp.part3_1.0.0/lib/lib.so failed.
File that was copied to backup could not be deleted: /opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.ui.tutorials.rcp.part3_1.0.0/lib/lib.so



Of course lib.so is part of the changes done.

In fact in sources there is a lib/ folder containing a lib.so.0.0.0 and its symlink lib.so:
lib.so -> lib.so.0.0.0
lib.so.0.0.0

To ensure that the lib/ layout will remain the same in final installation there are some custom actions in p2.inf to create back the link and set permissions.
This is required since the .jar format does not keep files permissions and does not support symlinks.
instructions.install.import=\
  org.eclipse.equinox.p2.touchpoint.eclipse.chmod,\
  org.eclipse.equinox.p2.touchpoint.natives.remove,\
  org.eclipse.equinox.p2.touchpoint.natives.ln
instructions.install=\
  chmod(targetDir:@artifact,targetFile:lib/lib.so.0.0.0,permissions:755);\
  remove(path:${artifact.location}/lib/lib.so);\
  ln(targetDir:${artifact.location},linkTarget:lib.so.0.0.0,linkName:/lib/lib.so);\
  chmod(targetDir:@artifact,targetFile:lib/lib.so,permissions:755);
However this seems to be the root cause of above error; if I remove both ln() and remove() instructions, install in 4) works like a charm thanks to the shared configuration area.

Hence my question, is there any other way to proceed to get P2 working? Taking into consideration above needs (read-only install + p2.inf for symlinks/perms + 3rd party feat install).
Re: Can't install features in RCP [message #1804943 is a reply to message #1804939] Wed, 03 April 2019 14:24 Go to previous messageGo to next message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 8
Registered: March 2016
Junior Member
2 weird things I also noticed during my investigations, might be related or not...
In both cases the exported product seems to be incomplete (or not initialized?). Note that running eclipse -initialize after 1) didn't helped more...

Installed root UI

From r/w installation:
index.php/fa/35217/0/

From r/o installation:
index.php/fa/35218/0/

License review during install

From r/w installation:
index.php/fa/35215/0/

From r/o installation:
index.php/fa/35216/0/

What afraid me with this last one is that installation of product features seems not completely done since I have to validate the product's licences although this is not part of the current installation scope (Git integration for Eclipse)

[Updated on: Wed, 03 April 2019 14:41]

Report message to a moderator

Re: Can't install features in RCP [message #1805070 is a reply to message #1804943] Fri, 05 April 2019 09:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33252
Registered: July 2009
Senior Member
Normally for a read-only installation the Eclipse runtime should make a surrogate installation folder normally in the ~/.eclipse folder and all activities such as installing or updating should take place there. You might try running the product with -vmargs -Duser.home=<some-location> and look to see whats in the <some-location>/.eclipse folder. If a surrogate is not created there then something is not properly detecting that your product installation is read-only.

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Can't install features in RCP [message #1805081 is a reply to message #1805070] Fri, 05 April 2019 13:14 Go to previous messageGo to next message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 8
Registered: March 2016
Junior Member
Hi Ed,

Thanks for taking time on my issue.

Yes this is the first thing I voted for, anyway the surrogate is correctly used by the application (either snippet or my product), at least it seems by looking the osgi.configuration.area value:
osgi.configuration.area=file:/home/me/.eclipse/org.eclipse.ui.tuto.rcp_1.0.0_1443872537_linux_gtk_x86_64/configuration/
1443872537 is a bit surprising, but things might have changed recently on the platform.

Some other keys are relying on the read-only location:
eclipse.home.location=file:/opt/eclipse-rcp-root/eclipse/
eclipse.launcher=/opt/eclipse-rcp-root/eclipse/eclipse
java.class.path=/opt/eclipse-rcp-root/eclipse//plugins/org.eclipse.equinox.launcher_1.5.200.v20180922-1751.jar
osgi.framework=file:/opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.osgi_3.13.200.v20181130-2106.jar
osgi.frameworkClassPath=., file:/opt/eclipse-rcp-root/eclipse/plugins/org.eclipse.osgi.compatibility.state_1.1.300.v20181116-1550.jar
osgi.install.area=file:/opt/eclipse-rcp-root/eclipse/
osgi.sharedConfiguration.area=file:/opt/eclipse-rcp-root/eclipse/configuration/
osgi.syspath=/opt/eclipse-rcp-root/eclipse/plugins
Anyway nothing unexpected..
Re: Can't install features in RCP [message #1805084 is a reply to message #1805070] Fri, 05 April 2019 13:26 Go to previous message
Julien Dehaudt is currently offline Julien DehaudtFriend
Messages: 8
Registered: March 2016
Junior Member
Ed Merks wrote on Fri, 05 April 2019 11:14
and all activities such as installing or updating should take place there.

Agree with that, thing definitely weird to me with the example is that I'm installing a 3rd party tool (Git integration for Eclipse), without any relation with org.eclipse.ui.tutorials.rcp.part3 (already installed, no updates), and its p2.inf is processed again, furthermore in an unexpected location.

The use-case is so standard that I am astonished nobody reported this before, or I'm doing something wrong :-)
Previous Topic:Servlet Bridge broken in 2018-03
Next Topic:P2 query to get list of plugins contained in a feature
Goto Forum:
  


Current Time: Tue Nov 05 14:58:15 GMT 2024

Powered by FUDForum. Page generated in 0.03798 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top