Skip to content

Failed to update git submodule of dependency  #9622

Open
@saruman9

Description

Problem

Cargo can't clone/update a git submodule of dependency, for example redbpf crate, which contains submodule libbpf.

Steps

  1. cargo new cargo_issue_git_submodule
  2. cd cargo_issue_git_submodule
  3. echo 'redbpf = { git = "https://github.com/foniod/redbpf" }' >> Cargo.toml
  4. cargo check

And we will get an error:

error: failed to get `redbpf` as a dependency of package `cargo_issue_git_submodule v0.1.0 (/home/user/cargo_issue_git_submodule)`

Caused by:
  failed to load source for dependency `redbpf`

Caused by:
  Unable to update https://github.com/foniod/redbpf

Caused by:
  failed to update submodule `bpf-sys/libbpf`

Caused by:
  object not found - no match for id (5a10cd2060c19959e2c55ee33421baa358c09c0b); class=Odb (9); code=NotFound (-3)

Possible Solution(s)

Update submodule manually in ~/.cargo/git/checkouts/redbpf-HASH/b81f069/bpf-sys/libbpf.

Notes

cargo version: cargo 1.55.0

commit of cargo: 4c27c96

Metadata

Assignees

No one assigned

    Labels

    A-gitArea: anything dealing with gitC-bugCategory: bugS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions