This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-11
Channels
- # announcements (5)
- # babashka (43)
- # beginners (78)
- # calva (1)
- # cider (35)
- # clj-kondo (15)
- # clj-otel (3)
- # cljs-dev (2)
- # clojure (24)
- # clojure-denmark (1)
- # clojure-dev (9)
- # clojure-europe (43)
- # clojure-israel (1)
- # clojure-italy (1)
- # clojure-losangeles (3)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-romania (1)
- # clojure-uk (2)
- # clojurescript (1)
- # core-async (25)
- # cursive (7)
- # datascript (6)
- # datomic (7)
- # docker (2)
- # emacs (2)
- # events (8)
- # exercism (2)
- # fulcro (2)
- # hyperfiddle (16)
- # lsp (46)
- # malli (10)
- # membrane (2)
- # music (6)
- # nbb (30)
- # off-topic (49)
- # polylith (4)
- # reagent (3)
- # releases (4)
- # shadow-cljs (5)
- # slack-help (1)
- # sql (2)
- # testing (2)
- # timbre (6)
- # tools-deps (29)
- # xtdb (36)
I have a noob question about preparing libs to be :local/root source dependencies. I have such a lib, but I can't get the dependency to work because no matter what I do, clj still thinks the library has not been prepped. It is a tiny library consisting of one source file plus a couple of Maven deps on Commons IO and Clojure Data CSV. I have run clj -X:deps prep on this library, and that process added the expected required content to deps.edn, to wit: {:paths ["src" "target/classes"] :deps/prep-lib {:alias :build :fn compile :ensure "target/classes"}} I then go to another tiny project that specifies my library as a :local/root dependency and try to start it up, but I always get a classpath error that the lib is not prepped. What am I (probably) missing?
is there a target/classes in the dir?
It was not clear to me how that should be created.
to translate {:alias :build :fn compile :ensure "target/classes"}
into words...
if this project does not have "target/classes", run clj -T:build compile
(which should put something in target/classes)
I would literally run the command in red?
you don't run it - prep will run it for you when you use it from another project
I mean, you can run it, and then it should appear prepped
Do I run prep while in the other project, as opposed to running it while in the library project dir?
clj -X:deps prep
means "prepare my deps to be on my classpath"
When I run the prep command in the other project, it complains that it doesn't know what compile is.
we may have run out of specific-enough information at this point
LOL - I would be happy to provide more specifics.
https://clojure.org/guides/deps_and_cli#prep_libs hopefully says that same stuff
It does, but not as explicitly. It was not clear to me which deps.edn would acquire those new entries and which dir I should be in when I ran the prep command, for instance.
Probably because I don't really understand what I am / it is doing.
that example has:
• needs-prep - a local lib that needs prepping. it has the :deps/prep-lib in its deps.edn
• cool-lib - a project using needs-prep, includes needs-prep as a :local/root dep. clj -X:deps prep
is run here
I will give this another try based on that understanding. Thank you.
I can see why that example does not fully specify, will try to improve it
Great.
This is the error I get when I run prep in my equivalent of cool-lib: Prepping csvlib/core in /Users/alanbirchenough/clojure/csvlib Execution error (ExceptionInfo) at clojure.tools.deps/qualify-fn (deps.clj:654). Unqualified function can't be resolved: compile
@U064X3EF3 Can you please suggest what I should do to diagnose this error, now that I appear to be executing the process correctly? Thanks.
I think I know what is causing this.
Closing the loop, then I'll shut up: Because I prepped while in my-lib instead of in cool-lib, I had a bogus reference to compile in my deps.edn.
so, working now?
Seems to be, thanks.
amazing, came to this channel to ask about this exactly, and the thread was right here ❤️ thank you!