This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-17
Channels
- # announcements (1)
- # babashka (26)
- # beginners (28)
- # biff (8)
- # calva (45)
- # cider (62)
- # clara (3)
- # clj-kondo (34)
- # cljfx (1)
- # clojure (72)
- # clojure-belgium (1)
- # clojure-canada (13)
- # clojure-conj (2)
- # clojure-dev (3)
- # clojure-europe (19)
- # clojure-nl (1)
- # clojure-norway (1)
- # clojure-uk (8)
- # clojurescript (10)
- # clr (36)
- # core-logic (13)
- # cursive (2)
- # datalevin (2)
- # datomic (23)
- # fulcro (13)
- # graphql (23)
- # instaparse (1)
- # introduce-yourself (4)
- # jobs (1)
- # jobs-discuss (13)
- # lsp (30)
- # luminus (7)
- # malli (2)
- # off-topic (57)
- # polylith (13)
- # portal (5)
- # reagent (32)
- # reitit (6)
- # remote-jobs (1)
- # shadow-cljs (25)
- # xtdb (12)
@seancorfield continuing on with the build.clj for polylith I am noticing that you don't seem to call the basis function, in the below code I can see your puling in the config from deps to pass to the uber function
(doseq [p projects]
(println "\nRunning: uber on" p)
(let [project-dir (str "projects/" p)
aliases (with-dir (io/file project-dir) (get-project-aliases))]
;; ignore any projects that don't build as uberjars:
(when-let [uberjar-opts (:uberjar aliases)]
(binding [b/*project-root* project-dir]
(bb/clean {})
(bb/uber (assoc uberjar-opts :compile-opts {:direct-linking true}))))))
In the examples I have seen you often build the uber with these params
(b/uber {:class-dir jar-content
:uber-file uber-file-name
:basis basis
:main 'api-rest.core})
I am kind of expecting to have to run this
(b/create-basis {:project (str project-folder "/deps.edn")})
which is erroring with
Local lib poly/offsite-conversions not found: /var/www/components/offsite-conversions
which I believe is due to setting the project root to the project dir.
any reason you don't have a basis defined ? or if I should need one ?
I have just noticed the path is completely wrong which is why its not found, but the question still stands on the basis part 🙂(b/create-basis {})
should be fine, inside the binding
-- that's the default that build-clj
uses behind the scenes: https://github.com/seancorfield/build-clj/blob/main/src/org/corfield/build.clj
The purpose of binding
the project root to the folder containing the deps.edn
is for the build to run as if it is inside that folder,
cheers for that I now have 2 projects building from a single build.clj, now just to figureout why my connection pool does not work with tools.build but does with depstar, but thats a tools.build issue 🙂
Happy to try to help with that too. What do you mean by "does not work"?
Sure that would be appreciated, so basically it seems to resolve around this metabase/connection-pool or one of its deps like c3p0, the strange thing is I have multiple projects they both call init-database which in turn sets up the connection pool, one works the other exits as soon as it trys to setup the pool. these both use tools.build now previously I used depstar which works and did not hit this issue, its like something that's required is being excluded from the jar. I have been diffing the jar contents but not spotted anything, they are large jars with a lot of files so I could easily be missing it, I chucked in a few (prn) statements and can see them before connection-pool/connection-pool-spec is called but the one directly after fails to be output, bit lost when it comes to diagnosing this sort of issue as I have not needed to previously. curious if there are any good articles out there on this subject, but would appreciate any help your able to give.
Worth pointing out init-database is a shared component for all projects and I can see that the db credentials are identical when running the generated jars.
It just "exits"? No error message?
That is definitely strange. I'll think about it and see if I can suggest any debugging approaches... I don't suppose any of this code is public, is it?
at home now, its an internal company project my only thought is perhaps if it tries to load a postgress class when creating the pool and its not available, I could probably grab the chunk of code from the repo, most likely I will have to create a new project to try and reproduce which is cut down. its strange being that its a shared component and working else where.
the main difference is that one is a cli tool which works mainly for cron tasks the other is a ring api, which is the one failing.
probably copying the project and base and removing things bit by bit would be a good path just time consuming