This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-29
Channels
- # announcements (4)
- # babashka (38)
- # beginners (66)
- # calva (35)
- # cider (3)
- # clj-on-windows (19)
- # cljs-dev (2)
- # clojure (29)
- # clojure-europe (15)
- # clojure-norway (2)
- # clojurescript (43)
- # clr (7)
- # community-development (6)
- # events (3)
- # hoplon (5)
- # lsp (23)
- # malli (7)
- # matrix (9)
- # nbb (53)
- # off-topic (5)
- # overtone (1)
- # practicalli (2)
- # re-frame (6)
- # reagent (17)
- # reitit (11)
- # specter (5)
- # tools-build (7)
- # xtdb (22)
Hi there, new to BB: what's the canonical way to "exit with failure"?
i.e. exit the script immediately and yield an error code of 1
Thanks!
Let's see if that barfs a trace too... :thinking_face:
Ah it doesn't! Lovely
Looks like cider-debug-defun-at-point
doesn't work when connected to a BB nrepl?
The bb nREPL doesn't support all of CIDER. What you can do alternatively is to use print-deps
to create a deps.edn, develop using your normal Clojure tools and then run with bb again
Ah ha right
Thank you!
bb nrepl-server
is at least handy for making sure everything is built-in and "just works"
Also no project structure necessary
hey! has anyone else had a go at writing webpages in shared hosts based on @jayzawrotny post https://eccentric-j.com/blog/clojure-like-its-php.html
I have a php hosted project I’ve been meaning to try it out, but haven’t yet. There’s also these docs. https://blog.michielborkent.nl/using-babashka-with-php.html https://github.com/borkdude/blog/discussions/21 https://gist.github.com/borkdude/843548cba14ae9d283191e31bc483959
That reminds me there’s some aspects of borkdude’s example I like better, like the way it uses a php script to dispatch to babashka over cgi. The cgi approach works but debugging it is not as straight forward
@jayzawrotny are you using your solution actively? Any big takeaways or tradeoffs to note after a few years experience?
Been keeping busy with other projects in the cljs and nbb space as I generally like the npm\node ecosystem. It has been great for quick prototypes though when I need a backend really quick but don’t want to setup a running app with ring
Trade offs are mostly performance and debugging, but the php wrapper borkdude came up with makes that part better
@U09D96P9B I implemented this based on @jayzawrotny blog post last year and has been running stress free.
@U0KKRRLCB Did you have a link?
actually just pushed a contact form with htmx and I'm quite happy with the was I was able to reuse "frontend" hiccup in the rendered response from the server. almost felt like a component abstraction
Nice. Refactoring a basic PHP contact form (without knowing PHP!) was my first potential use case.
hello, I'm trying to follow the setup described here: https://github.com/babashka/babashka/issues/733#issue-811939787, but when I run this script with babashka I get the following error (in 🧵 )
wilker.lucio@wilker script % bb bbcp.clj
Error building classpath. Local lib babashka/babashka.core not found: /Users/wilker.lucio/script/babashka.core
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message:
Data: {:proc #object[java.lang.ProcessImpl 0x18d576bb "Process[pid=69139, exitValue=1]"], :exit 1, :in #object[java.lang.ProcessBuilder$NullOutputStream 0x51ce0f42 "java.lang.ProcessBuilder$NullOutputStream@51ce0f42"], :out #object[java.lang.ProcessImpl$ProcessPipeInputStream 0x7181ac7a "java.lang.ProcessImpl$ProcessPipeInputStream@7181ac7a"], :err #object[java.lang.ProcessBuilder$NullInputStream 0x271997af "java.lang.ProcessBuilder$NullInputStream@271997af"], :prev nil, :cmd ["/usr/bin/java" "-XX:-OmitStackTraceInFastThrow" "-classpath" "/Users/wilker.lucio/.deps.clj/1.11.1.1273/ClojureTools/clojure-tools-1.11.1.1273.jar" "clojure.main" "-m" "clojure.tools.deps.script.make-classpath2" "--config-user" "/Users/wilker.lucio/.clojure/deps.edn" "--config-project" "deps.edn" "--basis-file" "/Users/wilker.lucio/.clojure/.cpcache/FE7218DAF1D4CA40D578DF03FDE86C4F.basis" "--cp-file" "/Users/wilker.lucio/.clojure/.cpcache/FE7218DAF1D4CA40D578DF03FDE86C4F.cp" "--jvm-file" "/Users/wilker.lucio/.clojure/.cpcache/FE7218DAF1D4CA40D578DF03FDE86C4F.jvm" "--main-file" "/Users/wilker.lucio/.clojure/.cpcache/FE7218DAF1D4CA40D578DF03FDE86C4F.main" "--manifest-file" "/Users/wilker.lucio/.clojure/.cpcache/FE7218DAF1D4CA40D578DF03FDE86C4F.manifest" "--config-data" "{:deps {selmer/selmer {:mvn/version \"1.12.50\"}, org.clojure/clojure {:mvn/version \"1.11.1\"}, org.clojure/tools.logging {:mvn/version \"1.1.0\"}, insn/insn {:mvn/version \"0.5.2\"}, org.clojure/tools.cli {:mvn/version \"1.0.214\"}, borkdude/graal.locking {:mvn/version \"0.0.2\"}, rewrite-clj/rewrite-clj {:mvn/version \"1.1.46\"}, babashka/babashka.core {:local/root \"babashka.core\"}, org.flatland/ordered {:mvn/version \"1.5.9\"}, org.postgresql/postgresql {:mvn/version \"42.2.18\"}, babashka/clojure-lanterna {:mvn/version \"0.9.8-SNAPSHOT\"}, org.babashka/babashka.impl.java {:mvn/version \"0.1.8\"}, hiccup/hiccup {:mvn/version \"2.0.0-alpha2\"}, org.babashka/cli {:mvn/version \"0.7.51\"}, seancorfield/next.jdbc {:mvn/version \"1.1.610\"}, org.clojure/data.xml {:mvn/version \"0.2.0-alpha8\"}, org.clojure/data.csv {:mvn/version \"1.0.0\"}, com.taoensso/timbre {:mvn/version \"6.0.1\"}, com.cognitect/transit-clj {:mvn/version \"1.0.333\"}, babashka/babashka.curl {:mvn/version \"0.0.3\"}, clj-commons/clj-yaml {:mvn/version \"1.0.26\"}, org.clojure/core.rrb-vector {:mvn/version \"0.1.2\"}, org.babashka/sci.impl.types {:mvn/version \"0.0.2\"}, cheshire/cheshire {:mvn/version \"5.11.0\"}, org.clojure/core.match {:mvn/version \"1.0.0\"}, org.babashka/sci {:local/root \"sci\"}, datascript/datascript {:mvn/version \"1.0.1\"}, org.babashka/http-client {:mvn/version \"0.3.11\"}, org.hsqldb/hsqldb {:mvn/version \"2.5.1\"}, org.clojure/test.check {:mvn/version \"1.1.1\"}, babashka/fs {:mvn/version \"0.0.5\"}, org.clojure/data.priority-map {:mvn/version \"1.1.0\"}, nrepl/bencode {:mvn/version \"1.1.0\"}, org.clojure/core.async {:mvn/version \"1.6.673\"}, http-kit/http-kit {:mvn/version \"2.6.0-RC1\"}}}"], :type :babashka.process/error}
Location: /Users/wilker.lucio/script/bbcp.clj:14:24
----- Context ------------------------------------------------------------------
10: 'babashka/babashka.curl {:mvn/version "0.0.3"})
11: deps (update deps :deps dissoc 'borkdude/sci)
12: deps {:deps (:deps deps)}
13: ;; _ (clojure.pprint/pprint deps)
14: cp (with-out-str (deps/clojure ["-Spath" "-Sdeps" deps]))]
^---
15: (println cp))
----- Stack trace --------------------------------------------------------------
babashka.process/check - <built-in>
babashka.process/shell - <built-in>
clojure.core/apply - <built-in>
babashka.impl.process/shell - <built-in>
babashka.deps/clojure/fn--6019 - <built-in>
borkdude.deps/-main - <built-in>
clojure.core/apply - <built-in>
babashka.deps/clojure - <built-in>
user - /Users/wilker.lucio/script/bbcp.clj:14:24
user - /Users/wilker.lucio/script/bbcp.clj:7:1
what am I doing wrong?
@U066U8JQJ This workaround should not be necessary at all anymore for bb + lsp. Just a bb.edn
should be sufficient
ah, nice!
gonna try that 🙂
also got it working fine here 😄
maybe its worth updating that comment? because that was the link I've found when I googled for clojure lsp babashka dev
add, but still think editing the main one will have a better result, because its already an edited content pointing to the workaround solution