Is there any guidance for using pantsbuild with mu...
# general
s
Is there any guidance for using pantsbuild with multi-repos that may have dependencies?
2
h
To clarify the question, is this similar to https://pantsbuild.slack.com/archives/C046T6T9U/p1644225676154729 ?
s
I think so, I didn’t have this particular mechanism in mind, but was looking for guidance how to use pants with multiple repositories. The options I could think of: • Build packages and publish to and consume from language specific repositories • Use git submodules and reference pants targets • A pants specific mechanism like the http_archive for bazel Just in general: What’s pants approach here?
I was using submodules as I had some configuration files that I wanted to share across repositories
w
cc @worried-bird-21785: bringing the conversation into this thread
there is a (lightly used, so possibly a little bit rough) facility to support git submodules: https://www.pantsbuild.org/docs/reference-global#section-subproject-roots
if your subprojects have compatible BUILD files to the parent project, you can add them as submodules, and then add those submodules to the
subproject_roots
list
but when i say “have compatible BUILD files”, i mean: the
pants.toml
of any subprojects will be completely ignored, so they need to be 100% compatible.
as mentioned, this is rarely used: lots of folks are creating monorepos at the same time as they migrate to Pants, rather than creating multiple Pants repositories and then merging them.
but it should work.
s
Thanks, that’s great! Personally I’m not converting to using a monorepo, but want to use Pant’s to build a repo that is e.g. scoped to stuff that makes a “service in the cloud” like some lambda functions and a container and the deployment code for that.
I don’t intend to merge it with the other repos it depends on.