Fork me on GitHub
#membrane
<
2020-11-17
>
euccastro08:11:39

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"]

euccastro08:11:52

I tried to clojure.core.async/take! from that channel and my callback never gets called

phronmophobic08:11:37

the channel should close when the all the windows are closed

phronmophobic08:11:47

hmmm, it seems like it should display an error if nothing happens

phronmophobic08:11:19

can you try using run-sync instead of run? (skia/run-sync #(ui/label "Hello world!"))

phronmophobic08:11:47

just to double check, which version of membrane are you using?

euccastro09:11:40

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

euccastro09:11:30

I'm using the version indicated in the tutorial: com.phronemophobic/membrane {:mvn/version "0.9.14-beta"}

phronmophobic09:11:44

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!

euccastro09:11:20

thank you! I'll give it a try as soon as it's rebuilt

šŸŽ‰ 3
phronmophobic09:11:09

ok, just uploaded [com.phronemophobic/membrane "0.9.15-beta"]

phronmophobic09:11:35

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 šŸ¤ž)

euccastro09:11:27

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

phronmophobic03:11:54

ok, I was finally able to investigate no window appearing when using cider-jack-in but I'm unable to reproduce

phronmophobic03:11:48

@U65FN6WL9, can you share a few more details about your setup? how are you running emacs?

euccastro03:11:45

I'm running spacemacs develop. cider-version gives me CIDER 1.0.0snapshot (package: ), which seems odd

phronmophobic03:11:00

are you running emacs in the terminal, or the emacs app?

phronmophobic03:11:16

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

euccastro03:11:19

I have to go to sleep now, but tomorrow I'll actually try this with a cider-connected nREPL, which I haven't done yet. I just launched a minimal test program with clojure and that worked

šŸ‘ 3
euccastro05:11:44

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..

euccastro05:11:24

some cider middleware has different versions for some reason, but the latest is the one that works

phronmophobic09:11:04

does it just hang when you use cider jack in? or is there an error?

euccastro09:11:15

run-sync hangs

phronmophobic09:11:27

it should hang until the window is closed

euccastro09:11:34

run returns the channel and nothing else happens

euccastro09:11:41

no window opens in either case

euccastro09:11:50

but if I run it from the terminal I do get a window

euccastro09:11:35

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)

phronmophobic09:11:36

ok. that's a bummer. I'll write up an issue so I can make sure to look into it

euccastro09:11:07

now, if I wait on a promise that gets delivered when the channel that run return closes, I do get a window

phronmophobic09:11:40

that makes sense if you're running from the terminal as run won't prevent the jvm from exiting. come to think of it, run-async might be a better name.

šŸ‘ 3
phronmophobic09:11:28

I've filed the issue at https://github.com/phronmophobic/membrane/issues/6 if you find any other info.

phronmophobic09:11:40

that makes sense if you're running from the terminal as run won't prevent the jvm from exiting. come to think of it, run-async might be a better name.

šŸ‘ 3
phronmophobic10:11:03

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.

thanks2 3