* build(git): check only the submodules a build needs
Tools/check_submodules.sh fetches every missing submodule, so a build that uses a handful of PX4 libraries still clones NuttX, the simulators and the middleware. Paths given as arguments now limit the check, and the configure step passes PX4_GIT_SUBMODULES when it is set. Builds that do not set it check all submodules as before. A path that is not a submodule, or a submodule the build uses but that is not checked out, stops the configure instead of failing later in the build.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* docs(dev_setup): document PX4_GIT_SUBMODULES
The submodule check can be limited to the submodules a build needs. List the variable next to GIT_SUBMODULES_ARE_EVIL, the other way to control the check.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
* test(git): cover the submodule check limited to given paths
A second top-level submodule gives the tests one to leave out, so they check that paths given to check_submodules.sh limit both the fetch of missing submodules and the report of changed ones, and that a path that is not a submodule fails the check.
Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
---------
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Every px4_add_git_submodule call ran check_submodules.sh twice, at
configure and build time, and with CI=true force-updated each submodule
every time, a 2017 workaround for an interactive prompt that is gone.
VS Code and CLion force-updated too, resetting submodule changes under
development.
The check now runs once per configure. A missing submodule is fetched;
one at another commit is kept as it is, with a warning locally and an
error in CI.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>