Skip to content

git clone --recurse-submodules fails due to broken submodule references #3

@Heziode

Description

@Heziode

When cloning this repository with --recurse-submodules (as Alire does automatically when resolving dependencies), the clone fails with errors like:

fatal: not a git repository: /tmp/.../modules/scripts/python
BUG: submodule considered for cloning, doesn't need cloning any more?
fatal: not a git repository: /tmp/.../modules/test/python
fatal: not a git repository: /tmp/.../modules/docs/common

The three submodules declared in .gitmodules are affected:

Path URL
scripts/python hybrid_python_scripts
test/python hybrid_test_python
docs/common hybrid_lib_docs

The issue appears to be that the submodule metadata (.git/modules/ references) becomes invalid when Git clones into a temporary directory and then attempts the recursive submodule init. This makes it impossible for package managers like Alire to fetch functional as a dependency without manual intervention.

Workaround: Cloning without --recurse-submodules succeeds, and the library itself builds fine — the submodules don't appear to contain anything required for compilation.

Suggested fix: If those submodules are no longer needed, removing them from .gitmodules and the index would resolve the issue. If they are needed, the submodule URLs may need updating to point to valid repositories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions