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

Difficulties when using from Windows WSL2 Unbuntu #33

Open
AMorgaut opened this issue May 3, 2024 · 3 comments
Open

Difficulties when using from Windows WSL2 Unbuntu #33

AMorgaut opened this issue May 3, 2024 · 3 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation 👀 👀 waiting commiter 👀 👀

Comments

@AMorgaut
Copy link
Contributor

AMorgaut commented May 3, 2024

Configuration

  • Windows 11
  • Ubuntu 22.04 LTS in WSL2
  • Github for Windows
  • VSCode (launched via $ code . from the repo root folder)

Steps

Because having diffuculties with my ssh keys from Ubuntu, from https://github.com/green-code-initiative/ecoCode-common I clicked on the "Code" button and selected the "Open with Github Desktop" option
image
It handles Github MFA

From Github Desktop I selected a folder in my WSL2 filesystem
image

From the WSL2 Ubuntu, I went to the ecocode-common folder and launched VSCode

cd ecocode-common
code .

Then I opened the bash terminal from VSCode to do any required command line actions
(like I'm used to when using git or npm command on a project)

Faced issues

File execution property

When trying to execute check_requirements.sh the autocomplete didn't work

./tools/check_requirements/ #no autocompletion here

I quickly uderstood I had to call chmod to make it executable

chmod +x ./tools/check_requirements/check_requirements.sh

and did the same thing to _core.sh

Bad interpreter

Now that I could run it

./tools/check_requirements/check_requirements.sh

I got a strange issue

bash: ./tools/check_requirements/check_requirements.sh: /bin/bash^M: bad interpreter: No such file or directory

It turned out that the file was in CRLF, idem for _core.sh and all the files
It looks like potentially the Github Desktop turned the files into CRLF
Note that CRLF might be ok for the .bat windows file

I tried to initiate an .editorconfig file
ex:

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Windows-style newlines for bat files
[*.bat]
end_of_line = crlf

but it may have to be also defined at a git config level

No such file or directory

Now that I was fixed I runned it again

./tools/check_requirements/check_requirements.sh

I got a _core.sh: No such file or directory error
It turned out that I had to go first in the script folder to hav it running

cd tools/check_requirements/
./check_requirements.sh

javap: command not found

I did install Java 11 as I saw it required

$ java --version
openjdk 17.0.10 2024-01-16

but apparently my Java was not complete, What is this javac ?
( I'm a JavaScript developer sorry ;-) )

So I've been told to install the whole SDK coming with

sudo apt install openjdk-11-jdk

Syntax error: invalid arithmetic operator

Once the JDK is installed (Hourra)
A new error came out

***** Java 🚀
   ✅ installation
")syntax error: invalid arithmetic operator (error token is "
   ❌ min version : please check or install good version 
        (current class version : 55)
')/ min jdk version : '11n : '55
")syntax error: invalid arithmetic operator (error token is "
   ❌ max version : please check or install good version 
        (current class version : 55)
')/ max jdk version : '17n : '61

I was not able to fix that one

Maven check display error

A related error apperently also happened when checking the Maven version

***** Maven 🚀
   ✅ installation
   ✅ min version
')      (current version : 3.6.3 / min version : '3.5.2
   ✅ max version
')      (current version : 3.6.3 / max version : '3.9.6
@dedece35
Copy link
Member

dedece35 commented May 3, 2024

Hi @AMorgaut,
thank you a lot for beta-testing our tool on Windows + WSL2 !
This is an issue very well described.

@dedece35 dedece35 self-assigned this May 3, 2024
@dedece35 dedece35 added bug Something isn't working documentation Improvements or additions to documentation labels May 3, 2024
@AMorgaut
Copy link
Contributor Author

AMorgaut commented May 3, 2024

Hopefully if someone encounter one of my issues, he may find some answers in this thread ;-)

@AMorgaut
Copy link
Contributor Author

AMorgaut commented May 3, 2024

I think using the Windows Github Desktop to clone into the WSL2 Ubuntu filesystem is not very common
I will try to fix my ssh issue to be in a more regular situation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation 👀 👀 waiting commiter 👀 👀
Projects
None yet
Development

No branches or pull requests

2 participants