This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-10-31
Channels
- # aleph (8)
- # announcements (11)
- # aws (1)
- # babashka (7)
- # beginners (104)
- # calva (52)
- # clara (1)
- # clj-kondo (28)
- # cljdoc (8)
- # cljsrn (2)
- # clojure (20)
- # clojure-europe (8)
- # clojure-uk (1)
- # clojurescript (26)
- # core-typed (3)
- # datomic (6)
- # holy-lambda (1)
- # jobs (1)
- # jobs-discuss (14)
- # malli (7)
- # pathom (31)
- # polylith (19)
- # re-frame (8)
- # reitit (1)
- # releases (1)
- # shadow-cljs (5)
- # tools-build (92)
Hi, I've been following along with http://polylith.gitbook.io and ran into a snag - everything was OK until I got to the part where you run "poly" and get a shell. Turns out up to that point I'd been using poly 0.1.0-alpha9 and it expected a command. I realised that I needed to upgrade the poly jar file I was using and got the latest 0.2.13-alpha, however now no poly command works within my project directory, for example running poly help
gives Error in ./worspace.edn: {:top-namespace ["missing required key"]}
I'm trying to figure out what key is missing but the error seems to give no indication - unless the missing key is :top-namespace
? In which case I'm not sure what to put there.
this is my workspace.edn:
{
:projects {"development" {:alias "dev"}
"command-line" {:alias "cli"}}
}
OK I tried changing top-namespace to the common prefix of all my code in the project, as a string, now it complains about deps.edn missing from a component
I'm guessing it may be best to start again from the beginning but with the new version of the tool so it generates the things it expects to see
If your workspace has been created with an old version of the poly
tool, it has to be migrated, which is described https://polylith.gitbook.io/poly/install/leiningen. But if you are just playing around, it’s probably easier to just start all over as you just did!
Thanks, I did try poly migrate
but that failed in the same way as every other poly command at the time, so I started from scratch. That got me further along, then as I got to the point of building an uberjar of the command-line project I got stuck again - turns out I needed to update to a recent pre-release of clojure, then I got stuck again on:
$ clojure -X:build uberjar :project command-line
Namespace could not be loaded: build
I thought perhaps I need to be in the projects/command-line directory when I run that, but that produces: Unqualified function can't be resolved: uberjar
the OK adding :extra-paths ["."]
to the :build alias in the root directory got me further, but compilation fails with an error saying it can't locate the core file as a class, clj or cljc file
seems there's a lot of ways to get things wrong I'm just trying to get to the point I can produce a jar file that when called prints hello world
if I can get that working then I feel like I can iterate and start seeing the benefits of the architecture
What do you get back if you execute clojure --version
?
I managed to print the classpath just before build.clj calls (bb/uber opts)
and the bases/cli/src directory is there, so it's strange that whatever happens next doesn't find the core.clj which is definitely there
It's been a long time since I've been embroiled in classpath hell, I'll find a way out
If you can share the project you have problems with somewhere, then I can have a look at it.
If you could share the steps you used to create the project and, in particular, how you created build.clj
, that might help us help you @U027P8D1P5H -- it's possible there are still bugs in the new docs around using build.clj
with Polylith. That's all a fairly recent addition.