Fork me on GitHub
#babashka
<
2021-02-12
>
solf06:02:49

It seems I stumbled upon a bug: when using babashka as an nrepl server, printing something will correctly send the output to the nrepl client, however printing something inside something lazy-evaluated will instead send the result to babashka process itself:

solf06:02:54

I created an issue in babashka/nrepl

borkdude13:02:27

fixed on master

borkdude13:02:30

thanks for reporting

solf09:02:53

Great, thanks!

martinklepsch14:02:40

I’m running into a strange issue where a var can’t be found in a required namespace but when running that namespace directly, things are fine:

bb -cp bb-src -m mkl.atom
clojure.lang.ExceptionInfo: Could not resolve symbol: posts/sort-posts [at /Users/martinklepsch/code/03-personal/martinklepsch.org/bb-src/mkl/view.clj, line 197, column 16]

bb -cp bb-src -m mkl.view
; => works fine

martinklepsch14:02:12

note how the error occurs in view.clj but then running mkl.view is doing just fine

borkdude14:02:22

can I test this locally somehow?

martinklepsch14:02:39

yes, I can push it

borkdude14:02:09

hmm, if I add a (prn (resolve 'mkl.posts/sort-posts)) in the mkl.view namespace then I get nil when invoking that through -m mkl.atom :/

borkdude14:02:16

and when I put a side effect in the mkl.posts ns I don't see it, so it seems it's not getting loaded somehow

martinklepsch14:02:18

yeah that matches what I’ve seen. I’ve observed something similar when loading these namespaces through the REPL as well but initially discarded it as flakyness in one of the intermediate layers

borkdude15:02:52

I'll take a deeper looking after the meeting I'm having

martinklepsch15:02:17

cool, no rush. Interestingly when deleting the :require mkl.view from the mkl.atom namespace it still fails with the same error

borkdude15:02:53

@U050TNB9F I think I found it. I think you have a circular reference

borkdude15:02:10

mkv.view requires mkv.posts and vice versa

borkdude15:02:19

of course sci could give a better error here

borkdude15:02:08

Removing [mkl.view] from mkl.posts did the trick

borkdude16:02:19

Thanks for sponsoring :)

❤️ 3
borkdude16:02:18

Babashka master now detects cyclic load dependencies.

thumbsup_all 9