Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors during setup: Wrong paths #145

Closed
jambulud opened this issue Jul 22, 2019 · 14 comments
Closed

Errors during setup: Wrong paths #145

jambulud opened this issue Jul 22, 2019 · 14 comments
Labels
blocker severe bug that blocks users in their daily work and has to be fixed asap bug Something isn't working eclipse related to Eclipse IDE scripts related to shell scripts (bash and CMD) windows specific for Microsoft Windows OS
Milestone

Comments

@jambulud
Copy link
Member

jambulud commented Jul 22, 2019

Category: Bug

Severity: Medium

windows 10 x64, devon-ide 3.0.0-beta9, cmd and powershell

While installing devon-ide 3.0.0-beta9 i found some errors related with incorrect paths (eclipse, node and vscode)

Please, see the pdf attached.

devon-ide.pdf

@jambulud jambulud added bug Something isn't working eclipse related to Eclipse IDE scripts related to shell scripts (bash and CMD) windows specific for Microsoft Windows OS labels Jul 22, 2019
@hohwille
Copy link
Member

@jambulud thanks for testing and the feedback.
Eclipse.app/Contents/Eclipse seems to come from MacOs. It seems like some error related to #128 - I will check.

@hohwille
Copy link
Member

To solve this, replace ${ECLIPSE_HOME}/eclipse/ to ${ECLIPSE_HOME}/eclipse/eclipse

The ECLIPSE_HOME variable needs to point to the eclipse directory that contains the eclipse binary. So it seems on (your) windows system for some reason ECLIPSE_HOME is pointing to the software directory (or to something entirely wrong such as software/Eclipse.app/Content/Eclipse). So the correct fix is to ensure that ECLIPSE_HOME is set correctly.

@hohwille
Copy link
Member

@jambulud #128 has been fixed immediately before 3.0.0-beta8. Can you tell us which version of devon-ide you were using when facing this bug? If a version before 3.0.0-beta7 then most of your bug reporting is a duplicate that has already been fixed (except for the non absolute eclipse passing that I will fix asap).

@hohwille
Copy link
Member

Also note that command -v «cmd» is the same as which «cmd» and is checking that a programm («cmd») is on your path.
Passing the absolute path of the command does not make any sense. In that case we can simply delete the line or replace it with something like:

if [ ! -x "${ECLIPSE_HOME}/eclipse" ]
then
  doFail "Eclipse binary is not available in ${ECLIPSE_HOME}"
fi

@jambulud
Copy link
Member Author

@jambulud #128 has been fixed immediately before 3.0.0-beta8. Can you tell us which version of devon-ide you were using when facing this bug? If a version before 3.0.0-beta7 then most of your bug reporting is a duplicate that has already been fixed (except for the non absolute eclipse passing that I will fix asap).

I'm using 3.0.0-beta9

@hohwille
Copy link
Member

So it seems I figured out parts of the problem:

  1. eclipse is not properly put on the path and therefore command -v eclipse fails. Needs to be fixed.
  2. For some unclarified reason on your machine ECLIPSE_HOME was not pointing to the proper installation path of eclipse. This needs some investigation. Ideally you could add some echo $ECLIPSE_HOME debug output to your eclipse commandlet and let us know.

Everything else is just a consequence of these two issues. E.g.
https://github.com/devonfw/devon-ide/blob/10a34cd075c7518b2ae336537053caf58fe24f4c/scripts/src/main/resources/scripts/command/eclipse#L73
Is a fallback for MacOs. In the end it is properly detecting that your Eclipse is not properly installed at $ECLIPSE_HOME but simply because of 2.
The output log might be confusing and we could do some improvements as nice to have but this is not the actual bug.

@jambulud
Copy link
Member Author

jambulud commented Jul 29, 2019

To solve this, replace ${ECLIPSE_HOME}/eclipse/ to ${ECLIPSE_HOME}/eclipse/eclipse

The ECLIPSE_HOME variable needs to point to the eclipse directory that contains the eclipse binary. So it seems on (your) windows system for some reason ECLIPSE_HOME is pointing to the software directory (or to something entirely wrong such as software/Eclipse.app/Content/Eclipse). So the correct fix is to ensure that ECLIPSE_HOME is set correctly.

ECLIPSE_HOME is pointing to software/eclipse, but inside folder eclipse i have another "eclipse" folder, and inside this folder there is a eclipse.exe

