This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-29
Channels
- # announcements (1)
- # babashka (15)
- # beginners (37)
- # calva (94)
- # cider (3)
- # clj-kondo (17)
- # cljsrn (2)
- # clojure (45)
- # clojure-europe (39)
- # clojure-germany (1)
- # clojure-norway (2)
- # clojurescript (16)
- # component (18)
- # conjure (1)
- # cursive (13)
- # datalevin (3)
- # datomic (12)
- # docker (2)
- # duct (5)
- # eastwood (2)
- # emacs (4)
- # events (8)
- # fulcro (8)
- # inf-clojure (5)
- # kaocha (8)
- # lsp (24)
- # malli (11)
- # meander (3)
- # off-topic (19)
- # polylith (11)
- # remote-jobs (4)
- # sci (61)
- # shadow-cljs (9)
- # spacemacs (34)
- # sql (10)
- # tools-deps (27)
- # xtdb (10)
Can several projects in the same repository, each in their own directory, be requited as git deps?
You could use :local/root
but that will always use the current version of the project in the local filesystem (this is what #polylith uses/suggests).
If you want to pin a project to a specific :git/sha
/`:git/tag` I'm pretty sure you can use it as usual and combine it with the :deps/root
attribute (haven't tried it myself but I don't see why it wouldn't work)
Reference: https://clojure.org/reference/deps_and_cli#_dependencies
How does it play out when two projects within the same repo are requested at the same time?
Well you have to use a different name for each dependency (so you can't use the reverse domain notation) but other than that there shouldn't be any issues, at least in the case of :local/root.
I'm not sure though how well that would work in the case of :deps/root
, sorry.
So using deps/root
will clone the entire repository but recognize the correct deps.edn?
I'm not sure if it clones the entire repository (or if it uses something like git's partial clone) but it seems there's https://github.com/clojure/tools.deps.alpha/blob/c815c440e0521647a590a700cf08d6eb9ad8c1f8/src/main/clojure/clojure/tools/deps/alpha/extensions/deps.clj#L32-L35 regardless
e.g. here we have multiple projects within one repo: https://github.com/babashka/nbb-features/tree/main/features
a git dep with :deps/root will clone the entire repo and then point into a sub path for the dep
if you have multiple, they share the same cloned dir (for a given sha)
I guess more precisely, they share the same git object dir (for all shas) and the same working tree (for a given sha)
Cool, just what I needed. I think that covers everything I need to make a multi module project + build
When using this scheme, if one sub project depends on another can it always refer to it by local root?
yes BUT local deps lose the "git source" tracking and can't be version compared in that way
we have an open issue about this and it's definitely something to be further explored
Maybe that mostly affects external users of the monorepo (which isn't a thing for you)
Question regarding collisions, let's say I have a git repo acme/foo
, with sub modules bar
and bazz
, how can I require them both? How meaningful is the key when I specify a git url?
{com.acme/foo.bar {:git/tag "" :git/sha ""
:git/url ""
:deps/root "./module-bar"}}
They're keys in a map - they have to be unique
What I mean is, if I specify a git repo, does the key matter in any way besides the requirement it be unique?
Official - I accidentally called it a pre release on the announcement originally