eclipse / aCute

Eclipse aCute - C# edition in Eclipse IDE
https://projects.eclipse.org/projects/tools.acute
Eclipse Public License 2.0
78 stars 33 forks source link

Detection of OS is confused when using Linux to create Windows Eclipse #155

Closed AntonKrug closed 5 years ago

AntonKrug commented 5 years ago

There was a change in last 1month or so which breaks the Linux automated installation of Windows plugins. I have a workflow where I use Linux to produce both Linux and Windows Eclipse IDEs. It works well, but recently when installing aCute I get this following problem:

An error occurred while installing the items
    session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]org.eclipse.acute.netcoredbg.win32.x86_64 0.1.0.201809112116, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ChmodAction).
    The action chmod failed - file <MY_PATH>/eclipse/plugins/org.eclipse.acute.netcoredbg.win32.x86_64_0.1.0.201809112116/netcoredbg.exe/netcoredbg does not exist

Looks like when the host is detected to be Linux it uses slightly different paths, below is the path the install script is trying to do, after that I try where the location binary really is.

Wrong:
<MY_PATH>/eclipse/plugins/org.eclipse.acute.netcoredbg.win32.x86_64_0.1.0.201809112116/netcoredbg.exe/netcoredbg

Correct:
<MY_PATH>/eclipse/plugins/org.eclipse.acute.netcoredbg.win32.x86_64_0.1.0.201809112116/netcoredbg/netcoredbg.exe 

Could the installation script instead of trying to detect the host OS just trust the P2 settings as for all the other plugins I'm for about a year in this setup work well with the P2 setting

-p2.os win32 -p2.ws win32 -p2.arch x86_64
mickaelistria commented 5 years ago

Can you please provide basic steps to reproduce this issue?

AntonKrug commented 5 years ago
  1. Download Linux and Windows Platform Runtime Binary Eclipse wget https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.9-201809060745/eclipse-platform-4.9-win32-x86_64.zip\&r=1 wget https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.9-201809060745/eclipse-platform-4.9-linux-gtk-x86_64.tar.gz\&r=1

  2. Extract them.

  3. Run the Linux Eclipse P2 director and tell it to use Windows destination and Windows platform (the path needs to be absolute path):

    WIN_LOCATION=`realpath ../../scWindows/eclipse`
    ./eclipse -application org.eclipse.equinox.p2.director -profile SDKProfile -noSplash -roaming -repository $PLUGIN_REPOSITORIES -installIU $PLUGIN_ARTEFACTS -destination $WIN_LOCATION -bundlepool $WIN_LOCATION -p2.os win32 -p2.ws win32 -p2.arch x86_64

    The $PLUGIN_ARTEFACTS and $PLUGIN_REPOSITORIES need to be set to desired plugins and repositories you are going to install. This workflow works for all the plugins I tried over the year.

mickaelistria commented 5 years ago

Ok, thanks. I won't be able to try it very soon, especially since the use-case isn't really common. So if you can take care of troubleshooting this and writing a good patch, that'd be very welcome.

AntonKrug commented 5 years ago

It is bit odd, here is the p2 director which reads the targetDir, targetFile and permissions parameters and it strange how the ".exe" is getting into the targetDir.

https://git.eclipse.org/c/equinox/rt.equinox.p2.git/tree/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ChmodAction.java?h=R3_6_maintenance

While here is the Windows p2 installation step: https://github.com/eclipse/aCute/blob/master/netcoredbgFragments/org.eclipse.acute.netcoredbg.win32.x86_64/META-INF/p2.inf

Another factor is that this was working in late November of 2018, my guess is that the change which affected this behavior was done somewhere else and this is only symptoms of this change.

mickaelistria commented 5 years ago

I belive chmod isn't required for windows artifacts in general. I've pushed https://github.com/eclipse/aCute/commit/e8bd5301d01b615667acdfca5ee4f9501dc398e5 . Please try again using http://download.eclipse.org/acute/snapshots within a few minutes and reopen if it doesn't work.

AntonKrug commented 5 years ago

Yes for Windows it should be irrelevant. And yes the 0.2.2.201901231712 does install without issue. Thank you very much.