This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-18
Channels
- # announcements (8)
- # aws (5)
- # babashka (69)
- # beginners (37)
- # calva (222)
- # cider (10)
- # clj-commons (8)
- # clj-kondo (69)
- # cljdoc (5)
- # clojure (62)
- # clojure-dev (23)
- # clojure-europe (37)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-sg (6)
- # clojure-uk (5)
- # clojurescript (25)
- # clojureverse-ops (12)
- # conjure (1)
- # cursive (1)
- # fulcro (9)
- # gorilla (1)
- # graalvm (6)
- # graphql (1)
- # gratitude (1)
- # honeysql (7)
- # introduce-yourself (4)
- # jobs (1)
- # kaocha (9)
- # keyboards (4)
- # leiningen (8)
- # lsp (21)
- # malli (9)
- # music (3)
- # nextjournal (17)
- # nrepl (6)
- # off-topic (10)
- # pathom (12)
- # portal (25)
- # reagent (8)
- # releases (1)
- # specter (1)
- # xtdb (1)
just in case you find this amusing, I made a script repo and small runner for (mostly bb) scripts in our company and made a fun logo for it.
If the company you're working for wants to mention it here, that'd be cool https://github.com/babashka/babashka/discussions/1026
@UGFL22X0Q Btw, I'm still looking for a logo for #nbb. It seems you have talent...
I'm trying to pull in the aws-api libraries but having some trouble. when I use the babashka pod, I can start up a REPL and things work in there, but then when I try to build an uberscript bb -m my.main.ns --uberscript target/uber.clj
I get Could not find namespace: pod.babashka.aws
. But when I add the regular clojure libraries to my bb.edn
file, I get a similar error in my REPL (haven't tried building the uberscript that way, though).
do I need to add the pod to my bb.edn
deps or something?
Unfortunately uberscript doesn't work very well with pods right now since their namespaces are introduced in a special manner. Feel free to post an issue about this. I think namespaces starting with pod
should be ignored by the uberscript logic.
As an alternative you might be able to use the uberjar facility instead. It produces an uberjar that bb can run
About the REPL: you should first run load-pod
before you can use the pod.babashka.aws
namespace. You don't need to bring in the aws-api libraries. Everything necessary is contained in the pod.
If I'm already using a project w/ bb.edn
, deps.edn
, etc. would it be easier to just bring in the libs instead of using the pod?
ok, cool. that gives me some more options and cuts off some dead ends, so thanks!
A recent message about bb + the AWS pod: https://clojurians.slack.com/archives/CLX41ASCS/p1634340500250500
oh nice, very relevant! I'm also working in AWS lambda
hmm... the uberjar is saying "could not resolve symbol aws/client." part of my confusion might stem from the fact that I'm using -main
entrypoints rather than shebangs so maybe I'm not translating the examples quite right.
@U06FS3DLH do you have a require like this?
(require '[pod.babashka.aws :as aws])
yes, in my -main
fn
This is called the gilardi scenario: https://technomancy.us/143
I see
In Clojure you cannot introduce new aliases in a function and use them from that function, this is the problem
was having some other issues w/ that, but that was likely before I tried building an uberjar
It is because the reader reads the entire top level form and already needs to know the alias by then
got it working! thank you!
are there some docs on pre-downloading the pod and bundling it? seems to be re-downloading on every invocation of the lambda
@U06FS3DLH holy lambda can take care of this. the gist of this is that you need to download them during the build of your container already
ok, yeah. found that after I had a basic structure put together from a different example. I figured I'd probably find a reason to migrate to that sooner or later š
we also have an issue about it here: https://github.com/babashka/babashka/issues/1019
the gist of it is that you need to make sure the file is in the expected location already when the image starts
@U06FS3DLH I forgot to mention. You can also manually download the pod you're using and then do (pods/load-pod "./the-pod-you-downloaded")
hmm... when I write a simple shebang script like the example (to pre-download the pods), I get this:
----- Error --------------------------------------------------------------------
Type: clojure.lang.ExceptionInfo
Message: Could not resolve symbol: pods/load-pods
Location: /Users/wmorgan/./download_pods.clj:5:2
Phase: analysis
----- Context ------------------------------------------------------------------
1: #!/usr/bin/env bb
2:
3: (require '[babashka.pods :as pods])
4:
5: (pods/load-pods 'org.babashka/aws "0.0.6")
^--- Could not resolve symbol: pods/load-pods
d'oh! re-read that more times than I want to admit. thanks! š
when loading a pod w/ the string path variant you mentioned above, does the path need to point at the dir w/ the manifest.edn and executable? or right at the executable?
do those follow a standard naming convention from the pod name? e.g. org.babashka/aws
-> pod-babashka-aws
e.g. the clj-kondo and datalevin pods don't follow this convention since they are standalone CLI tools that can also be invoked as pods
Hey all. Iām trying to run nbb on node 12.0.0 but I keep getting errors on the import statement:
import { $APP, shadow$provide, $jscomp } from "./nbb_api.js";
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:703:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
at internal/main/run_main_module.js:17:11
ah. Got it thanks.