This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-07-06
Channels
- # announcements (4)
- # aws (1)
- # babashka (18)
- # beginners (28)
- # calva (5)
- # cider (3)
- # clerk (10)
- # clojure (49)
- # clojure-czech (3)
- # clojure-europe (19)
- # clojure-norway (6)
- # clojurescript (10)
- # cursive (44)
- # datalevin (18)
- # datomic (29)
- # dev-tooling (29)
- # emacs (1)
- # hyperfiddle (53)
- # juxt (1)
- # kaocha (2)
- # malli (5)
- # nyc (1)
- # polylith (84)
- # re-frame (1)
- # releases (2)
- # shadow-cljs (33)
- # specter (2)
Following the Polylith guide precisely I end up with the following error when trying to build:
Unqualified function can't be resolved: uberjar
What does this mean?Can you provide a bit more context? Link to the relevant part of the guide? The command you typed?
Yes, I was working on the https://polylith.gitbook.io/poly/workflow/build section of the guide and I typed the command clojure -T:build uberjar :project command-line
I created what the Polylith guide recommended, the user component, the cli base, and the command-line project.
This was after I pulled the https://github.com/polyfy/polylith/blob/master/examples/doc-example/build.clj and put it into my project root. I did see that it is deprecated.
Or, that https://github.com/seancorfield/build-clj is deprecated.
What's your :build
alias in deps.edn
?
It is
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.5.2" :git/sha "8f75b81088b9809ec3cfc34e951036b3975007fd"
:ns-default build}}}
And clojure -version
?
Your :build alias is not correct
ns-default is at the wrong level
(on my phone - hard to type fancy stuff)
Thanks for responding so late. Interestingly I now get an Execution error:
Execution error (FileNotFoundException) at build/eval230$loading (build.clj:1).
Could not locate clojure/tools/deps__init.class, clojure/tools/deps.clj or clojure/tools/deps.cljc on classpath.
Full report at:
/var/folders/kg/kzwqkdwn55j5ytz7mpbmbbjm0000gn/T/clojure-2144745716307180706.edn
Ok, updating to v0.9.2
and git sha 9c9f078602effe4df2b7b505003596ea1c5de436
did it for me. The Uberjar is built.
Complete :build
alias is:
:build {:deps {io.github.seancorfield/build-clj {:git/tag "v0.9.2" :git/sha "9c9f078602effe4df2b7b505003596ea1c5de436"}}
:paths ["build/resources"]
:ns-default build}
and the :extra-deps
entry is:
io.github.seancorfield/build-clj {:git/tag "v0.9.2" :git/sha "9c9f078602effe4df2b7b505003596ea1c5de436"}
Yeah, I was looking at the versions -- tools.deps
used to be tools.deps.alpha
so older deps would bring in the wrong ns
Why/where is build-clj
in :extra-deps
?
Oh, for Cursive use?
Mine is at
{:aliases {:dev {:extra-paths ["."
...]
:extra-deps {org.clojure/clojure {:mvn/version "1.11.1"}
org.clojure/tools.deps {:mvn/version "0.18.1354"}
io.github.seancorfield/build-clj {:git/tag "v0.9.2" :git/sha "9c9f078602effe4df2b7b505003596ea1c5de436"}}}
Yup, as I noted above 🙂
The upcoming version of Cursive should involve less workarounds for Polylith.
(I have never used Cursive -- I can't stand IntelliJ! -- so I don't have to deal with any of these workarounds)
Ah, I see. I did see you using VSCode in your video that inspired me to use Polylith. I figured I’d give Cursive a try so I can see if I like it. If I could get a similar enough flow working in Emacs I’d switch back. VSCode looks like a great option as well.
I love that VS Code is hackable via cljs and Joyride 🙂
Glad you got things working... the Polylith guide needs some updates on those versions, it seems? I really want to get it all updated to not use my build-clj
library at all but that's a bunch of work...
Yeah, I’m sure the guide would have worked perfectly as-is had I not manually updated the tools.deps.alpha
to tools.deps
. Updating to the latest versions there worked for me eventually.
I don't have edit permissions on the poly
book, only the high-level Polylith
book, but I've left comments about updating versions.
(Joakim will probably give me edit permissions and let me just fix it directly 🙂 )
I don't think comments are visible to folks without a GitBook account?
The downloaded build.clj
seems to reference tools.deps
, not the alpha version -- what are you referring to in "manually updated the tools.deps.alpha to tools.deps"?
I mean that I changed the ./deps.edn
file that was auto generated by poly create workspace name:example top-ns:se.example branch:master :commit
The generated project uses an outdated tools.deps.alpha
dependency in the ./deps.edn
file.
Oh... yeah, that dep has never been needed! No idea why the generated project even includes it.
What version of the poly
tool are you using BTW?
(I use a :poly
alias and always work from the latest master SHA version -- currently 0.2.18-issue309-05 (2023-06-20)
right now)
That’s cool, do you just put the latest :sha
argument in the :poly
alias in ./deps.edn
?
Yeah. I used to have it in my dot-clojure
deps.edn
file but I switched to the installed tools
version ages ago (although I have not kept that up to date because I rarely use poly
outside an existing Polylith project.
Our Polylith stuff in deps.edn
at work:
:poly-test-jvm-opts ["--enable-preview"
"-client"
"-Dclojure.core.async.go-checking=true"
"-Dclojure.spec.check-asserts=true"
"-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"
"-Djdk.httpclient.allowRestrictedHeaders=host"
"-Dlog4j2.configurationFile=/var/www/worldsingles/development/resources/log4j2-silent.properties"
"-Dlog4j2.formatMsgNoLookups=true"
"-Dlogged-future=synchronous"
"-Dws.pubsub.buffer-size=10000"
"-XX:-OmitStackTraceInFastThrow"
"-XX:+TieredCompilation"
"-XX:TieredStopAtLevel=1"]
:poly {; for our development/logging operations:
:jvm-opts [;; for poly itself:
"-client"
"-Dclojure.tools.logging.factory=clojure.tools.logging.impl/log4j2-factory"
"-Dlog4j2.formatMsgNoLookups=true"
"-Xmx256m"
"-XX:-OmitStackTraceInFastThrow"
"-XX:+TieredCompilation"
"-XX:TieredStopAtLevel=1"
;; for the subprocess that poly test invokes:
"-Dpoly.test.jvm.opts=:poly-test-jvm-opts"]
:extra-deps {io.github.polyfy/polylith
{#_#_:git/tag "v0.2.17-alpha" #_#_:git/sha "a1581cc"
;; latest master with unnecessary dependency check:
:sha "1209a81e6b8f70987050d65d106e99d1a902969a"
:deps/root "projects/poly"}
io.github.seancorfield/polylith-external-test-runner
{:git/tag "v0.2.0" :git/sha "f208856"
:deps/root "projects/runner"}}
:main-opts ["-m" "polylith.clj.core.poly-cli.core"]}
And the start of our workspace.edn
(which specifies the external test runner etc):
{:vcs {:name "git" :auto-add false}
:top-namespace "ws"
:interface-ns "interface"
:default-profile-name "default"
:compact-views #{"deps" "libs"}
:tag-patterns {;; we tag each QA deployment with build-
:release "build-[0-9][0-9][0-9][0-9]-*"
:stable "stable-*"}
:test {:create-test-runner [org.corfield.external-test-runner.interface/create]}
That’s helpful. I’ll give it a deeper look tomorrow. I better bounce for tonight. My brain is turning off…
Any time!
This message contains interactive elements.
I get an Edit button on the Polylith book but not on the poly book.
Try now.
CR submitted.
Thanks!
Merged.
Hi, I have a question about a warning from polylith. The warning is:
Warning 206: Unreadable namespace in development: /[...]/development/src/data_readers.clj
The contents of that file:
{tap> user/tap*>}
This allows us to put #tap>
basically anywhere in our source code to tap the outcome of the following form and return its return value. Super convenient 🙂
I don't quite understand what's causing the Polylith warning. Do you have any idea? Thanks!For completeness, this is the user/tap*>
definition:
(ns user)
(defn tap*>
"Implementation of data reader `#tap>` that returns the
value of what is being tapped, so that you can just put
it in front of any sepxr.
This is used as a data reader (see `data_readers.clj`),
meaning that it is ran read-time. In other words, it is
in fact a macro, even though it looks like a normal
function."
[body]
`(let [result# (do ~body)]
(tap> result#)
result#))
These threads may help to resolve your issue: https://clojurians.slack.com/archives/C013B7MQHJQ/p1632074575212200?thread_ts=1632072259.209600&cid=C013B7MQHJQ https://clojurians.slack.com/archives/C013B7MQHJQ/p1631298234159500
Thanks @U2BDZ9JG3! Is this really the same problem though? I'm NOT having the non-top-namespace warning, but "unreadable namespace"...
You can try ignoring that file:
{ ...
:projects
{"development"
{:alias "dev"
:ignore-files ["data_readers.clj"]}}
...}
Hmm, I think if you add (ns data-readers)
on top of your data_readers.clj
file, you should not need to add the ignore-files
.
When I do that I get clojure.lang.ExceptionInfo: Not a valid data-reader map
when jacking in. But that's OK, ignoring it is fine for me.
I see. Maybe Polylith should not check anything with data_readers files. @U1G0HH87L
Sounds like the way to go Furkan! I will create an issue when I’m near a keyboard.
I have created issue https://github.com/polyfy/polylith/issues/316.
Issue 316 has been fixed and merged to master
@UGNFXV1FA. Now you should be able to remove :ignore-files
.
Something else: I just switched to the main
branch of poly, and noticed some super-nice additions! 🎉 One of those is the ability to detect "unnecessary components" in projects. Great feature! I think I found an omission though. One of my poly projects needs a component dependency only for the test setup (as defined in workspace.edn
using :setup-fn
. Poly reports the component as unnecessary, but it's not. So maybe the omission is that it should also take the setup-fn
namespaces into account?
You can list necessary components using the :necessary keyword and a vector with namespaces as value in :projects in workspace.edn, to get rid of that warning. I’m away from keyboard right now, but will give a better answer when back.
Type ’help check’ to read about how to get rid of that warning.
Thanks @U1G0HH87L That seems clear enough for me to fix it myself, no need for you to spend more time on this 👍 I’m AFK myself right now, I’ll try later.