Skip to content

[ci] Clear stale git submodule trees in Windows runner cleanup - #5748

Merged
HereThereBeDragons merged 3 commits into
mainfrom
users/lpromber/windows_cleanup_add_git_deinit
Jun 10, 2026
Merged

HereThereBeDragons merged 3 commits into
mainfrom
users/lpromber/windows_cleanup_add_git_deinit

Conversation

@HereThereBeDragons

@HereThereBeDragons HereThereBeDragons commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Non-ephemeral Windows GPU runners are shared across super-repos whose checkouts pin different submodule commits. git reset --hard (run by actions/checkout) does not clear nested submodule working trees, so a newer nested submodule left on disk by a prior job can remain under an older superproject whose .gitmodules lacks its URL.

actions/checkout then runs git submodule foreach --recursive during its auth setup/teardown, descends into that stale tree, and aborts.

To fix this:
Add a step to the shared pre-job cleanup script that empties the top-level submodule working trees left by the prior job. Submodule paths are read with git config -f .gitmodules and the dirs removed with Remove-Item. git submodule deinit is unusable here: a prior job can leave the workspace partially corrupted (submodule URL in .git/config but .git/modules/<name> missing), making deinit abort with could not lock config file .... Physical removal is independent of .git/modules health. Runs before actions/checkout.

Cache-safe: keeps .git/modules objects and touches no untracked or ignored files, so ccache and downloaded deps are preserved.

Fixes #5742

@HereThereBeDragons

Copy link
Copy Markdown
Contributor Author

.github/workflows/test_component.yml and .github/workflows/test_artifacts.yml already have this cleanup_processes step.

@amd-justchen please let me know if htis is a good location for this or you would prefer something different? (new file/rename to general windows cleanup etc)

@cgoea cgoea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HereThereBeDragons HereThereBeDragons changed the title [ci] Deinit stale submodule trees in Windows runner cleanup [ci] Clear stale git submodule trees in Windows runner cleanup Jun 10, 2026
@HereThereBeDragons

Copy link
Copy Markdown
Contributor Author

Test run on rocm-libraries using therock pin from this branch here (+ changes to just run the windows tests):
https://github.com/ROCm/rocm-libraries/actions/runs/27283688359
rocm-libraries branch: https://github.com/ROCm/rocm-libraries/tree/users/lpromber/bump_therock_git_deinit_windows

@HereThereBeDragons

Copy link
Copy Markdown
Contributor Author

run is happy and fixes the problem

@amd-justchen amd-justchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix!

@HereThereBeDragons
HereThereBeDragons merged commit 384834e into main Jun 10, 2026
114 of 135 checks passed
@HereThereBeDragons
HereThereBeDragons deleted the users/lpromber/windows_cleanup_add_git_deinit branch June 10, 2026 17:04
@github-project-automation github-project-automation Bot moved this from TODO to Done in TheRock Triage Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Issue] Error: fatal: No url found for submodule path ... in .gitmodules during TheRock CI jobs in rocm-libraries

3 participants