All of lore.kernel.org
 help / color / mirror / Atom feed
From: Collin Funk <collin.funk1@gmail.com>
To: Andrew Hamilton <adhamilt@gmail.com>
Cc: grub-devel@gnu.org,  daniel.kiper@oracle.com,  ghetman@gmail.com
Subject: Re: [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
Date: Sat, 23 Aug 2025 14:44:53 -0700	[thread overview]
Message-ID: <87o6s5k90q.fsf@gmail.com> (raw)
In-Reply-To: <20250823212221.61966-2-adhamilt@gmail.com>

Andrew Hamilton <adhamilt@gmail.com> writes:

> Update the bootstrap script to be compatible with newer versions
> of GIT that changed the git clone -h output from containing:
> "--depth"
> to:
> "--[no-]depth"
> Use a regular expression that will support either.
> In the future, when GNULIB version is bumped, this bootstrap
> change can be replaced by the latest GNULIB bootstrap script
> as it appears GNULIB bootstrap now assumes GIT supports the
> depth option. This change avoids a full clone on GNULIB, saving
> something like 50 MB.
>
> Fixes: https://savannah.gnu.org/bugs/?66357
>
> Signed-off-by: Andrew Hamilton <adhamilt@gmail.com>
> ---
>  bootstrap | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/bootstrap b/bootstrap
> index dc2238f4a..be8d3582e 100755
> --- a/bootstrap
> +++ b/bootstrap
> @@ -762,11 +762,11 @@ if $use_gnulib; then
>  
>        shallow=
>        if test -z "$GNULIB_REVISION"; then
> -        git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
> +        git clone -h 2>&1 | grep -E -- '--(\[no-\])?depth' > /dev/null && shallow='--depth 2'
>          git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
>            || cleanup_gnulib
>        else
> -        git fetch -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
> +        git fetch -h 2>&1 | grep -E -- '--(\[no-\])?depth' > /dev/null && shallow='--depth 2'
>          mkdir -p "$gnulib_path"
>          # Only want a shallow checkout of $GNULIB_REVISION, but git does not
>          # support cloning by commit hash. So attempt a shallow fetch by commit

Hi, thank for you the patch. But I think it is better to just update the
file from Gnulib. The version used by Grub is old and missing many
improvements/fixes:

    $ grep '^scriptversion=' bootstrap
    scriptversion=2022-01-26.05; # UTC

Here is the updated version:

    $ cp $GNULIB_SRCDIR/build-aux/bootstrap .
    $ grep '^scriptversion=' bootstrap
    scriptversion=2025-06-10.02; # UTC

The issue this patch addresses is fixed in Gnulib with this commit:

    commit e319c0feea5088fe7774f44919756a54e963d1ac
    Author:     Bruno Haible <bruno@clisp.org>
    AuthorDate: Sun Feb 16 13:43:40 2025 +0100
    Commit:     Bruno Haible <bruno@clisp.org>
    CommitDate: Sun Feb 16 13:45:35 2025 +0100
    
        bootstrap: Fix recognition of --depth option with recent git releases.
        
        Reported by Benno Schulenberg <bensberg@telfort.nl> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2025-02/msg00106.html>.
        
        * top/bootstrap-funclib.sh (prepare_GNULIB_SRCDIR): Assume that
        'git clone' and 'git fetch' support the --depth option.
        * build-aux/bootstrap: Regenerated.

Thanks,
Collin

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

  reply	other threads:[~2025-08-23 22:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-23 21:22 [PATCH 0/1] bootstrap: Reduce GNULIB Size on Newer GIT Andrew Hamilton
2025-08-23 21:22 ` [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works " Andrew Hamilton
2025-08-23 21:44   ` Collin Funk [this message]
2025-08-23 22:01     ` Andrew Hamilton
2025-08-23 22:34       ` Collin Funk
2025-08-23 22:37         ` Andrew Hamilton

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

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

  git send-email \
    --in-reply-to=87o6s5k90q.fsf@gmail.com \
    --to=collin.funk1@gmail.com \
    --cc=adhamilt@gmail.com \
    --cc=daniel.kiper@oracle.com \
    --cc=ghetman@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.