This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-22
Channels
- # adventofcode (12)
- # announcements (17)
- # babashka (46)
- # beginners (105)
- # calva (7)
- # chlorine-clover (7)
- # cider (9)
- # clj-kondo (41)
- # cljsrn (16)
- # clojure (67)
- # clojure-australia (1)
- # clojure-europe (24)
- # clojure-france (6)
- # clojure-germany (10)
- # clojure-italy (1)
- # clojure-losangeles (3)
- # clojure-nl (4)
- # clojure-uk (11)
- # clojurescript (8)
- # cursive (8)
- # data-oriented-programming (1)
- # data-science (1)
- # datomic (11)
- # defnpodcast (4)
- # events (1)
- # fulcro (34)
- # graalvm (6)
- # helix (3)
- # jackdaw (19)
- # jobs-discuss (1)
- # leiningen (9)
- # luminus (2)
- # malli (15)
- # mathematics (2)
- # meander (5)
- # mental-health (1)
- # off-topic (4)
- # pathom (23)
- # podcasts-discuss (1)
- # polylith (4)
- # quil (3)
- # re-frame (81)
- # react (1)
- # reagent (19)
- # reitit (4)
- # releases (1)
- # reveal (11)
- # shadow-cljs (54)
- # specter (14)
- # tools-deps (16)
- # vscode (2)
- # xtdb (3)
👋:skin-tone-2: hey gang, wanted to see if I’m thinking about this correctly. I have a clojure codebase and I want to add a couple .cljc
namespaces to it and create a jar that only includes those namespaces using a separate profile for consumption as a library in a clojurescript project. Is that necessary or should I just create a single jar for the whole thing?
in my experience adding more jars / configs with different subsets of jars tends to lead to errors and slow down processes
and what do you gain? there aren't files in the jar that you don't use in one app - that's a small benefit for the added work and fragility IMHO
Hey gals and guys,
After setting up a Docker container based on clojure:openjdk-11-lein
I am able to run lein
commands such as lein ancient
, lein repl
and such.
Nevertheless It seems that the first time I run those lein commands it downloads the dependencies for each and every different commands (`lein ancient`, lein repl
, lein test-refresh
etc.).
Is there an explanation for that behavior? Is it possible to prevent the download of the same deps multiple times to save bandwidth and time ?
The explanation for that behavior is that at least some, and perhaps all, of those commands need different JAR files retrieved from the Maven central repository and/or Clojars, or they cannot run, because those JAR files are not already on the system where you ran those commands. They are cached in your ~/.m2 directory after you run those commands the first time, so the second time you run them it should not download them again.
If you create the Docker container in such a way that those files are already present in the container, then running those commands should not download them again.
IMHO the superior option is not to run lein inside docker (unless the container is only for CI jar building) and instead use lein to build a jar, and use that jar from docker. This eliminates other complexities like pre-populating / reusing the m2 cache and eliminates a variety of transient / situational failures to reproduce behavior.
also it's less demanding on your container resources in your prod environment
Thank you @U0CMVHBL2 and @U051SS2EU!
The container is for dev env. only. The ~/.m2
dir is mapped to a volume so the cache is not lost between container's ups and downs. You are right @U0CMVHBL2, it happens only the first time the lein commands are ran.
In any case this is not a big deal, I was just curious.
Thanks again!