CI: use mirrors for GNU tools
cover CI: use mirrors for GNU tools
I have to add one (1) package to the Dockerfile as a new dependency and wanted to build the image to verify it works. I wasn't able to because GNU servers are just not reliable at all.
The git server URL we're using doesn't seem to be a mirrored one, and switching to mirror URLs seem to make fetching possible again.
Unfortunately, we don't have the option to do that for coreboot's dependencies, though we can ask coreboot to download the dependencies through its own mirror, which we do in this series.
---
Quentin Schulz (3):
CI: use GNU mirror for grub (and switch to HTTPS)
CI: use mirror for gnulib dependency of grub
CI: use coreboot mirror for GNU dependencies of coreboot
tools/docker/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
---
base-commit: 8ff90aa64b730c3f511921d4ff79e9f64e625867
change-id: 20251121-gnu-mirror-98bbfa305caa
Best regards,
Signature · 1 line
Quentin Schulz <[email protected]>
PATCH 1/3 CI: use GNU mirror for grub (and switch to HTTPS)
From: Quentin Schulz <[email protected]>
GNU announced they activated mirrors for git servers[1] in May this year.
The main git server keeps being very unreliable and switching to those mirrors seems to improve reliability (albeit somewhat slow).
Yes, the URL in this patch has nothing in common with the URL in the linked mail, it was extracted from the Clone section in the mirrored cgit page[2].
While at it, switch to the HTTPS clone which is "more secure" than git protocol.
[1] https://lists.gnu.org/archive/html/savannah-users/2025-05/msg00002.html
[2] https://cgit.git.savannah.gnu.org/cgit/grub.git/
--- tools/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/docker/Dockerfile +1 -1
@@ -148,7 +148,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ zip # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit -RUN git clone git://git.savannah.gnu.org/grub.git /tmp/grub && \ +RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ cd /tmp/grub && \ git checkout grub-2.12 && \ git config --global user.name "GitLab CI Runner" && \
Signature · 1 line
2.51.1
Re: [PATCH next 1/3] CI: use GNU mirror for grub (and switch to HTTPS)
Quoted 12 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
GNU announced they activated mirrors for git servers[1] in May this year.
The main git server keeps being very unreliable and switching to those mirrors seems to improve reliability (albeit somewhat slow).
Yes, the URL in this patch has nothing in common with the URL in the linked mail, it was extracted from the Clone section in the mirrored cgit page[2].
Quoted 6 lines
While at it, switch to the HTTPS clone which is "more secure" than git protocol.
[1] https://lists.gnu.org/archive/html/savannah-users/2025-05/msg00002.html
[2] https://cgit.git.savannah.gnu.org/cgit/grub.git/Signed-off-by Quentin Schulz <[email protected]>
Signature · 1 line
Tom
PATCH 2/3 CI: use mirror for gnulib dependency of grub
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
grub bootstrap script downloads gnulib from a non-mirror URL and thus is unreliable.
Instead, manually clone the gnulib repo from a mirror URL and pass that repo to the bootstrap script via --gnulib-srcdir.
--- tools/docker/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tools/docker/Dockerfile +4 -3
@@ -148,12 +148,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ zip # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit -RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ +RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \ + git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ cd /tmp/grub && \ git checkout grub-2.12 && \ git config --global user.name "GitLab CI Runner" && \ git config --global user.email [email protected] && \ - ./bootstrap && \ + ./bootstrap --gnulib-srcdir=/tmp/gnulib && \ mkdir -p /opt/grub && \ ./configure --target=aarch64 --with-platform=efi \ CC=gcc \
@@ -218,7 +219,7 @@ RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ make -j$(nproc) && \ ./grub-mkimage -O x86_64-efi -o /opt/grub/grub_x64.efi --prefix= -d \ grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd && \ - rm -rf /tmp/grub + rm -rf /tmp/grub /tmp/gnulib RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \ cd /tmp/qemu && \
Signature · 1 line
2.51.1
Re: [PATCH next 2/3] CI: use mirror for gnulib dependency of grub
Quoted 18 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
grub bootstrap script downloads gnulib from a non-mirror URL and thus is unreliable.
Instead, manually clone the gnulib repo from a mirror URL and pass that repo to the bootstrap script via --gnulib-srcdir.
Signed-off-by Quentin Schulz <[email protected]>--- tools/docker/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/docker/Dockerfile +0
-0
tools/docker/Dockerfile RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ · line 152
Quoted 6 lines
tools/docker/Dockerfile +2
-1@@ -148,12 +148,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ zip # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit -RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ +RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \ + git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \
Right now, the next branch is in a funny spot. Post -rc2 I applied to master some changes to make CI more reliable which also meant that right here we do git clone --depth=1 -b TAG. And doing --depth=1 -b TAG is something we should be doing here for gnulib as well. Since -rc3 is this coming Monday and merge to next shortly after, can you do that and rebase on top then please? Thanks!
Signature · 1 line
Tom
Re: [PATCH next 2/3] CI: use mirror for gnulib dependency of grub
Hi Tom,
Quoted 22 lines · Tom Rini
Quoted 20 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
grub bootstrap script downloads gnulib from a non-mirror URL and thus is unreliable.
Instead, manually clone the gnulib repo from a mirror URL and pass that repo to the bootstrap script via --gnulib-srcdir.
Signed-off-by Quentin Schulz <[email protected]>--- tools/docker/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)tools/docker/Dockerfile +0
-0@@ -148,12 +148,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ zip
Quoted 9 lines
tools/docker/Dockerfile RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ · line 152
Quoted 4 lines
tools/docker/Dockerfile +2
-1# Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit -RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ +RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \ + git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \Right now, the next branch is in a funny spot. Post -rc2 I applied to master some changes to make CI more reliable which also meant that right here we do git clone --depth=1 -b TAG. And doing --depth=1 -b TAG is something we should be doing here for gnulib as well. Since -rc3 is this
No, I'm not sure this is something we can do.
AFAICT (haven't dug too much), grub will checkout a specific commit of gnulib, and that isn't supported by git clone, c.f. https://elixir.bootlin.com/grub/grub-2.12/source/bootstrap.conf#L19
This commit sadly isn't a tagged commit in gnulib (there aren't too many tags in this repo...).
However, I think I took the hammer approach to this, I believe setting GNULIB_URL variable to the mirror URL might be enough.
grub bootstrap script does something to avoid downloading the whole thing, c.f. https://elixir.bootlin.com/grub/grub-2.12/source/bootstrap#L769
I'll try something out and send a v2 if that works.
Quoted 3 lines
coming Monday and merge to next shortly after, can you do that and rebase on top then please? Thanks!
Sure, I only need this to be able to test adding one package to the list installed by apt (5 hours to add one package... that's a new low in term of efficiency for me :) ).
Cheers,
Quentin
Re: [PATCH next 2/3] CI: use mirror for gnulib dependency of grub
Quoted 42 lines · Quentin Schulz
Hi Tom,
Quoted 26 lines · Tom Rini
Quoted 24 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
grub bootstrap script downloads gnulib from a non-mirror URL and thus is unreliable.
Instead, manually clone the gnulib repo from a mirror URL and pass that repo to the bootstrap script via --gnulib-srcdir.
Signed-off-by Quentin Schulz <[email protected]>---
tools/docker/Dockerfile| 7 ++++---1 file changed, 4 insertions(+), 3 deletions(-)tools/docker/Dockerfile +0
-0@@ -148,12 +148,13 @@ RUN --mount=type=cache,target=/var/cache/ apt,sharing=locked \zip
# Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit
-RUN git clone https://eur02.safelinks.protection.outlook.com/?
url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgrub.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378906741%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=RmWBLYSxmADeqbU71Ayjs7BH%2B%2BhBpxU8SBU7bWJ%2BCDA%3D&reserved=0/tmp/grub&& \
+RUN git clone https://eur02.safelinks.protection.outlook.com/?Quoted 8 lines
Quoted 3 lines
url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgnulib.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378938856%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=Dn8RKyWZ%2F5HUQyLZcg08fCK34pPgEXYJ0FckZm%2BId%2B4%3D&reserved=0
/tmp/gnulib&& \
+ git clone https://eur02.safelinks.protection.outlook.com/?
url=https%3A%2F%2Fhttps.git.savannah.gnu.org%2Fgit%2Fgrub.git&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378959547%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=x81uTYbcXZ8xKuPeR87wXKFDjBzFggMxGpmid8uTw1Y%3D&reserved=0/tmp/grub&& \Right now, the next branch is in a funny spot. Post -rc2 I applied to master some changes to make CI more reliable which also meant that right here we do git clone --depth=1 -b TAG. And doing --depth=1 -b TAG is something we should be doing here for gnulib as well. Since -rc3 is this
No, I'm not sure this is something we can do.
AFAICT (haven't dug too much), grub will checkout a specific commit of gnulib, and that isn't supported by git clone, c.f. https:// eur02.safelinks.protection.outlook.com/? url=https%3A%2F%2Felixir.bootlin.com%2Fgrub%2Fgrub-2.12%2Fsource%2Fbootstrap.conf%23L19&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378977923%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=jEjaC%2FTri23TTjwrLCDcVfocG%2F6qEtGgftu9vzBt6Dw%3D&reserved=0
Quoted 8 lines
This commit sadly isn't a tagged commit in gnulib (there aren't too many tags in this repo...).
However, I think I took the hammer approach to this, I believe setting
GNULIB_URLvariable to the mirror URL might be enough.grub bootstrap script does something to avoid downloading the whole thing, c.f. https://eur02.safelinks.protection.outlook.com/? url=https%3A%2F%2Felixir.bootlin.com%2Fgrub%2Fgrub-2.12%2Fsource%2Fbootstrap%23L769&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6268e55bdc1c4b33951208de290eb8d7%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638993340378993930%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kikGeVnXtlyPHiSfeula9p7yEMKentnrHCokBvYa7JM%3D&reserved=0
I'll try something out and send a v2 if that works.
With
"""
tools/docker/Dockerfile +2 -3
@@ -149,13 +149,12 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ zip # Build GRUB UEFI targets for ARM & RISC-V, 32-bit and 64-bit -RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \ - git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ +RUN git clone https://https.git.savannah.gnu.org/git/grub.git /tmp/grub && \ cd /tmp/grub && \ git checkout grub-2.12 && \ git config --global user.name "GitLab CI Runner" && \ git config --global user.email [email protected] && \ - ./bootstrap --gnulib-srcdir=/tmp/gnulib && \ + GNULIB_URL=https://https.git.savannah.gnu.org/git/gnulib.git ./bootstrap && \ mkdir -p /opt/grub && \ ./configure --target=aarch64 --with-platform=efi \ CC=gcc \
@@ -220,7 +219,7 @@ RUN git clone https://https.git.savannah.gnu.org/git/gnulib.git /tmp/gnulib && \ make -j$(nproc) && \ ./grub-mkimage -O x86_64-efi -o /opt/grub/grub_x64.efi --prefix= -d \ grub-core normal echo lsefimmap lsefi lsefisystab efinet tftp minicmd
&& \
- rm -rf /tmp/grub /tmp/gnulib
+ rm -rf /tmp/grub
RUN git clone https://gitlab.com/qemu-project/qemu.git /tmp/qemu && \
cd /tmp/qemu && \
"""
I get
"""
./bootstrap: getting gnulib files...
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
Initialized empty Git repository in /tmp/grub/gnulib/.git/
From https://https.git.savannah.gnu.org/git/gnulib
* branch 9f48fb992a3d7e96610c4ce8be969cff2d61a01b ->FETCH_HEAD
HEAD is now at 9f48fb992 filevercmp: fix several unexpected results
Note: switching to '9f48fb992a3d7e96610c4ce8be969cff2d61a01b'.
You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
HEAD is now at 9f48fb992 filevercmp: fix several unexpected results """
It was slow but it worked. Will go with that for the v2 to send Monday. Ping me if I forget :)
Thanks!
Quentin
PATCH 3/3 CI: use coreboot mirror for GNU dependencies of coreboot
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
coreboot buildgcc script downloads GNU dependencies from GNU FTP server. For some reason, this is also as unreliable as their git main server. There's no option to use a GNU mirror (and I'm not even sure if there's one for FTP), so we simply pass --mirror to the buildgcc script via the BUILDGCC_OPTIONS variable so that it makes use of coreboot's mirror. Hopefully, this proves more reliable than GNU original FTP server.
--- tools/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/docker/Dockerfile +1 -1
@@ -330,7 +330,7 @@ RUN mkdir /tmp/trace && \ # Build coreboot RUN wget -O - https://coreboot.org/releases/coreboot-25.03.tar.xz | tar -C /tmp -xJ && \ cd /tmp/coreboot-25.03 && \ - make crossgcc-i386 CPUS=$(nproc) && \ + make BUILDGCC_OPTIONS="--mirror" crossgcc-i386 CPUS=$(nproc) && \ make -C payloads/coreinfo olddefconfig && \ make -C payloads/coreinfo && \ make olddefconfig && \
Signature · 1 line
2.51.1
Re: [PATCH next 3/3] CI: use coreboot mirror for GNU dependencies of coreboot
Quoted 10 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
coreboot buildgcc script downloads GNU dependencies from GNU FTP server. For some reason, this is also as unreliable as their git main server. There's no option to use a GNU mirror (and I'm not even sure if there's one for FTP), so we simply pass --mirror to the buildgcc script via the
BUILDGCC_OPTIONSvariable so that it makes use of coreboot's mirror. Hopefully, this proves more reliable than GNU original FTP server.Signed-off-by Quentin Schulz <[email protected]>
Signature · 1 line
Tom