Closed mypsycho closed 2 years ago
https://eclipsesource.com/blogs/2009/01/20/tip-eclipse-bundleshape
We must set Eclipse-BundleShape in nl.tue.rotalumis.executables to dir. It is tested locally with success.
Once nl.tue.rotalumis.executables is in 'dir' shape. We only need to update org.eclipse.poosl.rotalumisclient.runner.RotalumisRunner to remove the useless unzip. Update
Change has been made on the integration branch, can this be tested.
To enable execution mode for Linux and Macos, metadata customisation is required:
Create META-INF/p2.inf file in nl.tue.rotalumis.executables with content:
# Set execution mode for executable
instructions.install.import= \
org.eclipse.equinox.p2.touchpoint.natives.chmod
instructions.install = \
chmod(targetDir:${artifact.location},targetFile:linux/64bit/rotalumis,permissions:755);\
chmod(targetDir:${artifact.location},targetFile:mac/64bit/rotalumis,permissions:755);
See https://wiki.eclipse.org/Equinox/p2/Customizing_Metadata for detail.
* Make sur Build.properties lists this file:
**bin.includes** property contains **META-INF/**
* Add the dependency to org.eclipse.equinox.p2.touchpoint.natives in _META-INF/MANIFEST.MF_:
Require-Bundle:org.eclipse.equinox.p2.touchpoint.natives
I made the change, now I get:
An error occurred while installing the items
session context was:(profile=epp.package.dsl, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=[R]nl.tue.rotalumis.executables 4.2.0.202109171116 --> [R]nl.tue.rotalumis.executables 4.2.0.202110180752, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ChmodAction).
The action chmod failed - file /home/~/Programming/Poosl/IDE-DIR/eclipse/plugins/nl.tue.rotalumis.executables_4.2.0.202110180752.jar/linux/64bit/rotalumis does not exist
(before last change) On linux I see it create the following file:
plugins/linux/64bit/rotalumis
on linux (64 bit). For me the permissions on this file is correct (740).
Digging into https://git.eclipse.org/c/equinox/rt.equinox.p2.git/tree/bundles it appears there are 2 implementations for chmod action on install. The 'native' implementation does not deal properly with 'bundleshape=dir'.
To use 'eclipse' implementation:
change META-INF/p2.inf file in nl.tue.rotalumis.executables with content:
# Set execution mode for executable
instructions.install.import= \
org.eclipse.equinox.p2.touchpoint.eclipse.chmod
instructions.install = \
chmod(targetDir:@artifact,targetFile:linux/64bit/rotalumis,permissions:755);\
chmod(targetDir:@artifact,targetFile:mac/64bit/rotalumis,permissions:755);
You can notice targetDir option is different here.
* Add the dependency to org.eclipse.equinox.p2.touchpoint.eclipse in _META-INF/MANIFEST.MF_:
Require-Bundle:org.eclipse.equinox.p2.touchpoint.eclipse
I get almost the same error:
session context was:(profile=epp.package.dsl, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=[R]nl.tue.rotalumis.executables 4.2.0.202110180801 --> [R]nl.tue.rotalumis.executables 4.2.0.202110251205, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ChmodAction).
The artifact /home/~/Programming/Poosl/IDE-DIR/eclipse/plugins/nl.tue.rotalumis.executables_4.2.0.202110251205.jar is not a directory.
I get almost the same error:
session context was:(profile=epp.package.dsl, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=[R]nl.tue.rotalumis.executables 4.2.0.202110180801 --> [R]nl.tue.rotalumis.executables 4.2.0.202110251205, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.ChmodAction). The artifact /home/~/Programming/Poosl/IDE-DIR/eclipse/plugins/nl.tue.rotalumis.executables_4.2.0.202110251205.jar is not a directory.
Property 'Eclipse-BundleShape = dir' desappeared from Manifest. ChmodAction cannot work without it.
weird. I did not remove that. Let me try this again from clean state.
For linux that seems to have worked.
It also seems to run under windows.
Using unpacked plugin, we could avoid unzipping an executable in temp zone.
This mode could work in a product. In dev env, target platform loader does not provide unpack plugin.