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

Is WSL (Windows Subsystem for Linux) supported? #177

Closed
Wizek opened this issue Nov 20, 2017 · 10 comments
Closed

Is WSL (Windows Subsystem for Linux) supported? #177

Wizek opened this issue Nov 20, 2017 · 10 comments

Comments

@Wizek
Copy link

Wizek commented Nov 20, 2017

I was able to install nix by itself. Then when I tried to ./try-reflex, I got the following error.

root@DESKTOP:~/reflex-platform# ./try-reflex
If you have any trouble with this script, please submit an issue at https://github.com/reflex-frp/reflex-platform/issues
It looks like your filesystem's root directory is writable by the current user.  This will cause nix to fail building try-reflex, and may also indicate a security vulnerability.  Note that you should not run try-reflex as root.
To fix this problem, please use your operating system's "repair permissions" feature, if it has one, or manually remove write permissions for your user from the '/' directory.

root@DESKTOP:~/reflex-platform#

So I've created a non-root user inside WSL, set a password for it, added it to sodoers list, changed to it, reinstalled nix under it and now try-reflex install is purring along nicely. I intend to update this post with followup questions if I encounter any more roadblocks, or a note of success otherwise, hopefully to benefit others who are looking to find out if reflex can be built with Windows or WSL.


Misc:

Windows 10 build version: 15063.674
Related issue: #116 (comment)

@3noch
Copy link
Member

3noch commented Nov 20, 2017

Last I knew GHC builds on WSL were horrendously slow. I think Nix's heavy use of dynamic linking does not play well with WSL. However, that's just a theory. Interested in what you find.

@Wizek
Copy link
Author

Wizek commented Nov 20, 2017

I can vouch for slowness so far. About 3-4 hours and counting. Building single modules seems to take GHC minutes instead of seconds. Let's see where this goes. I hope I won't have to run this for weeks; fingers crossed.

Edit: This issue may be related: microsoft/WSL#1671

@Wizek
Copy link
Author

Wizek commented Nov 21, 2017

Great Success!

asd

After being fed up with the slowness I snooped around, and it turns out I just needed some windows updates (fall creators update, v1709). After that nix+ghc was much faster, near native AFAICT.

I also needed to install VcXsrv, and set some other settings that I am likely not remembering in my sleepiness currently -- but wanted to share the good news before going to bed. If anyone hits an error please say so and I'll see if I've encountered it or not; and if so, how I fixed it.

@3noch
Copy link
Member

3noch commented Nov 21, 2017

Wow! Awesome!

@ryantrinkle
Copy link
Member

This is really awesome! Thanks for trying it out, @Wizek

@zarybnicky
Copy link

zarybnicky commented Dec 16, 2017

@Wizek I'm wondering how you managed to do that, as on my system, building ghc-8.0.2-with-packages fails - I've managed to track down the issue to microsoft/WSL#2229 (also tracked in microsoft/WSL#2443 and NixOS/nixpkgs#27808). Debugging syscalls is however a bit outside of my experience, so I guess that I'll switch back to a NixOS VM in the meantime...
(I'm using Insider Build v17025)

@ali-abrar
Copy link
Member

Should this issue be closed, or are there some changed to reflex-platform that we ought to make as a result of the above? Thanks!

@zarybnicky
Copy link

I've tried again, but this time I got stuck on installing Nix inside WSL - I ran into NixOS/nix#1785, but despite having Insider Builds enabled, I'm only on v17074 (compared to v17084 that seems to solve it). I'll try to enable the fast-track for Insider builds, but it might take a while.

The issue I ran into before, assuming that the problem still exists, seems to be resolved by modifying lndir - either patching the executable, or replacing it with e.g. https://opensource.apple.com/source/X11/X11-0.46.4/lndir.sh (one suggested replacement)

@zarybnicky
Copy link

Trying again after switching to fast-track insider builds - I'm on v17115 now and ./try-reflex works OK. reflex-todomvc exits with 'cannot open display', but that is simply a case of missing VcXsrv, and ghcjs compilation works just fine.
So @ali-abrar, I think it's fine to close this issue - despite the fact that microsoft/WSL#2229 is still open, it seems that whatever Nix does now works well enough.

@ali-abrar
Copy link
Member

Thanks, @zarybnicky.

matthewbauer pushed a commit that referenced this issue Nov 20, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Replace MonadThrow with domain specific MonadError for Obelisk.Migration
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

5 participants