Seeking Recommendations: monorepo that is distributed as individual projects #9929
-
I'd like to have a way to organize my build system to support development as a monorepo, while still allowing for distribution of pieces as individual projects in a way that I can automate. The problem I'm facing now is that there is too high of a development overhead when making and testing changes that reach across different modules. This is achievable from an infrastructure perspective, but I can't figure out a way to make the Meson build work. The subproject/project() design makes it seem like I will need a different build system for this case. I'm hoping others have input on patterns that might work to keep Meson in play. What I am not looking for is a debate about whether or not a monorepo is the right choice, why splitting a monorepo into distinct repositories for distribution will never work, or how Meson's subproject philosophy is amazing and I am stupid for not understanding that. I will not engage with any discussions along these lines. Other Notes:
Thankful for any suggestions the community might have! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 13 replies
-
I am also struggling to find a way to use meson in my modular projects. Since my projects use multiple folders for dependencies, Without a better idea, I used My projects also are multi-platform, and I try to adjust various parts of the build programatically, based on the Being stuck with The hack around this was to create a link in the So things are not that merry as I thought, and I'm also interested in finding a better solution to use meson in my projects. |
Beta Was this translation helpful? Give feedback.
-
It's not clear to me what you want to do with this information, surely a project is a project no matter what? Other than that, I think the basic issue here would be solved by something I've wanted for a while to do, but never actually investigated doing. The basic idea would look something like this: The top level meson.build isn't its own project and doesn't build anything. Basically what a monorepo of individual projects is, right? So, instead of using Now the problem is just finding time to implement all this. :D |
Beta Was this translation helpful? Give feedback.
-
Thinking about folders, I'm also wondering if I can structure my build rules in a way that gets me what I want re: context-awareness. A project's top-level meson.build file can contain the project() and standalone infrastructure. Then I could have a folder, maybe The gotcha, of course, is that you can't do this if you need to call |
Beta Was this translation helpful? Give feedback.
-
It is difficult to give exact advise for things like this without further details on what you are actually developing and how, exactly, your things are currently factored in.
Are these project the kind of things that would be fully standalone and could be used on their own or do they only work together? How do you want to split out those projects? Do you want to have projects |
Beta Was this translation helpful? Give feedback.
-
How are the repositories set up? Which things are in their own and which are not? Note that just because you use subprojects it does not mean that you can't have a monorepo for all your stuff. There are people who do that, including having release tarballs that can be built separately. |
Beta Was this translation helpful? Give feedback.
-
Perhaps I'm missing the point, but, apart from maintenance issues, from the point of view of the build process in general and of the meson build process in particular, what is the difference between a mono-repo project with lots of sub-folders, and a modular, multi-repo project, where the dependencies are somehow brought into the development tree (for example by using Git submodules or by relying on a package manager to create copies or links to individual source libraries)? |
Beta Was this translation helpful? Give feedback.
Thinking about folders, I'm also wondering if I can structure my build rules in a way that gets me what I want re: context-awareness.
A project's top-level meson.build file can contain the project() and standalone infrastructure. Then I could have a folder, maybe
build/
, which contains ameson.build
file that describes targets. The top-level project will includebuild/meson.build
, and the project's local meson.build will too.The gotcha, of course, is that you can't do this if you need to call
subdir()
because you'd need a..
in the path (e.g., if you want to go into../src
and../test
)