This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-12
Channels
- # announcements (76)
- # babashka (10)
- # beginners (39)
- # biff (2)
- # calva (51)
- # chlorine-clover (8)
- # cider (6)
- # clj-kondo (15)
- # clj-on-windows (13)
- # cljdoc (26)
- # cljs-dev (8)
- # clojure (196)
- # clojure-austin (17)
- # clojure-europe (36)
- # clojure-nl (4)
- # clojure-spec (8)
- # clojure-uk (2)
- # clojurescript (18)
- # community-development (4)
- # conjure (1)
- # core-typed (38)
- # cursive (5)
- # datalevin (17)
- # datomic (21)
- # docker (1)
- # events (2)
- # interop (2)
- # jobs (4)
- # kaocha (28)
- # lsp (22)
- # nyc (1)
- # off-topic (10)
- # pedestal (1)
- # portal (22)
- # re-frame (22)
- # react (10)
- # shadow-cljs (19)
- # spacemacs (7)
- # tools-deps (11)
- # vim (14)
- # xtdb (7)
Hi, I’m having a weird problem when using tools.deps that is confounding me. I have a build process using deps that compiles my code, has been working fine. I also have a docker build that also used to work fine, but now hangs when attempting to compile. But, it only hangs in the docker build - it builds successfully locally. (local clojure version 1.11.1.1105, docker version from the clojure-latest image, 1.10.3.1087. I thought the smoking gun was that I recently introduced some future
s into the codebase to handle some external services, however when I run kill -3 on the process in the docker image I can’t see any references to the futures I created (and the futures are not in top level functions anyway).
When I run lots of kill -3's, the system does seem to be doing work - the main stack trace changes - but it’s crawling along at a snail’s pace.
I realise that this could be caused by any amount of errors I’ve introduced myself, but maybe someone on here might have seen this category of problem before and could point me where it may be most fruitful to look and might save me a few hours of my life! Thanks in advance.
Is the “build process” a tools.build program or something else? Not sure how to help without more info
Apologies, should have included that info, it's using clojure.tools.build.api/compile-clj to compile. I'm building an Uber jar after compiling sources but it's not getting that far
one common reason for compile to take suspiciously long is that you have code at the top level of a namespace that is doing something (compile is a side effect of loading)
it may be doing something can succeed locally but not in the docker environment, for example
When top level, you mean (for example) having a (future) call directly in the namespace, rather than within a (defn)? I have introduced a few futures but from what I can see they are all within other functions.
Now that you say it though, the stuff I introduced would fit the bill in terms of working locally and not in docker, so that's definitely a smoking gun.
yes, any code at the top level of the namespace (def's ) will be loaded and evaluated as part of compilation
no real difference here - each top level form is evaluated. for def
, that means evaluating the initialization value. for defn
it means evaluating the function definition (but that's not going to invoke the function, unless you cause that to occur)