You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Always clone submodules for new source resolvers #1210
This logic applies to all git clones, including those triggered by the new source config. Since submodules defaults to False, no submodules are cloned even when a new source resolver triggers the git clone.
For example, a package configured as:
source:
provider: gitlab-tag-git
project_url: https://gitlab.example/org/project
Would clone without submodules, even though the proposal says it should always clone them (like pip does).
Fix
When the git clone is triggered by a new source resolver (not req.url), always pass submodules=True to gitutils.git_clone() regardless of git_options.submodules. The old git_options.submodules field should only apply to legacy req.url flows.
One approach is to pass a flag to download_git_source() indicating the clone was triggered by a source resolver. Another is to check pbi.source_resolver inside the function.
Consider using gitutils.git_clone_fast() for source-resolver-triggered clones, since it already handles submodules automatically and uses efficient blobless cloning.
My plan was to eventually get rid of git_options settings, the old gitutils.git_clone function and sources.download_git_source functions. In the beginning, we thought that we need to optimize cases where packages have unnecessary submodules. It turned out that only Torch had some submodules that are not required on Linux (Android and Windows stuff). Not cloning submodules breaks packages that use submodules. Cherry-picking submodules is too fragile and breaks every time packages change submodules.
Also see #1227 for a new module that unifies all download helpers in a common module.
Activity
tiran commentedon Jul 3, 2026
My plan was to eventually get rid of
git_optionssettings, the oldgitutils.git_clonefunction andsources.download_git_sourcefunctions. In the beginning, we thought that we need to optimize cases where packages have unnecessary submodules. It turned out that only Torch had some submodules that are not required on Linux (Android and Windows stuff). Not cloning submodules breaks packages that use submodules. Cherry-picking submodules is too fragile and breaks every time packages change submodules.Also see #1227 for a new module that unifies all download helpers in a common module.