unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Giovanni Biscuolo <g@xelera.eu>
To: "Ludovic Courtès" <ludo@gnu.org>, zimoun <zimon.toutoune@gmail.com>
Cc: Akib Azmain Turja <akib@disroot.org>, guix-devel@gnu.org
Subject: Re: First guix pull is too costly
Date: Thu, 07 Jul 2022 11:01:34 +0200	[thread overview]
Message-ID: <87tu7ts3dd.fsf@xelera.eu> (raw)
In-Reply-To: <87fsjl3sgm.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2879 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

      reply	other threads:[~2022-07-07  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28  8:04 First guix pull is too costly Akib Azmain Turja
2022-06-28 10:05 ` bokr
2022-06-28 11:23 ` zimoun
2022-06-28 12:28   ` Efraim Flashner
2022-06-28 16:59     ` zimoun
2022-07-01 12:51       ` Ludovic Courtès
2022-07-01 15:25         ` zimoun
2022-06-28 12:49   ` Akib Azmain Turja
2022-06-28 17:09     ` zimoun
2022-06-28 17:40       ` Akib Azmain Turja
2022-07-01 12:52   ` Ludovic Courtès
2022-07-07  9:01     ` Giovanni Biscuolo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu7ts3dd.fsf@xelera.eu \
    --to=g@xelera.eu \
    --cc=akib@disroot.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).