This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-14
Channels
- # adventofcode (29)
- # aws (3)
- # babashka (25)
- # beginners (13)
- # calva (4)
- # cherry (7)
- # cider (26)
- # clj-kondo (9)
- # clojure (88)
- # clojure-europe (21)
- # clojure-losangeles (3)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (11)
- # clojuredesign-podcast (2)
- # clojurescript (4)
- # cursive (10)
- # datalevin (1)
- # emacs (50)
- # gratitude (1)
- # honeysql (12)
- # hyperfiddle (19)
- # jobs-discuss (28)
- # kaocha (3)
- # lsp (53)
- # malli (4)
- # meander (3)
- # off-topic (48)
- # re-frame (11)
- # releases (2)
- # ring-swagger (2)
- # shadow-cljs (50)
- # squint (26)
- # tools-build (3)
- # tools-deps (8)
- # xtdb (4)
- # yamlscript (1)
From the documentation it seems like executing something like clj -T:build example
should only look at the deps inside of the build alias and ignore the deps in the main deps build. I was attempting to use a tools.build task to upload some of these dependent jars before executing the main project. However, I encountered some cases where I was switching some top level project dependencies from :local/root coordinates to :mvn/version coordinates where clj -T:build example
attempted to resolve the remote coordinates before they could be uploaded by the task.
After some confusion about this, I realized that this was because the initial build ns used had copied (*def*
*basis* (b/create-basis {:project "deps.edn"}))
from the tools.build example as a top level form. In retrospect it makes sense to me why create-basis
has side-effects and verifies dependencies are downloadable, but it was a bit of an unexpected surprise to discover. Particularly, given the several lines of explanation in the guide describing how the tools deps are isolated from the project deps. It might be an improvement if there was a comment in the examples, or other explanation in the guide or the API docs that explained that create-basis has side-effects? I also wonder if the default examples should calculate the basis on demand for the examples that use it, instead of eagerly as a top level variable?
Thanks so much for the work on this library, hopefully this info can help others using tools.build!
Hi Charles, I guess that could be surprising. Because of the nature of the build program, generally we think it's just fine to def up side-effecting things (somewhat different than application code), but maybe for this particular var that is a bit too far. I logged https://github.com/clojure/clojure-site/issues/680 and will give it a pass when I next look at doc stuff
Thanks, definitely understand why it was the first pass default, just seems worth reconsidering as the use cases expand. Thanks for your consideration of the issue.