This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-24
Channels
- # announcements (6)
- # babashka (25)
- # beginners (52)
- # cherry (8)
- # cider (9)
- # clj-kondo (9)
- # clojure (44)
- # clojure-australia (5)
- # clojure-dev (4)
- # clojure-europe (8)
- # clojure-nl (5)
- # clojure-norway (3)
- # clojure-spec (3)
- # clojure-uk (1)
- # clojurescript (16)
- # conjure (1)
- # core-async (8)
- # cursive (11)
- # fulcro (13)
- # honeysql (6)
- # hyperfiddle (13)
- # jackdaw (1)
- # jobs (9)
- # lsp (13)
- # meander (5)
- # missionary (2)
- # off-topic (11)
- # polylith (11)
- # re-frame (2)
- # reitit (11)
- # shadow-cljs (69)
- # squint (23)
- # tools-deps (30)
- # xtdb (3)
If I run rsvg-convert icon.svg -w 60 -h 60 > icon.png
in the terminal it works fine, but in Babashka using (println @(babashka.process/sh "rsvg-convert icon.svg -w 60 -h 60 > icon.png"))
I get:
$ ./convert.clj
{:proc #object[java.lang.ProcessImpl 0x6354d321 Process[pid=93508, exitValue=1]], :exit 1, :in #object[java.lang.ProcessImpl$ProcessPipeOutputStream 0x759aca59 java.lang.ProcessImpl$ProcessPipeOutputStream@759aca59], :out , :err Multiple SVG files are only allowed for PDF and (E)PS output.
, :prev nil, :cmd [rsvg-convert icon.svg -w 60 -h 60 > icon.png]}
So somehow it sees multiple SVG files as input. Any ideas how to escape properly?Thanks, I see, this is the signature for rsvg-convert
, is there a way to mimick th behaviour of >
?
amazing thanks, I’ll give it a shot
Maybe it’s the >
?
hi, I probably found minor bug but wanted to consult it:
if you look into the result of babashka.tasks/shell
you will bump into something like following map:
{:proc ,,,
:exit 0,
:in
#object[java.lang.ProcessBuilder$NullOutputStream 0x38a945bb "java.lang.ProcessBuilder$NullOutputStream@38a945bb"],
:out
#object[java.lang.ProcessBuilder$NullInputStream 0x84675d3 "java.lang.ProcessBuilder$NullInputStream@84675d3"],
:err ,,,
:prev ,,,
:cmd ,,,}
and if you look closely :in
has NullOutputStream and :out
has NullInputStream. Shouldn't they be the other way around?what helps me is thinking of this as a handle which you get back. to write to it you would send to the stdin of the process but to write you need an outpustream. same the other way round when you wanna read from it
you can only read from an inputstream but its the stdout of the process. hence the confusion i guess
Q: When I see an exception, it seems to omit a lot of relevant stack ... (stacktrace omitted) There's a bunch of stack frames between impl/dispatch and process/check. Is there anything weird about invoking a Var rather than a function that could cause this? (dispatch is passed a map of name to Var, chooses one, then invokes the Var ... perhaps a deref there would help?).
Would you mind moving the stacktrace from the channel to a gist in order to not "flood" the channel? I'll get back to your question when I'm properly awake tomorrow ;)
so, how stacktrace (currently) works in SCI is every call location is recorded in a nested try/catch at analysis time and when an exception happens, this try/catch is unwinded. but this only works for calls that can be statically seen
So for example:
(defn foo []
(/ 1 0))
(defn bar []
(foo))
(bar)
gives:
clojure.core// - <built-in>
user/foo - /tmp/dude.clj:2:3
user/foo - /tmp/dude.clj:1:1
user/bar - /tmp/dude.clj:5:3
user/bar - /tmp/dude.clj:4:1
user - /tmp/dude.clj:7:1