Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 568156 - git-r3 should fetch submodules via the same protocol it uses for main repo
Summary: git-r3 should fetch submodules via the same protocol it uses for main repo
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
Depends on:
Reported: 2015-12-13 12:50 UTC by Alpha Bravo
Modified: 2015-12-24 06:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Alpha Bravo 2015-12-13 12:50:51 UTC
If git-r3 fetches a git-repo via https, it should also use https for the corresponding submodules.
Otherwise fetching those submodules will fail behind a firewall that doesn't allow git-traffic.

Reproducible: Always

Steps to Reproduce:
1. Close firewall-ports used by git protocol
2. Try to emerge e.g.
Actual Results:  
>>> Emerging (1 of 1) dev-libs/wlc-9999::local
>>> Unpacking source...
Initialized empty Git repository in /usr/portage/distfiles/git3-src/Cloudef_wlc.git/
 * Fetching ...
git fetch +HEAD:refs/git-r3/HEAD
remote: Counting objects: 5937, done.
remote: Total 5937 (delta 0), reused 0 (delta 0), pack-reused 5937
Receiving objects: 100% (5937/5937), 1.12 MiB | 1007.00 KiB/s, done.
Resolving deltas: 100% (4327/4327), done.
 * [new ref]                    -> refs/git-r3/HEAD
git symbolic-ref refs/git-r3/dev-libs/wlc/0/__main__ refs/heads/master
Initialized empty Git repository in /usr/portage/distfiles/git3-src/Cloudef_chck.git/
 * Fetching git:// ...
git fetch git:// --prune +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/* +refs/notes/*:refs/notes/* +HEAD:refs/git-r3/HEAD
fatal: unable to connect to[0:]: errno=Connection timed out

 * ERROR: dev-libs/wlc-9999::local failed (unpack phase):
 *   Unable to fetch from any of EGIT_REPO_URI
 * Call stack:
 *, line  133:  Called src_unpack
 *   environment, line 3335:  Called git-r3_src_unpack
 *   environment, line 2444:  Called git-r3_src_fetch
 *   environment, line 2438:  Called git-r3_fetch
 *   environment, line 2376:  Called git-r3_fetch 'git://' 'bd9e54ec54a11a7ee11947836a85d8c67ddf4801' 'dev-libs/wlc/0/lib/chck'
 *   environment, line 2360:  Called die
 * The specific snippet of code:
 *       [[ -n ${success} ]] || die "Unable to fetch from any of EGIT_REPO_URI";

I'd appreciate if somebody can point me to a workaround.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-13 18:23:35 UTC
Well, it's not our fault and we can't really fix it properly. Mostly because there's no guarantee that there is any predictable transformation for different protocol URIs, and I don't really want to hardcode special handling for github and other services that provide multiple protocols.

The correct way of solving this is through relative submodule URIs. Sadly, this is something upstream needs to do. Let's explain this shortly given your example.

The upstream repository is:

and relies on:

So the submodule URI should be:

  uri = ../chck.git

If you'd like, I can submit a pull request upstream with a proper explanation. Should I do that or do you prefer handling it yourself?
Comment 2 Alpha Bravo 2015-12-13 21:51:37 UTC
Thank you, I'll handle it myself.
Comment 3 Alpha Bravo 2015-12-24 06:34:02 UTC
(In reply to Michał Górny from comment #1)

So I tried to handle this myself, but there are objections upstream I can't address. So if you'd like please take a look at