This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-15
Channels
- # announcements (5)
- # babashka (56)
- # beginners (24)
- # biff (15)
- # calva (7)
- # clj-kondo (12)
- # cljsrn (8)
- # clojure (68)
- # clojure-denmark (1)
- # clojure-europe (55)
- # clojure-norway (4)
- # clojure-spec (9)
- # clojure-uk (2)
- # clojurescript (8)
- # cursive (11)
- # data-science (7)
- # datahike (1)
- # datomic (66)
- # emacs (12)
- # etaoin (3)
- # fulcro (10)
- # graphql (3)
- # hyperfiddle (97)
- # jobs (1)
- # kaocha (8)
- # lsp (3)
- # malli (15)
- # meander (1)
- # off-topic (3)
- # overtone (4)
- # polylith (7)
- # rdf (25)
- # re-frame (4)
- # reagent (14)
- # remote-jobs (1)
- # shadow-cljs (126)
- # sql (30)
- # vscode (3)
- # xtdb (8)
Found a broken link on the Biff website: https://biffweb.com/docs/reference/transactions/ The link to com.biffweb/tx-fns
about halfway down goes to localhost:8888. I was looking into whether Biff validates against the schema or coerces, because I thought I might set some default values on the schema. Looks like it just validates and—upon further, unrelated, reflection—I probably shouldn't be using the schema to set this default value anyway. Also, I just want to note that I find Biff's code very readable. This is the first big project I've attempted where I felt that way about the tools I'm using and felt comfortable just digging into the source code for answers.
good to know, I'll fix that. by the way, that transactions page mentions a :db/default operation that might be what you need. I haven't thought about coercion at all--might be worth looking into actually. also very glad the code is readable :)
I updated my project to use biff 0.6; last time I updated, I kept using the ./task bash script; this time, with the secrets thing, it seemed better to try to use the new babashka tasks, but I need some extra jvm-opts ("-add-modules" "jdk.incubator.foreign" "-enable-native-access=ALL-UNNAMED") because I'm using libpython-clj. I tried adding them to run-args (I'm using a local copy of biff anyway, because I had to use tools.deps instead of tools.deps.alpha (and disable use-libs) to get flow-storm working), but although the println I added to tasks.clj to see the run-args does execute, my additional args aren't there. I'm quite confused by that, but all that really matters to me is that I can add some jvm-opts; what's the recommended way to do that?
in new/up-to-date projects there's an option in config.edn where you can specify jvm arguments. I'll type up some more info when I'm at my desk. I'm curious about the dependency conflict; does flow-storm use tools.deps + tools.deps conflicts with tools.deps.alpha? if this might be a common problem I could probably do something to make it so you don't have to run a local copy of biff.
ah, of course; I looked right passed it. now I need to figure out how to pass them through clj; :jvm-opts
in deps.edn manages that magic; just adding -J
didn't work. I can figure that out, though if you happen to know...
I'll refresh my memory about the flow-storm thing
with the template project 0.6 generated (which I used to update mine), with just the flow-storm dependency added, I get this:
Error building classpath. Unable to compare versions for org.clojure/tools.deps.alpha: {:mvn/version "0.14.1222", :deps/manifest :mvn} and {:git/url "", :git/sha "8f8fc2571e721301b6d52e191129248355cb8c5a", :deps/manifest :deps, :deps/root "/home/momerath/.gitlibs/libs/org.clojure/tools.deps.alpha/8f8fc2571e721301b6d52e191129248355cb8c5a"}
I tried lots of stuff I only vaguely remember, months ago, to get around that without modifying biff, but obviously didn't manage to
ah, I see. I'll take a crack at it.
You can put this in deps.edn:
com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.3.315"
:exclusions [org.clojure/tools.deps.alpha]}
i.e. tell clojure to use the version that biff specifies instead of the version flow-storm specifies. Biff uses the https://github.com/clojure/tools.deps.alpha/tree/add-lib3 branch which contains the code for adding dependencies at runtime. Hopefully that works fine for flow-storm--I've verified that the project starts at least, but let me know if you run into any problems during development.> now I need to figure out how to pass them through clj; :jvm-opts
in deps.edn manages that magic; just adding -J
didn't work. I can figure that out, though if you happen to know...
hm, from the docs it looks like -J
and :jvm-opts
should be equivalent. Does this work?
:biff.tasks/clj-args ["-J--add-modules"
"-Jjdk.incubator.foreign"
"-J--enable-native-access=ALL-UNNAMED"
...
Thanks! Ran an errand; back at it now. I tried your example, and quoting the --add-modules jdk-incubator-foreign
, or just leaving off the -J for that argument; they all balk at jdk-incubator-foreign
in one way or another
run-args: [-J-XX:-OmitStackTraceInFastThrow -J-XX:+CrashOnOutOfMemoryError -J-Duser.timezone=UTC -J--add-modules jdk.incubator.foreign -J--enable-native-access=ALL-UNNAMED -J-Xmx80g -M -m software.sacred --port 7888 --middleware [cider.nrepl/cider-middleware,refactor-nrepl.middleware/wrap-refactor]]
Unrecognized option: --add-modules jdk.incubator.foreign
You've helped enough, though; I'll read the docs and figure it outhm, well good luck!
if all else fails, you can make an alias in deps.edn that includes :jvm-opts, and update :biff.tasks/clj-args so that it includes the alias