[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: First guix pull is too costly
From: |
Giovanni Biscuolo |
Subject: |
Re: First guix pull is too costly |
Date: |
Thu, 07 Jul 2022 11:01:34 +0200 |
Hello Ludo’ and Simon,
Ludovic Courtès <ludo@gnu.org> writes:
[...]
> Does ‘git clone’ do a better job than libgit2/Guile-Git (which is what
> ‘guix pull’ uses) in case it gets disconnected while fetching the repo?
> Is it able to resume when libgit2 isn’t?
>
> (I’d be surprised, but I don’t know.)
AFAIU `git clone` is still not able to resume after a failed connection,
there is a SoC2008 proposal [1] but it seems it was never implemented.
Thanks to this stackoverflow thread:
https://stackoverflow.com/questions/3954852/how-to-complete-a-git-clone-for-a-big-project-on-an-unstable-connection
it seems there are two available workarounds to this problem:
1. Use shallow clone:
git clone --depth=1
git fetch --unshallow
if fetch fails unshallowing due to connection problems, AFAIU the next
"unshallow" will continue fetching more objects until it's done
2. git-bundle [2] some tagged release
The bundle itself is an ordinary file, which you can download any way,
via HTTP/FTP with resume support, via BitTorrent, via rsync, etc. You
can create clone from a bundle, fix configuration [3], and do further
fetches from a proper git repository.
A Guix repo git bundle for every new release, starting from 1.3.0
(1.4?), could be useful for people with slow or unreliable internet
connection.
Could `guix pull` be extended to automatically do this for the user?
I mean: for each channell, `guix pull` could test if the
"channel-bundle" (see below) is available and download it with a
resumable method, then use the git-bundle file to create the clone and
finally fix the remote url in the git configuration.
To define the "channel-bundle" we could add a "bundle" sexp (gexp?) to
the channels.scm file, like this:
--8<---------------cut here---------------start------------->8---
(list (channel
(name 'guix)
(bundle "https://git.savannah.gnu.org/guix-1.3.0.bundle")
(url "https://git.savannah.gnu.org/git/guix.git")
(commit
"a3d86b341d361530127c36fbfbf77d638df2c1de")
(introduction
(make-channel-introduction
"9edb3f66fd807b096b48283debdcddccfea34bad"
(openpgp-fingerprint
"BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA")))))
--8<---------------cut here---------------end--------------->8---
WDYT?
Ciao, Gio'
P.S.: I'm sorry I still cannot help with proper patches to `guix pull`,
I know it's too easy to just describe ideas than to implement it in
code!
[1] https://git.wiki.kernel.org/index.php/SoC2008Ideas#Restartable_Clone
[2] https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-bundle.html
[3] that means fix the url in the [remote "origin"]; we can easily
document it in our manual
--
Giovanni Biscuolo
Xelera IT Infrastructures
signature.asc
Description: PGP signature