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

WSL/Windows/Git Bash/Cygwin confusion #19

Open
axmmisaka opened this issue Aug 31, 2023 · 9 comments
Open

WSL/Windows/Git Bash/Cygwin confusion #19

axmmisaka opened this issue Aug 31, 2023 · 9 comments

Comments

@axmmisaka
Copy link

axmmisaka commented Aug 31, 2023

Some issues in the current scripts:

  1. WSL is Linux. If running this script under WSL, it should be the same as running on any other Linux distro, like Ubuntu. It makes people confused to mix reference to WSL and Windows.

    installation/install.sh

    Lines 53 to 54 in 819ce99

    echo " - Installing POSIX-compatible tools for WSL"
    echo " => PowerShell scripts available at https://github.com/lf-lang/lingua-franca/releases"

    (We are installing Windows, not WSL tools; powershell is cross-platform, but used extensively on Windows; however here we are using bash )
  2. windows-latest on GH Actions uses Git bash as bash. Git bash has $OSTYPE=msys
  3. There is another famous Unix-like environment on Windows, Cygwin, with $OSTYPE=cygwin. We don't support it at all.
  4. lfc uses powershell on Windows. The current way of creating bash script will simply fail under powershell.
@lhstrh
Copy link
Member

lhstrh commented Aug 31, 2023

Some issues in the current scripts:

1. WSL is Linux. If running this script under WSL, it should be the same as running on any other Linux distro, like Ubuntu. It makes people confused to mix reference to WSL and Windows.
   https://github.com/lf-lang/installation/blob/819ce99ce1ac459250217c91e5e37b71898df6a5/install.sh#L53-L54
   
   (We are installing Windows, not WSL tools; powershell is cross-platform, but used extensively on Windows; however here we are using bash )

I'm not a Windows user and I don't know how to communicate effectively with Windows users. 😆 Could you submit a PR with suggested improvements?

2. `windows-latest` on GH Actions uses Git bash as bash. Git bash has `$OSTYPE=msys`

OK. What are the implications of this? Is there then no way to test WSL in GitHub Actions?

3. There is another famous Unix-like environment on Windows, Cygwin, with `$OSTYPE=cygwin`. We don't support it at all.

Right. I believe that for the platforms that we don't support we print an error message. If we want to support Cygwin, somebody with a Cygwin setup should develop it. Can we test Cygwin in CI?

4. `lfc` uses powershell on Windows. The current way of creating bash script will simply fail under powershell.

The install script only targets POSIX-compatible systems: Linux, Mac, and WSL should work. If we want to provide a Windows-compatible (powershell?) installation script, then this should be written by someone that has a Windows machine. But I personally don't see any need for it, because folks can just use WSL.

@axmmisaka
Copy link
Author

Could you submit a PR with suggested improvements?

👍🏼 will do

What are the implications of this? Is there then no way to test WSL in GitHub Actions?
There are some ways to test WSL in GH Actions, but there's no need - WSL1 is (somewhat) a flavour of Linux, just like Debian/Ubuntu/Arch. WSL2 are simply Hyper-V VMs. If our script work on Ubuntu, they should work on WSL.

Can we test Cygwin in CI?

I think so? https://stackoverflow.com/a/75500329

The install script only targets POSIX-compatible systems: Linux, Mac, and WSL should work. If we want to provide a Windows-compatible (powershell?) installation script, then this should be written by someone that has a Windows machine. But I personally don't see any need for it, because folks can just use WSL.

If that's the case, we can simply remove all Windows-relevant stuff, as they are nowhere related to WSL. The current Windows support assumes vanilla windows+git bash (which doesn't come with vanilla windows). I can make a powershell one later, if that's needed?

@lhstrh
Copy link
Member

lhstrh commented Aug 31, 2023

My goal hasn't been to support Windows + Git Bash but to support WSL. I'm hesitant to support the development of a powershell script because that will double our maintenance efforts and offers no clear advantage since Windows users can simply be instructed to use WSL. How do we test WSL in CI?

@lhstrh
Copy link
Member

lhstrh commented Aug 31, 2023

I suppose we should use this? https://github.com/marketplace/actions/setup-wsl

There is, of course value in supporting Git Bash, but my finding was that it didn't deal well with the symlinks, so I had to create these silly scripts instead...

@axmmisaka
Copy link
Author

If we want to make 100% sure that it works on WSL1, we can use https://github.com/marketplace/actions/setup-wsl
Yet, since WSL2 is simply a VM, I don't think there's any value in testing on it explicitly... (It will behave exactly the same as any Ubuntu, except without systemd by default...... which doesn't affect us at all)

@lhstrh
Copy link
Member

lhstrh commented Sep 1, 2023

Would the current script create symlinks in WSL? Or would it use the generated scripts?

@axmmisaka
Copy link
Author

Symlinks

@lhstrh
Copy link
Member

lhstrh commented Sep 1, 2023 via email

@axmmisaka
Copy link
Author

axmmisaka commented Sep 1, 2023

So the workaround I created is for Git Bash? Not WSL?

Yes, on WSL the OS_TYPE is linux-gnu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants