It won’t work for me. I can see ‘bb’ in the ‘connect to repl’ prompt but the port is still empty after localhost: The .bb-nrepl-port is created fine with 1667 port in it. @pez
Got slingshot working: https://github.com/babashka/babashka/blob/master/doc/projects.md#slingshot Also added its test suite to CI. Only one test is failing due to a difference how to records are implemented in bb, but it seems to be a corner case that is hopefully not used a lot (catching by record names). With some effort that may also be fixable. cc @scgilardi
And you are selecting bb, not just seeing it?
Also, which directory are you starting babashka in?
Yes, selecting. BB starts in the root dir or the project, where the repl file is.
Restarted VSC just in case
I now tried this on my Windows machine, and it just works there as well… Please file an issue about this using the Help menu in vscode. Attach the setting and the command line you are using.
@suskeyhose I've got dosync
etc working. I'm also looking into .wait
and .notify
: this does work if you use an ^Object
type hint, so you could try that as a workaround meanwhile.
I also made this GraalVM issue: https://github.com/oracle/graal/discussions/3456
If you want to try a binary with dosync
etc, let me know your OS
Hi. I'm trying to find an example on how to print UTC datetime strings in ISO-8601 format. I can't find any reference to Java datetime libraries in babashka book. Can some provide any reference please?
@ory.band The java.time
package is available in bb
Here is an example: https://github.com/babashka/babashka/blob/master/examples/pst.clj
I'm trying out babashka tasks, and I'm looking to re-use a babashka script that I was arleady using before tasks.
I'd like to create a task that calls this script, what's the preferred method for doing this?
* (shell "bb script.clj")
* (load-file "script.clj")
* other?
I've seen both of those approaches work. At first, I thought I should be require
'ing this script but idk how I would go about that.
@jvtrigueros load-file
is somewhat cheaper than invoking bb another time, but both should work. You could also add your script to the classpath e.g. by moving it to script/script.clj
and then adding "script"
to :paths
in your bb.edn
. Beware of side effects in your scripts in that case
I'll give that a shot! I'm currently using load-file, but using it as a library is what I'd prefer. Thank you!
Worked beautifully!
$ clojure -J-Dorg.eclipse.jetty.LEVEL=INFO
Clojure 1.10.3
user=> (System/getProperty "org.eclipse.jetty.LEVEL")
"INFO"
user=>
$ bb clojure -J-Dorg.eclipse.jetty.LEVEL=INFO
Unrecognized option: -
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
@danie Released 0.4.5 with the fix now
Thank you 😊
Am I missing something obvious?
Looks like a bug...
Feel free to post an issue
I found the issue
Awesome, I'll give it a try today.
thanks!
I'm using nixos
ok, then the static linux binary probably works for you: https://19891-201467090-gh.circle-artifacts.com/0/release/babashka-0.4.5-SNAPSHOT-linux-amd64-static.tar.gz
Step away from keyboard, come back to answers, thanks @borkdude 😊
Pushed a fix. https://github.com/borkdude/deps.clj/issues/46 Which OS are you using? I can provide you with a new binary until the new release
Or check yourself in #babashka-circleci-builds (should be there in a few minutes)
@borkdude the commute
and alter
functions would be great to have too. I know farolero uses at least alter
. I'll get to actually testing it once my workday is done.
I already added alter
. Adding commute
now as well.
Thanks
I'm wrapping up my first real project, and the only thing left is that I'm invoking my main function incorrectly. (Details in 🧵)
111🎉2✅$ pwd
/Users/tomhenderson/lg/logicgate/docker-new/scripts/e2e/dd-junit
$ tree -L 3
.
├── bb.edn
├── repl
│ ├── individual_failures.clj
│ └── playground.clj
└── src
└── dd-junit
├── core.clj
├── datafy.clj
└── statsd_client.clj
$ cat bb.edn
{:paths ["src/dd-junit", "repl"]}
$ cat src/dd-junit/core.clj
(ns dd-junit.core
(:require [dd-junit.statsd-client :as statsd]
[dd-junit.datafy :as datafy]
[<http://clojure.java.io|clojure.java.io> :as io]))
...
(defn -main [& args]
(let [junit-path (first args)
user-tags (rest args)]
(doseq [item (prepare-messages junit-path user-tags)]
(println item)
(statsd/send-msg item))))
$ bb -m dd-junit.core
----- Error --------------------------------------------------------------------
Type: java.lang.Exception
Message: Could not find namespace: dd-junit.core.
Location: 1:10
----- Stack trace --------------------------------------------------------------
- <expr>:1:10
Individually, the 3 namespaces I'm using all evaluate w/o error
(earlier i had just "src", "repl" in :path, but the effect was the same)
perhaps the folder needs to be named src/dd_junit instead of src/dd-junit (underscore vs. dash)
and then :paths as "src" and "repl" like you had before
omg i bet that's it, it's always it
and i never remember why lol
YEP, thanks