GNOME Bugzilla – Bug 682516
dvcs_mirror interacts badly with submodules
Last modified: 2021-05-17 15:53:50 UTC
In my ~/.config/jhbuildrc I have: dvcs_mirror_dir = os.path.expanduser('~/gnome/dvcs') Checkout of gnome-font-viewer fails with: *** Checking out gnome-font-viewer *** [1/1] git clone --mirror ssh://cskeogh@git.gnome.org/git/gnome-font-viewer /home/oxyde/gnome/dvcs/gnome-font-viewer.git Cloning into bare repository '/home/oxyde/gnome/dvcs/gnome-font-viewer.git'... remote: Counting objects: 749, done. remote: Compressing objects: 100% (663/663), done. remote: Total 749 (delta 530), reused 109 (delta 84) Receiving objects: 100% (749/749), 1.52 MiB | 301 KiB/s, done. Resolving deltas: 100% (530/530), done. git clone /home/oxyde/gnome/dvcs/gnome-font-viewer.git Cloning into 'gnome-font-viewer'... done. git remote set-url origin /home/oxyde/gnome/dvcs/gnome-font-viewer.git git remote update origin Fetching origin git pull --rebase Current branch master is up to date. git submodule init Submodule 'libgd' (/home/oxyde/gnome/dvcs/libgd) registered for path 'libgd' git submodule update fatal: repository '/home/oxyde/gnome/dvcs/libgd' does not exist Clone of '/home/oxyde/gnome/dvcs/libgd' into submodule path 'libgd' failed *** Error during phase checkout of gnome-font-viewer: ########## Error running git submodule update *** [1/1]
Only happens with dvcs_mirror_dir set. Works ok without dvcs_mirror_dir set.
# cat build/gnome-font-viewer/.gitmodules [submodule "libgd"] path = libgd url = ../libgd Having trouble with relative url '../libgd' From the docs [1]: This may be either an absolute URL ready to be passed to git-clone(1) or (if it begins with ./ or ../) a location relative to the superproject’s origin repository. [1] http://www.kernel.org/pub/software/scm/git/docs/gitmodules.html
Created attachment 222689 [details] [review] Add skip-build attribute to <autotools> This patch needs attachment 221232 [details] [review] from bug 681289 to be applied first.
Created attachment 222690 [details] [review] doc: document skip-build attribute to <autotools>
Created attachment 222691 [details] [review] 3.6: Add submodule libgd and dependencies Create a "special" module libgd. "special" because libgd is a submodule. Checkout only - skip autogen, skip build and skip install. Checkout is required for "url = ../libgd" within .gitmodules to work with DVCS mirrors (dvcs_mirror_dir set within ~/.config/jhbuildrc). This libgd checkout won't be used for people that don't use dvcs_mirror_dir, so it's a little wasteful. But only a little, because libgd is a very small module. I'm not sure how to solve the bug otherwise.
I really don't like having libgd listed as a real module, then worked around with a new skip-build attribute. Would it be possible instead to have the git checkout phase check and process .gitmodules, when using dvcs_mirror_dir?
Actually I think ../libgd should be discouraged, the only advantage I see is that it gets the git clone over the same transport (ssh over http) than the module, but that can be changed manually if the user wanted to hack on that particular submodule. On the other hand, and apart this bug, using ../libgd would also break a clone of gnome-font-viewer published on another platform, say github.
For reference: https://mail.gnome.org/archives/desktop-devel-list/2012-August/msg00145.html
I agree, and I don't like my solution either, but I was out of ideas. I'll wait on the remove ../libgd discussion. If no outcome occurs in two weeks, I'll look at processing .gitmodules. (Also, you can't process submodules using --recurse-submodules as it doesn't work with --mirror)
Created attachment 297554 [details] neat little python script This is a python script that I've been working on. I think the solution to this bug is going to end up looking quite a lot like this, and I don't want to lose it, so I'm attaching it here.
I'd look at what gnome-continuous does for submodules; it has a lot of subtleties for doing a full recursive mirror: https://git.gnome.org/browse/gnome-continuous/tree/src/js/vcs.js
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/135.