This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-27
Channels
- # aleph (1)
- # announcements (39)
- # aws (11)
- # beginners (58)
- # calva (10)
- # cider (7)
- # clj-kondo (65)
- # cljs-dev (5)
- # clojure (90)
- # clojure-dev (48)
- # clojure-europe (23)
- # clojure-madison (1)
- # clojure-norway (1)
- # clojure-uk (40)
- # clojured (11)
- # clojurescript (20)
- # conjure (12)
- # core-async (4)
- # core-logic (4)
- # cursive (3)
- # datalevin (1)
- # emacs (7)
- # events (2)
- # fulcro (48)
- # introduce-yourself (2)
- # lsp (36)
- # malli (11)
- # missionary (1)
- # off-topic (1)
- # other-languages (72)
- # pathom (4)
- # polylith (13)
- # portal (94)
- # re-frame (14)
- # react (5)
- # releases (1)
- # sci (12)
- # shadow-cljs (29)
- # spacemacs (3)
- # vim (4)
- # xtdb (12)
@jacob.maine i tried running the profiler stuff in cli/dev from a repl to a debug-cli build and I couldn't require clojure-lsp.debug
So i started splatting "dev" in various src-dirs in cli/build.clj
until it worked. Not sure if I was building wrong or something was missing in there.
hmmā¦ there isnāt anything special about how you should build. just make
should work
fwiw, it works ok for me in emacs
i wonder if cider / jack-in / user profile is doing something with dev. I just check again, and Could not locate ... clojure_lsp/debug.clj ... on classpath.
unless i muck with that build file.
hmmā¦ that seems likely. iām not sure iāve ever tried to require clojure-lsp namespaces from other projects
hereās a questionā¦ what the heck is an uberjar? i know it contains your code and clojure.core. but how does it handle code on other classpaths? are they bundled into it too?
yeah it contains everything.
strings clojure-lsp|grep "clojure_lsp/debug"
shows it's not in the graal artifact unlike other namespaces.
oh, youāre using the native version? thatās even more mysterious to me than the uberjar version
fwiw, strings clojure-lsp|grep "clojure_lsp/debug"
also suggests itās not in the debug uberjar version
Oh, and i see what we're doing differently too, if you launch lsp, you should be able (require 'clojure-lsp.debug)
without evaling the namespace. (and fireplace chokes on eval if a file doesn't exist so i cant manually eval)
yeah, if i run (require 'clojure-lsp.debug)
i also get an exception (unless iāve previously evaled the namespace)
Could not locate clojure_lsp/debug__init.class, clojure_lsp/debug.clj or clojure_lsp/debug.cljc on classpath.
Hrm maybe @UKFSJSM38 can help include that src dir properly?
I was just going to askā¦ can you figure out which inclusion of the src dir fixed things?
Iām a little confused thoughā¦ I thought the graal build was only for prod, not dev?
iām just worried that including that src dir in the wrong place will force those libraries to get compiled into the prod executable, which i donāt think we want
lol, I don't know either, I was just doing what worked as far as builds. My preference for dev was to use lein run
originally.
I added to both places in uber-aot
but im not going to have time for awhile to track down if both or either are needed.
I agree for release it shouldnt be there, i thought the extra-aliases :debug for debug-cli would only do it for dev builds.
iām afraid i canāt help either, mostly because iām pretty useless when it comes to understanding builds
although, this looks like it might be a straightforward changeā¦
does this look roughly like what you did?
diff --git a/cli/build.clj b/cli/build.clj
index d1300505..ab7f9fff 100644
--- a/cli/build.clj
+++ b/cli/build.clj
@@ -48,11 +48,12 @@
(clean opts)
(javac opts)
(println "Building uberjar...")
- (let [basis (b/create-basis (update basis :aliases concat (:extra-aliases opts)))]
- (b/copy-dir {:src-dirs ["src" "resources"]
+ (let [basis (b/create-basis (update basis :aliases concat (:extra-aliases opts)))
+ src-dirs (into ["src" "resources"] (:extra-dirs opts))]
+ (b/copy-dir {:src-dirs src-dirs
:target-dir class-dir})
(b/compile-clj {:basis basis
- :src-dirs ["src" "resources"]
+ :src-dirs src-dirs
:java-opts ["-Xmx2g" "-server"]
:class-dir class-dir})
(b/uber {:class-dir class-dir
@@ -74,7 +75,8 @@
(uber-aot (merge opts {:extra-aliases [:native]})))
(defn debug-cli [opts]
- (uber-aot (merge opts {:extra-aliases [:debug]}))
+ (uber-aot (merge opts {:extra-aliases [:debug]
+ :extra-dirs ["dev"]}))
(bin {:jvm-opts ["-Djdk.attach.allowAttachSelf=true"]}))
(defn prod-cli [opts]
fwiw, that lets me run (require 'clojure-lsp.debug)
Sorry for the delay, the src folders are probably missing because of missing dev/test/debug aliases
Merged, I like how we have total control on build.clj even tho it's a little bit more complex, lein magics used to annoy me š
that is, if i connect to the lsp server and eval clojure-lsp.debug
, it works
the ādevā path is supposed to come from the :debug
alias, which is used for make