This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-08
Channels
- # adventofcode (9)
- # announcements (5)
- # babashka (3)
- # beginners (46)
- # calva (21)
- # cider (15)
- # clj-kondo (20)
- # cljs-dev (57)
- # cljsrn (10)
- # clojure (147)
- # clojure-dev (6)
- # clojure-europe (3)
- # clojure-france (2)
- # clojure-italy (8)
- # clojure-nl (18)
- # clojure-norway (5)
- # clojure-spec (16)
- # clojure-uk (63)
- # clojuredesign-podcast (7)
- # clojurescript (65)
- # clojurex (42)
- # cursive (12)
- # datomic (10)
- # fulcro (47)
- # graalvm (102)
- # graphql (2)
- # jobs (5)
- # joker (12)
- # off-topic (33)
- # pedestal (6)
- # re-frame (6)
- # reagent (8)
- # reitit (6)
- # remote-jobs (4)
- # rewrite-clj (10)
- # shadow-cljs (86)
- # sql (45)
- # testing (4)
- # tools-deps (43)
- # vim (8)
- # xtdb (3)
I updated my notes: https://gist.github.com/borkdude/dd0857cf1958b25496fddbdbf359ca59#trying-to-compile-only-using-toolsdeps I have some trouble AOT-ing stuff like leiningen does, using tools.deps. Not sure what needs to be done
more luck now!
$ ./spec-test
{:major 1, :minor 11, :incremental 0, :qualifier master, :interim true}
true
updated notes@lee the hint is that you need to patch clojure, then build it, then build spec.alpha with the patched clojure.
https://github.com/eraserhd/rep/blob/develop/.circleci/images/primary/build.sh has the details
IMHO clj-1472-3.patch is simple and sufficient. Ghadi's changes the clojure compiler to be able to generate the correct bytecode for locking, saving a method call and adding some code to the clojure compler.
I think locking is, by definition, not performant, and it's also not idiomatic in Clojure, so that's why my vote goes for 1472.
(clj-1472-3.patch uses a native Java method which is passed a callable to lock an object)
@eraserhd I think if you would post this in JIRA or #clojure-dev (or both) more Cognitect people would see this
It was after listing to Bozhidar's talk at the last conj (or the one before?) and making a commitment to not work around other Clojure community efforts even when it was a bit more painful.
maybe there could be a Github action or CircleCI orb with a graalvm patched clojure 😛
It would be helpful if someone could capture any info about this in the jira ticket. I am seeing it, but I am also immediately forgetting it :)
I'm not sure what to add to the JIRA ticket, but I have written down some things here, just so next time I'll still remember what to do: https://gist.github.com/borkdude/dd0857cf1958b25496fddbdbf359ca59
@eraserhd any reason you're building 1.10.0-master-SNAPSHOT and not 1.11.0-master-SNAPSHOT?
@eraserhd I'm getting: {"error":{"code":"JwtAuthoriser:TokenExpiredError","title":"Token verification failed: jwt expired","href":"
locally
But I think we can actually just publish a clojure fork to clojars for use with Graal.
In any case, I think that's attempting to download the clj-1472-3.patch. There's no reason that it isn't a later version of Clojure, other than I haven't needed to update it.
A thought: if it is referenced via deps.edn git:url we can provide any group-id/artifact-id we like, right?
And thanks @eraserhd, great to have info from someone who has actually succeeded at patching clojure for graal.
@borkdude, adding a link to your gist in JIRA clj-1472 would likely be helpful to others.
@eraserhd I think adding our humble opinion about clj-1472-3.patch to the the JIRA issue would help. It is not a pro/con spreadsheet but does capture a pro.
using clojure forks with deps.edn is not possible (or difficult) due to the default clojure being baked into the installation deps.edn
this was not intentional but I've certainly run into trying to test my own stuff at times
in particular, having it baked in in combination with known issue of dep replacement across different coord types
boot supports setting this:
BOOT_CLOJURE_NAME=org.clojure/clojure
BOOT_CLOJURE_VERSION=1.10.1
I just need to fix the issue above - then it would be fine
so an {:override-deps {org.clojure/clojure {:git/url "some-fork" :sha "some-sha"}}
is not gonna work, right?
This does work if you use a patched org.clojure/clojure as a filesystem artifact thogh.
I mean, it won't work anyways b/c that relies on source-only libs, and clojure is compiled
but it would be nice if you could do :local/root replacement to a jar
and maybe keeping the fork local in a CI env to produce a single binary is better, since spreading forks with patches around can get messy 😉
certainly, I'd prefer there not to be N forked versions of Clojure floating around as that quickly becomes a problem for support and compatibility
It occurs to me that if you don't want to mess with patching and building, the jars are here: https://github.com/eraserhd/rep/tree/develop/deps
I consider a fork to be like a very strong vote in ask/jira :)
hah, well this is definitely a pain point. I'll try and comment on the JIRA issue soon.
Also tried the boot approach. Didn't work, same result as lein: https://gist.github.com/borkdude/dd0857cf1958b25496fddbdbf359ca59#build-binary-using-boot-uberjar--native-image
@eraserhd it seems you're also using tools.deps to compile the main namespace. that's the only thing that worked for me with a patched clojure
I also had to add --report-unsupported-elements-at-runtime which I've avoided for all my binaries so far, but with a patched clojure it seems needed somehow
wrt deps.edn, what I'm now doing is complicated. deps.edn is used for development, but building with GraalVm is using clj2nix to make deps.nix from deps.edn
I created a little bash script to carry out steps outlined in @borkdude's gist. I builds and locally installs spec.alpha 0.2.176-patch1472 and clojure 1.10.1-patch1472
@lee that's neat! is this available in a gist somewhere, where I can link to from my doc?
I find shellcheck to be a fantastic tool for linting bash, if you're like .... into linting
I use the cli but the site's good for getting an idea
I learned a lot about bash using it
@alexmiller I've been using it since you recommended it a while back and it's been fantastic
> bash continues to surprise me (in ... bad ways). this is one of the rationales for babashka: https://github.com/borkdude/babashka 🙂
I just used it like this: https://twitter.com/borkdude/status/1192884596431568896 I've tried this before using xargs, but if it takes more than 5 minutes reading in man pages or StackOverflow, I'd rather write Clojure
just had to brew install shellcheck and add spacemacs shell-scripts layer and voila! Thanks!
Hey, if anybody here is going to the Conj and wants to talk aobut Graal or command-line tooling (especially for editors), hit me up.
suggest an unsession?