Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using elfutils GitHub mirror for submodule #81

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

danielocfb
Copy link
Collaborator

Commit 9ed58f7 ("elfutils: use https protocol for submodule") seems to be causing issues in dependent projects in that it appears as if Cargo, when attempting to clone/update the elfutils git submodule now, fails doing so:

Updating git submodule `https://sourceware.org/git/elfutils.git`

warning: spurious network error (3 tries remaining): early EOF; class=Net (12); code=Eof (-20)
warning: spurious network error (2 tries remaining): early EOF; class=Net (12); code=Eof (-20)
warning: spurious network error (1 tries remaining): early EOF; class=Net (12); code=Eof (-20)
error: failed to load source for dependency libbpf-sys

Caused by:
Unable to update https://github.com/libbpf/libbpf-sys.git?rev=9ed58f7dd737496396b6ea052e771539b3c76e8c

Caused by:
failed to update submodule elfutils

Caused by:
failed to fetch submodule elfutils from https://sourceware.org/git/elfutils.git

Caused by:
network failure seems to have happened
if a proxy or similar is necessary net.git-fetch-with-cli may help here
https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
early EOF; class=Net (12); code=Eof (-20)

Presumably, that is because of some peculiarities of sourceware.org's Git-over-HTTP support that libgit2 (which I understand is used by Cargo by default) chokes on -- though a more detailed investigation has not been performed.

The suggested git-fetch-with-cli workaround does the job, but for reasons probably pertaining how Cargo sources config.toml files, such a setting in libbpf-sys itself won't be honored in the dependent repository. That means that each dependent repository would need to enshrine this setting in its own Cargo configuration.

With this change we pull out the big guns and switch to a custom mirror of sourceware's elfutils on GitHub. We already pull all other submodules from GitHub and don't update elfutils all that frequently, so this seems like a reasonable forward.

Commit 9ed58f7 ("elfutils: use https protocol for submodule") seems
to be causing issues in dependent projects in that it appears as if
Cargo, when attempting to clone/update the elfutils git submodule now,
fails doing so:
  >     Updating git submodule `https://sourceware.org/git/elfutils.git`
  > warning: spurious network error (3 tries remaining): early EOF; class=Net (12); code=Eof (-20)
  > warning: spurious network error (2 tries remaining): early EOF; class=Net (12); code=Eof (-20)
  > warning: spurious network error (1 tries remaining): early EOF; class=Net (12); code=Eof (-20)
  > error: failed to load source for dependency `libbpf-sys`
  >
  > Caused by:
  >   Unable to update https://github.com/libbpf/libbpf-sys.git?rev=9ed58f7dd737496396b6ea052e771539b3c76e8c
  >
  > Caused by:
  >   failed to update submodule `elfutils`
  >
  > Caused by:
  >   failed to fetch submodule `elfutils` from https://sourceware.org/git/elfutils.git
  >
  > Caused by:
  >   network failure seems to have happened
  >   if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
  >   https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
  >
  > Caused by:
  >   early EOF; class=Net (12); code=Eof (-20)

Presumably, that is because of some peculiarities of sourceware.org's
Git-over-HTTP support that libgit2 (which I understand is used by Cargo
by default) chokes on -- though a more detailed investigation has not
been performed.

The suggested git-fetch-with-cli workaround does the job, but for
reasons probably pertaining how Cargo sources config.toml files, such a
setting in libbpf-sys itself won't be honored in the dependent
repository. That means that each dependent repository would need to
enshrine this setting in its own Cargo configuration.

With this change we pull out the big guns and switch to a custom mirror
of sourceware's elfutils on GitHub. We already pull all other submodules
from GitHub and don't update elfutils all that frequently, so this seems
like a reasonable forward.

Signed-off-by: Daniel Müller <deso@posteo.net>
Copy link
Member

@anakryiko anakryiko left a comment

Choose a reason for hiding this comment

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

Let's do it.

@alexforster alexforster self-assigned this Apr 1, 2024
@alexforster alexforster added the enhancement New feature or request label Apr 1, 2024
@alexforster alexforster merged commit 71ca96f into libbpf:master Apr 1, 2024
7 checks passed
@danielocfb danielocfb deleted the topic/elfutils-mirror branch April 8, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants