vlaaad / reveal

Read Eval Visualize Loop for Clojure

Home Page:https://vlaaad.github.io/reveal/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WSL: UnsupportedOperationException during compile

crispinb opened this issue · comments

This was doing a quick try running the Reveal repl with clj -Sdeps '{:deps {vlaaad/reveal {:mvn/version "1.0.130"}}}' -m vlaaad.reveal repl (as per https://vlaaad.github.io/reveal/#give-it-a-try).

Got the exception report attached
clojure-10645607857424248407.txt

(this is under wsl2/ubuntu on Windows 10, running OpenJDK version 11).

Hi @crispinb!

AFAIK, Reveal can't work in WSL because it's a headless environment without access to the display.
There is vcxsrv project that aims to bring display support into WSL by emulating X server, but I was hesitant to try it because it has bugs causing hard reboot, so I personally use Reveal in plain Windows environment, without WSL.

If you can find a way to run it in WSL, please share it!

P.S. Powershell command for trying out Reveal looks like this:

clj -Sdeps "{:deps {vlaaad/reveal {:mvn/version """"1.0.130""""}}}" -m vlaaad.reveal repl

And you can find clj setup instructions for powershell here: https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows

Hey @vlaaad - thanks, I may try the powershell route, though I'm a reluctant Windows user and mostly stay on the linux side of the divide for dev purposes.

Are you sure though that that error has anything to do with the display? I have no problem running other X applications (I use https://x410.dev/ rather than vcxsrv). It only involves setting the DISPLAY env var correctly and opening up the windows firewall. Even pretty fancy things like IntelliJ work fine.

Anyway I'll have a poke around when I have a chance and see what I can find.

Woah, I had no idea Reveal might work from WSL... I reproduced your issue and found a fix that worked for me:

sudo apt install libgtk-3-0  

UI looks very blurry though...

Nice, the libgtk install worked for me. Thanks.

I found that with the default settings the UI is scaled correctly (and fonts are sharp) on my (old, low dpi) external monitor. But minuscule on my laptop's hidpi monitor. Setting the GDK_SCALE env var to 2 fixes the internal monitor scaling for me.

x410 also has its own 'dpi scaling' feature, but I find that does blur fonts - it works best for me to just scale up using the env var appropriate for a given ui toolkit.

GDK_SCALE worked wonders! I expanded windows-related site section with WSL instructions.