- Notifications
You must be signed in to change notification settings - Fork82
Splitting a large Meson project into multiple pyprojects#685
-
At Sagemath, we have the following wish-list for our Meson build:
One important aspect is that these addon's have additional external dependencies that are not (necessarily) shared by the "standard" installation. I wanted to ask if someone has experience with a similar setup and can recommend an approach for implementing it?
|
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 4 replies
-
Interesting question - and great to see Sagemath working on a Meson build!
It isn't. Install tags are purely an install-time feature; all targets gets built even if they don't get installed. It works well for something like "don't include the test suite in the wheel", but not for conditional dependency detection or other conditional build steps.
Subprojects are designed for external dependencies; my gut feel here is that they can be made to work for your use case, but aren't the best choice given that your project is in a single large repo and the addons you're trying to enable/disable aren't really external.
This seems like the way to go. Important question: are these addons each in their own subdirectory? If so, then I think this shouldn't be hard: move the |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks a lot! These are very valuable insights. These addons are mostly in their own subfolders, but not always (we might or might not want to change this - the jury is not yet out on this). There are also ideas floating in the room to extract at least some of the addons to completely independent repositories. I have the feeling that subprojects would serve as a temporary middle way where the addons are still in the same repo but a bit more independent from the main code. Does this change your gutt feeling about using subprojects for this purpose or do you still prefer the boolean-variable approach?
Just to make sure that I parse this sentence correctly: one still needs to have a separate pyproject.toml + main meson.build file for each addon - just that the latter is really simple and sets only the project metadata and then includes the meson build file of the addon, right? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Not sure without trying. Both methods are easy to evolve into moving the add-on to a separate repo. And for the add-ons that aren't completely isolated, I think subprojects aren't an option. One advantage of subprojects is that it's slightly cleaner to have a separate
I think yes, but now I am unsure of parsing that sentence, so let me sketch it out. The repo will look like: The ifget_option('addon1_standalone')# build option, defined in meson.optionsproject('addon1','c','cython' )# add meson_version, default_options, etc. as neededendif The Then to build your wheels: |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Ah, this is an interesting idea. But sadly it doesn't seem to work. With the I did a bit more research and it seems people recommend subprojects in this case (e.g.mesonbuild/meson#6404 andmesonbuild/meson#9929). An alternative approach would be to have an |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ahh that's too bad. The table inmeson#6406-comment summarizes it well: ![]() There will be some limitations though I expect, for the "have one monolithic project for local development" use case. For one, the add-on has to be a namespace package for it to show up in-tree in the monolithic mode (but that's okay still). More importantly, I suspect editable installs for the monolithic mode won't work for the add-ons in subprojects. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
