Can't install features in RCP [message #1804939] |
Wed, 03 April 2019 14:02 |
Julien Dehaudt 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.
- Export the product in Eclipse
- Make the installation read-only.
For example:
chown -R root:root eclipse-rcp-root/
chmod -R o+rx eclipse-rcp-root/ - Launch the Mail app as non-root user
- 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).
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03798 seconds