* [PATCH 0/1] bootstrap: Reduce GNULIB Size on Newer GIT
@ 2025-08-23 21:22 Andrew Hamilton
2025-08-23 21:22 ` [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works " Andrew Hamilton
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Hamilton @ 2025-08-23 21:22 UTC (permalink / raw)
To: grub-devel; +Cc: daniel.kiper, ghetman, Andrew Hamilton
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>
Andrew Hamilton (1):
bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
bootstrap | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.47.2
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
2025-08-23 21:22 [PATCH 0/1] bootstrap: Reduce GNULIB Size on Newer GIT Andrew Hamilton
@ 2025-08-23 21:22 ` Andrew Hamilton
2025-08-23 21:44 ` Collin Funk
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Hamilton @ 2025-08-23 21:22 UTC (permalink / raw)
To: grub-devel; +Cc: daniel.kiper, ghetman, Andrew Hamilton
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
--
2.47.2
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
2025-08-23 21:22 ` [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works " Andrew Hamilton
@ 2025-08-23 21:44 ` Collin Funk
2025-08-23 22:01 ` Andrew Hamilton
0 siblings, 1 reply; 6+ messages in thread
From: Collin Funk @ 2025-08-23 21:44 UTC (permalink / raw)
To: Andrew Hamilton; +Cc: grub-devel, daniel.kiper, ghetman
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
2025-08-23 21:44 ` Collin Funk
@ 2025-08-23 22:01 ` Andrew Hamilton
2025-08-23 22:34 ` Collin Funk
0 siblings, 1 reply; 6+ messages in thread
From: Andrew Hamilton @ 2025-08-23 22:01 UTC (permalink / raw)
To: Collin Funk; +Cc: grub-devel, daniel.kiper, ghetman
[-- Attachment #1.1: Type: text/plain, Size: 3554 bytes --]
Thank you for the input, I considered updating the bootstrap script from
GNULIB to latest but decided it may be considered a higher risk change for
the upcoming 2.14 release. Maybe I should investigate this further.
Do you happen to know if there is any dependency between the newer
bootstrap script and the latest GNULIB version? If not, I can give it a
shot to pull in the latest bootstrap script if Daniel thinks that is still
within scope for 2.14.
Thanks,
Andrew
On Sat, Aug 23, 2025 at 4:44 PM Collin Funk <collin.funk1@gmail.com> wrote:
> 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
>
[-- Attachment #1.2: Type: text/html, Size: 4959 bytes --]
[-- Attachment #2: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
2025-08-23 22:01 ` Andrew Hamilton
@ 2025-08-23 22:34 ` Collin Funk
2025-08-23 22:37 ` Andrew Hamilton
0 siblings, 1 reply; 6+ messages in thread
From: Collin Funk @ 2025-08-23 22:34 UTC (permalink / raw)
To: Andrew Hamilton; +Cc: grub-devel, daniel.kiper, ghetman
Andrew Hamilton <adhamilt@gmail.com> writes:
> Thank you for the input, I considered updating the bootstrap script from
> GNULIB to latest but decided it may be considered a higher risk change for
> the upcoming 2.14 release. Maybe I should investigate this further.
>
> Do you happen to know if there is any dependency between the newer
> bootstrap script and the latest GNULIB version? If not, I can give it a
> shot to pull in the latest bootstrap script if Daniel thinks that is still
> within scope for 2.14.
I am not active in Grub development, so I will defer anything related to
the release process/safe changes to them.
But I am a Gnulib committer, so the questions regarding bootstrap are in
my wheelhouse (somewhat :P). The bootstrap script imports files based on
a gnulib submodule (see GNU Grep, Coreutils, etc.) or, in Grub's case,
GNULIB_REVISION in bootstrap.conf. It doesn't depend on anything else in
Gnulib. It simply clones Gnulib, checks-out the correct commit, then
runs autoreconf, libtoolize, autopoint, or whatever else the package
uses.
Generally GNU packages do not distribute the bootstrap script in
tarballs as they should contain all Gnulib source files and the
generated configure script. This allows someone to build the package
without having autoconf, automake, etc. installed.
That is the long way of explaining that updating bootstrap should not be
problematic. :)
Collin
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] bootstrap: Ensure shallow GNULIB clone Works on Newer GIT
2025-08-23 22:34 ` Collin Funk
@ 2025-08-23 22:37 ` Andrew Hamilton
0 siblings, 0 replies; 6+ messages in thread
From: Andrew Hamilton @ 2025-08-23 22:37 UTC (permalink / raw)
To: Collin Funk; +Cc: grub-devel, daniel.kiper, ghetman
[-- Attachment #1.1: Type: text/plain, Size: 1813 bytes --]
Ah, thank you for clarifying and the great suggestion.
I'll pull in the latest bootstrap from gnulib and send it out for review
hopefully this evening for the Grub maintainer's consideration.
Thank you!
Andrew
On Sat, Aug 23, 2025 at 5:34 PM Collin Funk <collin.funk1@gmail.com> wrote:
> Andrew Hamilton <adhamilt@gmail.com> writes:
>
> > Thank you for the input, I considered updating the bootstrap script from
> > GNULIB to latest but decided it may be considered a higher risk change
> for
> > the upcoming 2.14 release. Maybe I should investigate this further.
> >
> > Do you happen to know if there is any dependency between the newer
> > bootstrap script and the latest GNULIB version? If not, I can give it a
> > shot to pull in the latest bootstrap script if Daniel thinks that is
> still
> > within scope for 2.14.
>
> I am not active in Grub development, so I will defer anything related to
> the release process/safe changes to them.
>
> But I am a Gnulib committer, so the questions regarding bootstrap are in
> my wheelhouse (somewhat :P). The bootstrap script imports files based on
> a gnulib submodule (see GNU Grep, Coreutils, etc.) or, in Grub's case,
> GNULIB_REVISION in bootstrap.conf. It doesn't depend on anything else in
> Gnulib. It simply clones Gnulib, checks-out the correct commit, then
> runs autoreconf, libtoolize, autopoint, or whatever else the package
> uses.
>
> Generally GNU packages do not distribute the bootstrap script in
> tarballs as they should contain all Gnulib source files and the
> generated configure script. This allows someone to build the package
> without having autoconf, automake, etc. installed.
>
> That is the long way of explaining that updating bootstrap should not be
> problematic. :)
>
> Collin
>
[-- Attachment #1.2: Type: text/html, Size: 2327 bytes --]
[-- Attachment #2: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-08-23 22:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-08-23 22:01 ` Andrew Hamilton
2025-08-23 22:34 ` Collin Funk
2025-08-23 22:37 ` Andrew Hamilton
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 NNTP newsgroup(s).