Fork me on GitHub
Adam Helins08:10:03

What's going on with babashka.process/process and windows? In Github Action on windows-latest, the clojure command is suddenly not available anymore when invoked with bb.process/process. (note: I need to spawn clojure in a new JVM process)


I’m trying to type an answer on my phone but this is horrible. I’ll be at the kbd in 15 minutes ;)

👌 1

This is unlikely a problem with bb, but more a problem with shelling out to Clojure on Windows due to the launcher being built in Powershell (see long discussions on this in #clj-on-windows .Are you using setup-clojure or so?

Adam Helins08:10:45

Yes, setup-clojure indeed


You can also use:

(clojure "-X:foo")
in bb.edn which comes from babashka.tasks or:
@(babashka.deps/clojure ["-X:foo"] {:inherit true})
from babashka.deps


Setup-clojure has a workaround for this as well, let me look it up


cmd-exe-workaround: 'latest' # Replaces `clojure` with `deps.clj` on Windows


If you use that, shelling out to clojure should just work

Adam Helins08:10:32

Naively I would have thought that bb.process/process would shell out to pwsh as well and things would just work


process never shells out to shell-specific stuff

Adam Helins08:10:52

Ah, let me try cmd-exe... again then, maybe I didn't do it right

Adam Helins08:10:47

No unfortunately it doesn't change anything 😞


can you try (babashka.tasks/clojure "-X:foo") then?


or are you using process from the JVM?

Adam Helins09:10:51

That does work actually. But indeed, I switched to process to make the whole thing JVM-friendly


Well, perhaps on Windows (you can check with fs/windows?) you can shell out to powershell explicitly, but in #CFN4QDHPS we're discussing options to move away from powershell


I guess we could also expose babashka.tasks/clojure as a JVM lib


didn't we discuss that before?

Adam Helins09:10:47

Indeed Eventually I found using process was overall more flexible for my needs so I didn't pursue the idea.

Adam Helins09:10:27

Yeah I don't have a windows machine so my opinion is very limited but so far I've met only pain trying to run all that on windows-latest 😅 Moving away from pwsh sounds like a good idea.


I think (?) setup-clojure deps.exe might be in a bit of at the moment


Hi there, I have built an uberscript with babashka and I am trying to run it on a machine without git I get Error building classpath. Cannot run program "git": error=2, No such file or directory How can I skip building the classpath given everything is already bundled in there?


Building an uberjar seems to be the way to go


@U0C8489U6 Why would the uberscript download anything? Because there is also an bb.edn in the directory?


You can bypass that with bb --config nil


Or run from a directory without bb.edn


oh sounds great, that is what I was expecting, I'll try and run from a dir with no bb.edn


this indeed ran without using git (and maybe even java outside the folder where bb.edn was


solved! Thank you!

🎉 2