Fork me on GitHub
#babashka
<
2023-04-17
>
hifumi12307:04:18

In building babashka, I see the following reports in my terminal

Warning: profile :feature/xml not found.
Warning: profile :feature/yaml not found.
Warning: profile :feature/csv not found.
Warning: profile :feature/transit not found.
Warning: profile :feature/httpkit-client not found.
Warning: profile :feature/httpkit-server not found.
Warning: profile :feature/core-match not found.
Warning: profile :feature/hiccup not found.
Warning: profile :feature/test-check not found.
Warning: profile :feature/selmer not found.
Warning: profile :feature/logging not found.
Warning: profile :feature/priority-map not found.
Should I worry about this? I did nothing more than ./script/uberjar and ./script/compile

borkdude07:04:06

Nothing to worry about, that's what I see too

2
borkdude09:04:34

The first ever #CLX41ASCS conf is happening on June 10th 2023 in Berlin. CfP is now open: https://babashka.org/conf/

๐Ÿ’ฏ 12
nice 6
4
babashka 6
tatut09:04:57

thatโ€™s awesome ๐Ÿ˜„

witek12:04:54

Can I use babashka.http-client to download a binary and write it directly to a file?

witek12:04:59

I have tried (spit file (:body response)), but the written file seams corrupted. Do I need to do some decoding?

borkdude12:04:45

you can do :as bytes and then use fs/write-bytes to write to a file

borkdude12:04:29

or you can do :as :stream and then use (io/copy ) to copy to a file

witek13:04:54

Can I create a binary from my bb script? Or what is the best way to make it available to colleagues?

borkdude13:04:53

@U2ERGD6UD The best way is to let your colleagues also install babashka. You can make your script or project available via bbin: https://github.com/babashka/bbin or just as a library you can use in your bb.edn (this works the same as making libraries for regular Clojure)

borkdude13:04:01

It is possible to make a self-contained binary: https://github.com/babashka/babashka/wiki/Self-contained-executable but I don't recommend going that route since you would need to create binaries for each OS etc. and this gets old fast

borkdude13:04:15

Another way involves making an uberjar, like its done here: https://github.com/eval/deps-try/releases/tag/v0.4.0 and then you can publish it to homebrew like this: https://github.com/eval/homebrew-brew/blob/main/Formula/deps-try%400.3.9.rb

borkdude13:04:27

(kudos @U04V6FEES for the homebrew setup there, looks like something I might want to borrow from)

witek13:04:34

I will try bbin. Can you recommend an example git repository containing a single script which I could use as a template?

witek13:04:25

Perfect. Thank you!

witek14:04:58

Your tools project has no deps.edn and no bb.edn - so cider-jack-in-clj won't work, correct?

borkdude14:04:26

If you choose cider-jack-in and then babashka it should work I think?

borkdude14:04:37

cider-jack-in-universal

witek16:04:55

I don't have this command. Seams I have to upgrade. But I connected successfully to bb --nrepl-server. And now I am done: https://github.com/witek/tools Thank you for your help!

๐Ÿ‘ 4
kenny23:04:41

Can you use bb w/ a shebang and invoke the main method of the file? e.g., I have a file my_script.clj that looks like this:

#!/usr/bin/env bb

(defn -main 
  [& args]
  (println "hello"))
And Iโ€™d like to run the -main function automatically when I invoke it like so ./my_script.clj without a top-level (-main) call. Possible?

Bob B23:04:22

I think the recommended way would be <https://book.babashka.org/#main_file> - this puts a when around the call to -main (in case that's the reasoning behind the ask).

kenny23:04:43

That looks like the solution! Thanks!!

๐Ÿ‘ 2