This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-17
Channels
- # announcements (2)
- # aws (7)
- # beginners (46)
- # cider (15)
- # clj-kondo (24)
- # cljs-dev (3)
- # clojure (46)
- # clojure-dev (34)
- # clojure-europe (7)
- # clojure-italy (7)
- # clojure-nl (10)
- # clojure-norway (15)
- # clojure-spec (5)
- # clojure-uk (42)
- # clojuredesign-podcast (1)
- # clojurescript (79)
- # clr (3)
- # core-async (1)
- # cursive (45)
- # data-science (1)
- # datomic (4)
- # fulcro (17)
- # funcool (14)
- # gorilla (2)
- # graphql (30)
- # jackdaw (5)
- # jobs-discuss (8)
- # joker (4)
- # lein-figwheel (1)
- # off-topic (48)
- # pedestal (26)
- # re-frame (36)
- # reagent (18)
- # reitit (6)
- # remote-jobs (4)
- # shadow-cljs (115)
- # tools-deps (62)
- # vim (12)
👋 are there any known gotchyas with using gitlibs via t.d.a in CircleCI? I just switched a lib from Maven coords to git coords; it worked fine locally for me but over in CircleCI the deps were downloaded but then the files couldn’t be found on the classpath during the test run.
Failed job is here if it’s helpful to see it: https://app.circleci.com/jobs/github/FundingCircle/fc4-framework/2711
I was able to reproduce the problem just now locally via Docker so I should 😅 be able to figure it out
It looks like the problem is that when the classpath is generated, there’s an extra segment main
at the end; that dir doesn’t exist in the repo hosting this particular library
Here’s the cp entry: /home/circleci/.gitlibs/libs/clj-chrome-devtools/clj-chrome-devtools/58a396f54f469e98b5aae92b9357d65434914228/src/main
Anyone have any suggestions on why that might be the case? I’ve been looking through https://clojure.org/reference/deps_and_cli and so far haven’t found any clues
aha! yes, it was fixed: https://clojure.atlassian.net/browse/TDEPS-52
Alex commented on the issue: > Released in clj 1.10.1.458 And I’ve confirmed that the CircleCI image I’m using has 1.10.0.442 installed. Interestingly, even the official Docker images for Clojure don’t appear to have any variant with a version of Clojure more recent than 1.10.0.442. This is surprising…
there are no official Docker images for Clojure
i don't even think there should be official Docker images for Clojure in a world of uberjars, to get edgy
who maintains the images here? https://hub.docker.com/_/clojure
yup! if you're interested in custom images and interested in sponsoring some sort of support model, I'd love to chat though.
Next question: • I’ve been using Cambada to AOT my code and build an uberjar containing my code and all my dependencies. • Now that I’ve switched one of my dependencies to a gitlib, Cambada is having trouble building the uberjar. So: Does anyone happen to know whether there’s an existing solution to this somewhere? (I mean either some way to continue using Cambada, maybe a fork, etc; or some alternative to Cambada (whether a single tool or a combination of tools) that I might want to consider switching to.)
@aviflax try this fork of Cambada. There are several issues have been fixed. may be your problem is already fixed too. https://github.com/mikeananev/cambada
@mike1452 it doesn’t seem to work; it seems to fail with the same error as the root cambada. I see you have GitHub’s issues feature disabled in your fork but the feature is enabled in the root repo — would you be interested in a bug report opened as an issue in that repo, which we could use to discuss and debug the problem, and to potentially craft a fix to be merged into your fork?
@mike1452 never mind, I spoke too soon — I took a closer look at the error output and it was not the same error — it was a different error that I’ve seen before and already have a way to work around. And once I applied that workaround, the uberjar process completed successfully. So your fork does in fact resolve my issue with gitlibs. This is great — thank you!
For anyone who might have a similar question: @mike1452 suggested I try this fork of Cambada: https://github.com/mikeananev/cambada — and it does indeed seem to have fixed the problem I was encountering with gitlibs, AOT, and uberjarring. Thanks Mike!
@aviflax Is AOT a requirement?
Here's all the packaging tools available: https://github.com/clojure/tools.deps.alpha/wiki/Tools#packaging
I guess it’s not a 100% hard requirement but I’d prefer to preserve it. The project is a CLI tool so it needs to start quickly.
Thanks, I was just reviewing that list. I was just wondering if anyone had an answer off the top of their head. The descriptions of those tools don’t always include lots of details.
I don't know how many of those do AOT although, in theory, you could always do that step separately and then package stuff: -e "(compile 'my.main.ns)"
I am fairly certain that depstar
works with git deps and local deps but it does not do AOT.
I believe Cambada is AOT compiling all the Clojure code in my project, including in dependencies. I like that.
Since AOT is transitive, I suspect just compiling the main ns will get you much the same result...?
You'll need to ensure classes
exists as a top-level folder in your repo and add it to the :paths
vector so it's on the classpath.
For anyone who might have a similar question: @mike1452 suggested I try this fork of Cambada: https://github.com/mikeananev/cambada — and it does indeed seem to have fixed the problem I was encountering with gitlibs, AOT, and uberjarring. Thanks Mike!