This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-21
Channels
- # announcements (4)
- # architecture (161)
- # autochrome-github (7)
- # babashka (61)
- # beginners (42)
- # calva (24)
- # cider (22)
- # clj-kondo (28)
- # cljs-dev (8)
- # clojure (88)
- # clojure-art (2)
- # clojure-dev (7)
- # clojure-europe (43)
- # clojure-germany (2)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (32)
- # core-async (41)
- # cursive (32)
- # datahike (6)
- # datomic (9)
- # emacs (22)
- # events (2)
- # fulcro (10)
- # graphql (1)
- # nextjournal (16)
- # off-topic (9)
- # overtone (1)
- # pathom (16)
- # polylith (5)
- # quil (7)
- # rdf (1)
- # re-frame (7)
- # reagent (22)
- # releases (2)
- # remote-jobs (1)
- # reveal (12)
- # sci (1)
- # shadow-cljs (12)
- # specter (20)
- # sql (6)
- # tools-deps (21)
- # vim (26)
- # xtdb (10)
I am trying to package bb I have just packaged jet and clj-kondo but running script/uberjar in the repo gives me an error.
Execution error (FileNotFoundException) at babashka.impl.xml/eval181$loading (xml.clj:1).
Could not locate sci/core__init.class, sci/core.clj or sci/core.cljc on classpath.
Is there some prerequisit I am missing I woul have expected lein to pull sci ?
ah that may complicate things using the tar.gz release at present will have to do a bit of research to see if thats a thing in the context of a build
building linux packages basically, they usesually want a source release which you checkout and build from
I think it can use git directly, just need to find out if I can pull the submodules as part of that
yeah I am doing a bit of googling https://dev.getsol.us/D12925 thats for clj-kondo you specify a source location to fetch from
cheers for the help earlier, with a bit of luck babashka should pop up in solus this week along with jet and clj-kondo 🙂
I think this self-contained executable approach could also work for babashka: https://www.youtube.com/watch?v=JRwxx2jc2zU&t=1186s&ab_channel=LeandroFacchinetti You would package babashka itself + your project in its own executable and then you could deploy it. The author is using a golang stub and a tarball of the project which extracts itself at runtime to implement it.
Oh, it already works! https://github.com/leafac/caxa/issues/44#issuecomment-1046879087
Documented producing a self-contained executable on the wiki: https://github.com/babashka/babashka/wiki/Self-contained-executable
Hello, there. First thanks a lot for your work! it's awesome. I have a log file already there, and the two processes below should append to that log file. I try to launch some long living processes which should append to an existing (log) file (so I'd like them non blocking). I found no way to do that. Thanks in advance
(p/process ["npm" "install"]
{:out :inherit :err :inherit :dir "app"})
(p/process ["npx" "shadow-cljs" "watch" "app2"]
{:out :inherit :err :inherit :dir "app2"}))
@U018QDQGZ9Q :inherit
means that the stream is written to the output stream of the babashka process. You can use (io/file "output.txt")
instead to write the output to a file.
I got this, but with`io/file`, I found no append
option. I tried the example below and it did not work, I only have the last file output in it. Moreover, I'd like to append to an existing file:
(let [f (io/file "output.txt")]
(p/process ["npx" "shadow-cljs" "watch" "app"]
{:out f :err :inherit :dir "app"})
(p/process ["npx" "shadow-cljs" "watch" "app"]
{:out f :err :inherit :dir "app"}))
ah I got it. let me figure out a workaround. We should really add an option for this in process.
@U018QDQGZ9Q A workaround:
(doto (:pb (p/pb ["npx" "shadow-cljs" "watch" "app"]
{:err :inherit :dir "app"}))
(.redirectOutput
(java.lang.ProcessBuilder$Redirect/appendTo
(io/file "/tmp/log.txt")))
(.start))
@U018QDQGZ9Q in babashka 0.7.6 (just released) you can now do this: https://github.com/babashka/process#redirecting-output-to-a-file
https://replit.com/@eccentric-j/Babashka-Clojure?v=1 Nothing came up when searching for Babashka so hopefully this fixes that 😅 Going to make an nbb one too.
Yeah was able to use it as the base box, added babashka, clojure-lsp, and copied a bit of config for the .replit from the main clojure one
have not published yet. https://replit.com/@eccentric-j/Node-Babashka-Template#package.json looks like nbb may be a bit trickier. Seems it has some custom interpreter support with their prybar library https://github.com/replit/prybar might have to try an upstream pr. Looking through the node one to see if it can be customized to run nbb at all
Thinking I'll go for the naive get-it-done approach to make it similar to the babashka one. Then can support these other features later or someone can fork it and go for it.
It's more that the node replit template supports a debugger and instead of running a command, runs an interactive console interpreter
But the interpreter seems like it's mostly suited for running the languages hard-coded into that repo like prybar-clojure or prybar-nodejs https://github.com/replit/prybar/tree/master/languages
Given the clojure one, doesn't look like it would be too bad to create a PR to add languages/bb or languages/nbb but that's a bit more than I can take on atm so will set up the replit to run a nbb hello-world script like similar to the bb script, at least it will be consistent
https://replit.com/@eccentric-j/Node-Babashka-Template#src/cli/core.cljs have not published it yet but the nbb repl is working
even this worked!
cli.core=> (range)
^C"Error: Script execution was interrupted by `SIGINT`"
cli.core=>
I think I like this approach of running the repl from within the main for these. This way if you just want to start trying out some cljs then there's the repl, and if you wanted to make a script of some kind they can comment it out and start writing as they're already in the defn main
https://replit.com/@eccentric-j/Node-Babashka-ClojureScript-Template renamed to be more consistent with the babashka one
Should be embeddable https://docs.replit.com/hosting/embedding-repls in the readmes
Hello, I'm currently looking into porting a fairly complex bash project to babashka, is there a way to implement sort of a plugin system with bashbaska? Which plugin (namespace?) to load would be determined by a passed arg, ideally users can add their own plugins via secondary class path.
Great. I got a little prototype that looks promising, except for the dynamic require. Any hints on how to approach this?
If you can share your prototype and where you are stuck, that would be easier to say something about. I'm sure there is a solution
(require (symbol (first *command-line-args*)))
Tried that, it ran but I didn't get the test output from the plugin. After your comment I put a println
directly in the plugin ns which confirmed the ns was actually loaded. 🙈 Turns out the problem was that I tried to execute the function symbol directly which always returned nil
. After a bit of googling using Thank you for the awesome project btw, so nice to have Clojure on the shell. ❤️
cool! there is also a combination of require + resolve which is called requiring-resolve
Neat!