I'm trying to follow the tutorial in Ubuntu 20.04 with Java 11 and (skia/run #(ui/label "Hello world!"))
exits immediately without popping up anything or throwing/displaying any error. the call evaluates to #object[clojure.core.async.impl.channels.ManyToManyChannel 0x2c203f38 "clojure.core.async.impl.channels.ManyToManyChannel@2c203f38"]
I tried to clojure.core.async/take!
from that channel and my callback never gets called
hmmm, it seems like it should display an error if nothing happens
can you try using run-sync
instead of run
? (skia/run-sync #(ui/label "Hello world!"))
just to double check, which version of membrane are you using?
the channel should close when the all the windows are closed
run-sync
gives me an error trying to load a font:
Nov 17, 2020 10:16:30 AM com.sun.jna.Native$1 uncaughtException
WARNING: JNA: Callback membrane.skia.WindowRefreshCallback@51645204 threw the following exception
java.lang.AssertionError: Assert failed: unable to load font: 14
font-ptr
at membrane.skia$load_font.invokeStatic(skia.clj:946)
at membrane.skia$load_font.invoke(skia.clj:942)
at membrane.skia$get_font.invokeStatic(skia.clj:407)
at membrane.skia$get_font.invoke(skia.clj:389)
at membrane.skia.LabelRaw._bounds(skia.clj:430)
at membrane.ui$fn__10050.invokeStatic(ui.cljc:263)
at membrane.ui$fn__10050.invoke(ui.cljc:263)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$memoize$fn__6877.doInvoke(core.clj:6353)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at membrane.skia$cached_draw.invokeStatic(skia.clj:964)
at membrane.skia$cached_draw.invoke(skia.clj:954)
at membrane.skia.Cached.draw(skia.clj:1001)
at membrane.skia$eval12458$fn__12464.invoke(skia.clj:451)
at membrane.skia$eval12188$fn__12189$G__12179__12194.invoke(skia.clj:87)
at membrane.skia.GlfwSkiaWindow$fn__13145.invoke(skia.clj:1564)
at membrane.skia.GlfwSkiaWindow.repaint_BANG_(skia.clj:1553)
at membrane.skia$_window_refresh_callback.invokeStatic(skia.clj:1111)
at membrane.skia$_window_refresh_callback.invoke(skia.clj:1110)
at membrane.skia.WindowRefreshCallback$fn__12946.invoke(skia.clj:1124)
at membrane.skia.WindowRefreshCallback.callback(skia.clj:1120)
at com.sun.jna.Native.invokeVoid(Native Method)
at com.sun.jna.Function.invoke(Function.java:414)
at com.sun.jna.Function.invoke(Function.java:360)
at com.sun.jna.Function.invoke(Function.java:314)
at com.sun.jna.Function.invoke(Function.java:305)
at membrane.skia$run_helper$wait__13198.invoke(skia.clj:1689)
at membrane.skia$run_helper.invokeStatic(skia.clj:1708)
at membrane.skia$run_helper.invoke(skia.clj:1671)
at membrane.skia$run_sync$fn__13186.invoke(skia.clj:1621)
at membrane.skia$dispatch_sync_BANG_$fn__12705.invoke(skia.clj:799)
at membrane.skia$dispatch_sync_BANG_.invokeStatic(skia.clj:791)
at membrane.skia$dispatch_sync_BANG_.invoke(skia.clj:790)
at membrane.skia$run_sync.invokeStatic(skia.clj:1618)
at membrane.skia$run_sync.invoke(skia.clj:1571)
at membrane.skia$run_sync.invokeStatic(skia.clj:1605)
at membrane.skia$run_sync.invoke(skia.clj:1571)
at prova$run.invokeStatic(prova.clj:21)
at prova$run.invoke(prova.clj:19)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.core$apply.invoke(core.clj:660)
at clojure.run.exec$exec.invokeStatic(exec.clj:37)
at clojure.run.exec$exec.doInvoke(exec.clj:32)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at clojure.run.exec$_main.invokeStatic(exec.clj:147)
at clojure.run.exec$_main.doInvoke(exec.clj:137)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.core$apply.invokeStatic(core.clj:665)
at clojure.main$main_opt.invokeStatic(main.clj:514)
at clojure.main$main_opt.invoke(main.clj:510)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Execution error (AssertionError) at membrane.skia/load-font (skia.clj:946).
Assert failed: unable to load font: 14
font-ptr
I'm using the version indicated in the tutorial: com.phronemophobic/membrane {:mvn/version "0.9.14-beta"}
ah ok. I'm seeing the same error. I think the issue is that I just forgot to update the linux build for this version. i'm rebuilding right now!
thank you! I'll give it a try as soon as it's rebuilt
ok, just uploaded [com.phronemophobic/membrane "0.9.15-beta"]
which doesn't appear to throw the same error on my ubuntu vm. (it's using a different version, but it's hopefully close enough š¤)
it works now, thanks! for some reason I can't run this with cider-jack-in, but if it works when launching from a terminal I guess I can cider-connect
ok, I was finally able to investigate no window appearing when using cider-jack-in
but I'm unable to reproduce
@euccastro, can you share a few more details about your setup? how are you running emacs?
I'm running spacemacs develop. cider-version
gives me CIDER 1.0.0snapshot (package: <tel:202010201058|20201020.1058>)
, which seems odd
are you running emacs in the terminal, or the emacs app?
emacs app
ok, iām not sure how much that should matter since i think cider jack in starts a new process. iām using java 8 to test on linux. let me upgrade to java 11 and try that
I have to go to sleep now, but tomorrow I'll actually try this with a cider-connect
ed nREPL, which I haven't done yet. I just launched a minimal test program with clojure
and that worked
ha, I couldn't reproduce it in my desktop computer, which is running the same Ubuntu and cider version. I'm not with my laptop atm, but this may be more of an obscure corner case than it seemed..
some cider middleware has different versions for some reason, but the latest is the one that works
does it just hang when you use cider jack in? or is there an error?
run-sync hangs
it should hang until the window is closed
run returns the channel and nothing else happens
no window opens in either case
but if I run it from the terminal I do get a window
well, that's with run-sync. if I call run from the terminal I get no window (or maybe it gets created but the program exits before it gets a chance to show up)
ok. that's a bummer. I'll write up an issue so I can make sure to look into it
now, if I wait on a promise that gets delivered when the channel that run
return closes, I do get a window
I've filed the issue at https://github.com/phronmophobic/membrane/issues/6 if you find any other info.
it's getting pretty late here, but if you run into any issues or goofiness, I'm absolutely looking for feedback. I'll try to look into the cider-jack-in
issue tomorrow.