The folders are structured as follows:
software
---- eclipse (ECLIPSE_HOME, folder 1)
-------- eclipse (folder 2)
------------ eclipse.exe (executable)
-------- .devon.software.version (file)

that's why i'm using ECLIPSE_HOME/eclipse (folder 2)/eclipse (executable)

echo ECLIPSE_HOME: /c/projects/myproject/software/eclipse

@hohwille
Copy link
Member

Thanks for your feedback.
So the actual error with 2. is that the doInstall function was buggy and installed eclipse inside yet another eclipse folder on your machine. IMHO this is already fixed in #144 but we would need to verify this.

So the ECLIPSE_HOME variable is set properly. You found a bug in the actual installation process (technically doExtract function is extracting the downloaded archive file and then moves that to the software folder. There seems to be a bug in that procedure. We would need to retest this on windows with the latest SNAPSHOT build from master branch.)

@hohwille
Copy link
Member

So I fixed 1. with PR #148
We still need to investigate 2. and include a fix as necessary.

@hohwille
Copy link
Member

hohwille commented Jul 29, 2019

Maybe I should reimplement doReplaceExtracted. The problem is that some tools provide download artifacts containing only a folder that itself contains the actual software (e.g. eclipse/*) while other tools contain the software content as multiple files and folders directly.

A reimplementation of doReplaceExtracted should automatically detect if the extracted archive only contains a single folder or the software content directly with files and folders. According to that decision it should move the software content from the subfolder or the extracted archive directly. This would prevent issues like this as this is not the first time we were facing such problems.

@hohwille
Copy link
Member

I have restest with the latest SNAPSHOT version in Windows10 Pro x64 VM and get the same error. So it seems the windows ZIP release contains eclipse/* while the macos DMG release contains the Eclipse.app directly not inside an eclipse folder. (see also my comment above).
So I will need to fix 2. and will update my PR #148 accordingly.

@hohwille
Copy link
Member

https://update.code.visualstudio.com/latest/win32-x64-user/stable should be
https://update.code.visualstudio.com/latest/win32-x64-archive/stable

Wow! Excellent finding with perfect fix. Thanks. I will incorporate the change into PR #148 and think then all should be fine.

@hohwille
Copy link
Member

hohwille commented Jul 29, 2019

I can also confirm the node error. However it does not occur on my system (MacOS) but only in windows (in my VM):

C:\projects\latest>devon node setup
Version v10.16.0 of node.js is already installed.
Running command: '/c/projects/latest/software/node/bin/node' -v
/c/projects/latest/scripts/command/../functions: line 52: /c/projects/latest/software/node/bin/node: No such file or directory

******** ATTENTION ********
ERROR: Failed to verify installation of node.js ('/c/projects/latest/software/node/bin/node')
We are sorry for the inconvenience. Please check the above errors, resolve them and try again.
Exit code was 127
devon-ide environment variables have been set for C:\projects\latest

It is really ugly when tools have such pointless differences between different OS/platforms...

@hohwille hohwille added the blocker severe bug that blocks users in their daily work and has to be fixed asap label Jul 29, 2019
hohwille added a commit that referenced this issue Jul 29, 2019
* #145: improved verification of eclipse installation
* #145: fixed/improved installation to auto-detect if archive has a single top-level folder (except macos *.app dir) to omit in installation dir
* #84: install CobiGen from public update site
* #89: fixed another invisible unicode space character
* #148: updated vscode to 1.36.1
* #145: fixed proper download URL for vscode on windows to prevent broken ZIP download issue
* #145: fixed node installation verification to work also on windows
* #150: fixed m2e lifecylce-mapping config
* #149: prevent eclipse lock stopping to launch other IDEs
@hohwille
Copy link
Member

hohwille commented Jul 29, 2019

@jambulud thanks again for your intense testing and valuable feedback. I fixed all issues now.
As PR #148 has been merged, I can also close this issue.
I will try to release a new beta version soon.

@hohwille hohwille added this to the release:3.0.0 milestone Jul 29, 2019
hohwille added a commit that referenced this issue Jul 30, 2019
#151: fix for commandlet invocations so un-exported variables remain visible
#145: fix for doUpgradeMavenArtect invoking doInstall (was forgotten on refactoring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker severe bug that blocks users in their daily work and has to be fixed asap bug Something isn't working eclipse related to Eclipse IDE scripts related to shell scripts (bash and CMD) windows specific for Microsoft Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants