ObeoNetwork / POOSL

Eclipse Public License 2.0
1 stars 0 forks source link

Unpack nl.tue.rotalumis.executables in product #46

Closed mypsycho closed 2 years ago

mypsycho commented 3 years ago

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.

mypsycho commented 3 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.

mypsycho commented 3 years ago

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

MartijnKTue commented 3 years ago

Change has been made on the integration branch, can this be tested.

mypsycho commented 3 years ago

To enable execution mode for Linux and Macos, metadata customisation is required:

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

MartijnKTue commented 2 years ago

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
MartijnKTue commented 2 years ago

(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).

mypsycho commented 2 years ago

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:

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

MartijnKTue commented 2 years ago

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.
mypsycho commented 2 years ago

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.

MartijnKTue commented 2 years ago

weird. I did not remove that. Let me try this again from clean state.

MartijnKTue commented 2 years ago

For linux that seems to have worked.

MartijnKTue commented 2 years ago

It also seems to run under windows.