Skip to content

ci: rename Checkout third-party submodules step -> Checkout mrbind submodules#5991

Closed
Fedr wants to merge 2 commits intomasterfrom
ci/simplify-checkout-mrbind-submodules
Closed

ci: rename Checkout third-party submodules step -> Checkout mrbind submodules#5991
Fedr wants to merge 2 commits intomasterfrom
ci/simplify-checkout-mrbind-submodules

Conversation

@Fedr
Copy link
Copy Markdown
Contributor

@Fedr Fedr commented Apr 26, 2026

Summary

Make every workflow that runs the Checkout … submodules two-step pattern look the same:

  1. parent Checkout does submodules: true (shallow-cloning all 29 top-level submodules at the parent's fetch-depth: 1),
  2. a single follow-up step recursively fetches only thirdparty/mrbind's nested sub-submodule (deps/cppdecl) — the only path under thirdparty/ that has its own .gitmodules.

Why

Of the 29 top-level submodules in MeshLib, only thirdparty/mrbind has nested sub-submodules. So the second step is genuinely only about mrbind on every workflow — but the previous step name ("Checkout third-party submodules") suggested a broader scope, and most workflows had a long selective list of submodules in the git submodule update line that hid the actual intent and caused drift between workflows.

$ for sm in thirdparty/mrbind thirdparty/imgui thirdparty/eigen \
            thirdparty/parallel-hashmap thirdparty/mrbind-pybind11 \
            thirdparty/fastmcpp thirdparty/nlohmann-json thirdparty/cpp-httplib ; do
    echo "=== $sm ==="
    [ -f $sm/.gitmodules ] && cat $sm/.gitmodules || echo "(no .gitmodules)"
done
=== thirdparty/mrbind ===
[submodule "deps/cppdecl"]
        path = deps/cppdecl
        url = https://github.com/MeshInspector/cppdecl
=== thirdparty/imgui ===          (no .gitmodules)
=== thirdparty/eigen ===          (no .gitmodules)
=== thirdparty/parallel-hashmap ===   (no .gitmodules)
=== thirdparty/mrbind-pybind11 ===    (no .gitmodules)
=== thirdparty/fastmcpp ===       (no .gitmodules)
=== thirdparty/nlohmann-json ===  (no .gitmodules)
=== thirdparty/cpp-httplib ===    (no .gitmodules)

Files changed (8 workflows)

Workflow Change
build-test-macos.yml step renamed + comment expanded (parent already had submodules: true; submodule list already only thirdparty/mrbind)
build-test-windows.yml same as macos
build-test-emscripten.yml + submodules: true on parent; submodule list trimmed to just thirdparty/mrbind; step renamed
build-test-linux-vcpkg.yml same
build-test-ubuntu-arm64.yml same
build-test-ubuntu-x64.yml same
pip-build.yml same; also drops the per-submodule safe.directory lines that only existed for the previous selective-list approach
update-docs-manual.yml same

Trade-off

Six of the eight workflows previously fetched only a 4-6 submodule selective list (no submodules: true on parent). Adding submodules: true makes the parent shallow-clone all 29 top-level submodules at depth 1 — the heavy ones (openvdb, GDCM, libE57Format, mbedtls, onetbb, opencascade-related) are now fetched even though the docker image already provides them pre-built. With depth 1 over GitHub's fast remote this adds an estimated 20–50 s per matrix leg, and is paid in parallel with other parts of the checkout — small relative to multi-minute build times.

In exchange, the workflow code becomes much easier to reason about: every "Checkout / Checkout mrbind submodules" pair across the repo now does the same thing.

Net diff

+69 / −32 across 8 files, two commits:

  • b7e8069c — macos + windows rename only
  • 161b3cfa — extend pattern to the other six workflows

🤖 Generated with Claude Code

Fedr and others added 2 commits April 26, 2026 16:07
…odules"

The step exists in two workflows -- build-test-macos.yml and
build-test-windows.yml -- which already use `submodules: true` on the
parent `actions/checkout`, then run a targeted recursive submodule
update for `thirdparty/mrbind` only. The previous step name suggested
a broader scope; the new name reflects what the step actually does
(of the 29 top-level submodules under thirdparty/, only mrbind has
nested sub-submodules -- specifically thirdparty/mrbind/deps/cppdecl).

Also expand the inline comment from a one-liner to four lines that
spell out:
  - what the parent checkout already did,
  - which submodule has nested sub-submodules and why we recurse only
    there,
  - the perf reason we don't `submodules: recursive` on the parent.

The other six workflows that have a `Checkout third-party submodules`
step (build-test-emscripten, build-test-linux-vcpkg,
build-test-ubuntu-{arm64,x64}, pip-build, update-docs-manual) do NOT
set `submodules: true` on their parent checkout. Their step's longer
submodule list is doing the actual top-level init for selected
submodules and cannot be simplified without breaking those builds.
Left untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Earlier commit on this branch renamed and simplified the second
checkout step on macos and windows workflows where the parent
`actions/checkout` already had `submodules: true`. The other six
workflows -- build-test-emscripten, build-test-linux-vcpkg,
build-test-ubuntu-{arm64,x64}, pip-build, update-docs-manual --
deliberately fetched only a selective list of submodules without
setting `submodules: true` on the parent.

This commit aligns those six workflows with the macos/windows pattern:

  - Add `submodules: true` to the parent `actions/checkout`. With
    `actions/checkout@v6`'s default `fetch-depth: 1`, the action
    shallow-clones every top-level submodule (29 in MeshLib's
    .gitmodules), at depth 1.
  - Simplify the next step to a single `git submodule update --init
    --recursive --depth 1 thirdparty/mrbind` -- only thirdparty/mrbind
    has its own .gitmodules (deps/cppdecl), so that's the only path
    that needs targeted recursion.
  - Rename the step to "Checkout mrbind submodules".
  - Drop the per-submodule `safe.directory` lines on pip-build that
    only existed for the previous selective-list approach.

Trade-off: the parent checkout now shallow-clones ~24 extra submodules
on each of these legs (the ones the selective list deliberately
skipped, mostly heavy ones like openvdb, GDCM, libE57Format, mbedtls
that the docker image provides pre-built). At depth 1 over the parent
repo's fast remote, this adds an estimated 20-50 s per leg. Worth it
for a single uniform pattern across every workflow that uses this
step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Fedr
Copy link
Copy Markdown
Contributor Author

Fedr commented Apr 26, 2026

Direction reversed — replaced by a fresh PR that takes the opposite approach (selective list across all 8 workflows, no submodules: true anywhere).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant