Fork me on GitHub
#babashka
<
2023-04-04
>
mjhika18:04:30

has anyone had any success with babashka and caxa on windows when trying to supply a jar for the classpath? i know this isn't a babashka issue, but an issue with quoting on windows and caxa. I've tried passing different kinds of quotes but i've been unsuccessful so far. my output looks something like this if I try to invoke the -main fn directly but if I attempt to use -cp or --classpath to supply deps.jar then i get a caxa error because those aren't valid options for caxa.

PS C:\Users\user\Documents\bootstrap-agent> caxa --input . --output foo.exe -- "{{caxa}}/bb.exe" "-m" "bootstrapper.main"
PS C:\Users\user\Documents\bootstrap-agent> .\foo.exe
bootstrapper.main
Babashka v1.3.176 REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=>
the error output when trying to supply the deps.jar
PS C:\Users\user\Documents\bootstrap-agent> caxa --input . --output foo.exe -- "{{caxa}}/bb.exe" "-cp" "{{caxa}}/deps.jar" "-m" "bootstrapper.main"
error: unknown option '-cp'

Usage: caxa [options] <command...>
...
output should look like this
PS C:\Users\user\Documents\bootstrap-agent> bb -cp deps.jar -m bootstrapper.main
> Filter...
ā€¢ ABC
  XYZ
I'm able to get this working with no issue on macos but not for windows. there is one dep and that's lispycloud's gum wrapper library, bblgum

borkdude18:04:18

Instead of -cp deps.jar -m bootstrapper.main you could also build an uberjar with all the deps and set bootstrapper.main as the main method of the uberjar. Then you can invoke it with: bb uber.jar directly

borkdude18:04:30

Perhaps this also helps you with the quoting issue, not sure

borkdude19:04:03

You can build the uberjar with bb uberjar foo.jar -m bootstrapper.main

borkdude19:04:02

Note that when you use --input . you will also include previous versions of the caxa executable so you may need to clean up stuff before doing so

mjhika19:04:43

Mmm okay I'll give this a shot. That's for the tip. I'll let you know

mjhika19:04:51

wow easy fix!. Thanks for that šŸ™‚

šŸ‘ 2