This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-08
Channels
- # babashka (18)
- # beginners (35)
- # biff (15)
- # cider (24)
- # clj-commons (26)
- # clj-kondo (12)
- # clojure (18)
- # clojure-austin (1)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojure-losangeles (1)
- # clojure-nl (1)
- # clojure-norway (88)
- # clojure-seattle (2)
- # clojure-spec (14)
- # clojure-uk (27)
- # clojuredesign-podcast (5)
- # clojurescript (25)
- # cursive (3)
- # datahike (26)
- # datalevin (13)
- # datomic (39)
- # etaoin (19)
- # events (1)
- # fulcro (12)
- # graphql (1)
- # hyperfiddle (40)
- # introduce-yourself (3)
- # joyride (8)
- # lsp (53)
- # missionary (7)
- # nyc (1)
- # off-topic (31)
- # overtone (10)
- # reitit (6)
- # shadow-cljs (9)
- # slack-help (9)
- # thejaloniki (1)
- # tools-deps (12)
Is there a way to package up bb and my project into a single binary I can ship?
https://github.com/babashka/babashka/wiki/Self-contained-executable has a couple of ways
just to be clear, note that these aren't not OS-agnostic, e.g. shipping a mac binary and codebase to a windows machine won't work
Great thanks! That’s the page I was looking for.
cat ./bb uber.jar > my-binary
looks crazy!
How does that even work?it works by virtue of two things: 1. executables can have arbitrary blobs attached to them 2. zip files can have arbitrary blobs in front of them
I need that magic to "compile" ys... Do you have a link to the place in your code that unpacks this and makes it work?
bb doesn't unpack anything. the logic is:
1. if the invoked executable doesn't have the name bb
2. it checks if the invoked executable is a valid zip file
3. if so, then bb treats the invoked executable as an uberjar, as if you would have written: bb uberjar.jar
I see.
Where did you learn that trick?
I'm surprised that executables can have arbitrary blobs attached to them
works on all OSes
> With the uberjar approach you can build binaries for any OS on any OS though
I assume you mean any OS that can run bb
which is just the ones with graalvm support, right?