Skip to content

Moving to git submodules.

Jehan requested to merge wip/Jehan/git-submodules into main

Meson submodules have too many limitations. It looks like git submodules are more what we are looking for:

  • Meson submodules cannot be configured by the main project. We can sync some configuration options with the 'yield' option and modify other options' default values as a workaround, but then the submodule cannot be reconfigured unless by wiping the whole build directory (main GIMP build included!), which will be a huge waste of time and source of issues (people will obviously get into build issues and report is as bugs in our buildsystem). See: https://github.com/mesonbuild/meson/issues/12898
  • Meson submodules are not updated automatically nor is there any way to warn people that they have to update at some point. You have to randomly run meson subprojects update when things don't work. I can see that, again, many people won't think about it and will think that our buildsystem is broken when they will run into problems.

On the other hands, with git submodules, we can just change meson files to be subdirectories meson.build (just like before when directories were in the same module) instead of a separate build. Which means that there is no separate configuration steps and therefore any variable can be normally passed from and to each repositories.

Also even though git doesn't update submodules as well, a git status will warn them at least that the submodule has changes and therefore a git submodule update needs to be run.

Note that you can even set up git to update submodules automatically with a git pull in the main repository by setting submodule.recurse option to true.

All in all, git submodules are simply much more fitting to our needs. To switching to it, away from meson suprojects.

See also: https://git-scm.com/book/en/v2/Git-Tools-Submodules

Merge request reports