NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.99k stars 14.01k forks source link

Build failure: grub2 #346264

Open sh01 opened 3 weeks ago

sh01 commented 3 weeks ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build grub2

Build log

these 2 derivations will be built:
  /nix/store/mqfr1xk19l9k3czwsbg6qka5hnpr0mnf-source.drv
  /nix/store/06bj7iy75xjj586dz43c2ch58zfbm0j0-grub-2.12.drv
building '/nix/store/mqfr1xk19l9k3czwsbg6qka5hnpr0mnf-source.drv'...
error: builder for '/nix/store/mqfr1xk19l9k3czwsbg6qka5hnpr0mnf-source.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-9f48fb992a3d7e96610c4ce8be969cff2d61a01b.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 400
       > error: cannot download source from any mirror
       For full logs, run 'nix log /nix/store/mqfr1xk19l9k3czwsbg6qka5hnpr0mnf-source.drv'.
error: 1 dependencies of derivation '/nix/store/06bj7iy75xjj586dz43c2ch58zfbm0j0-grub-2.12.drv' failed to build

Additional context

Looks like the specified source became unavailable recently. This breaks nixos-rebuild on one of my systems. I ran into this on 24.05, but glancing at the nixpkgs source it looks like it will also affect master.

Notify maintainers

@samueldr

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.60, NixOS, 24.05 (Uakari), 24.05pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - nixpkgs: `/nix/store/884mbvnyz1xbr5y8aqzb87a89q0dlcy7-source

Add a :+1: reaction to issues you find important.

samueldr commented 3 weeks ago

Wrong maintainer. I don't know who picked that up since #321436.

sh01 commented 3 weeks ago

Ah, indeed; I got your username from the 24.05 version of grub/default.nix; sorry for that.

JohnRTitor commented 3 weeks ago

Could be an issue with fetchFromSavannah? https://github.com/NixOS/nixpkgs/blob/f981e40cba3f2d823aa56221eeb1c5f0052fce7e/pkgs/build-support/fetchsavannah/default.nix#L9

I can access https://git.savannah.gnu.org/cgit/gnulib.git just fine just the fetcher fails. Perhaps they changed their API? I can't seem to find any docs on that.

And gnulib should be updated, but I am unable to do so due to this error.

       >
       > trying https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-2dd1a7984c6b3e6056cef7e3f9933e0039c21634.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
       > curl: (22) The requested URL returned error: 400
       > error: cannot download source from any mirror
       For full logs, run 'nix log /nix/store/vwfm92xmfxz6ss1kgj19zrj8d44v8l21-source.drv'.
JohnRTitor commented 3 weeks ago

CC @Mic92 @RossComputerGuy

(I have no idea who to ping)

This will likely cause a lot of build failures without cache.

honnip commented 3 weeks ago

On master:

> nix build --rebuild --keep-failed --print-out-paths --option substitute false .#gnulib
note: keeping build directory '/var/tmp/nix-build-source.drv-0'
error: builder for '/nix/store/w47d02qhwhdp6l1r5k6f1wcyj8ms5hjx-source.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-2dd1a7984c6b3e6056cef7e3f9933e0039c21634.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0
       > curl: (22) The requested URL returned error: 400
       > error: cannot download source from any mirror
       For full logs, run 'nix log /nix/store/w47d02qhwhdp6l1r5k6f1wcyj8ms5hjx-source.drv'.
error: 1 dependencies of derivation '/nix/store/051mw1c68z11g9myqd6d0jcr6x4pivkj-gnulib-20231109.drv' failed to build

(edit: it failed)

Maybe related https://hostux.social/@fsfstatus/113242881236519916

honnip commented 3 weeks ago

https://lists.gnu.org/archive/html/savannah-users/2024-09/msg00009.html

This appears to be a known issue on the mirror.

JohnRTitor commented 3 weeks ago

As the underlying fetchzip is not working/broken in some cases, I propose making fetchFromSavannah more in line with fetchFromGitHub, moving the inner fetchzip to fetchgit.

RossComputerGuy commented 3 weeks ago

Will poke and prod at this when I have the chance. Currently traveling to Orlando so I'm stuck on planes. Should be able to on Saturday.

thundertheidiot commented 1 week ago

I'm pretty sure this can't be closed yet, grub seems to download it's own gnulib instead of relying on the gnulib package.

Grub derivation

gnulib = fetchFromSavannah {
    repo = "gnulib";
    # NOTE: keep in sync with bootstrap.conf!
    rev = "9f48fb992a3d7e96610c4ce8be969cff2d61a01b";
    hash = "sha256-mzbF66SNqcSlI+xmjpKpNMwzi13yEWoc1Fl7p4snTto=";
  };
JohnRTitor commented 1 week ago

We should really fix fetchFromSavanna instead.

thundertheidiot commented 1 week ago

https://git.savannah.gnu.org/gitweb/?p=gnulib.git&view=view+git+repository

It looks like you can get a snapshot from https://git.savannah.gnu.org/gitweb/?p=${repo}.git;a=snapshot;h=${rev};sf=tgz

I made a patch and I'm now trying to test that it actually downloads grub successfully with the same hash. I did not find a nix-build flag that lets me not substitute only one package, so I'm currently building glibc, this will take a while.

thundertheidiot commented 1 week ago

I am pretty sure I have fixed fetchFromSavannah https://github.com/NixOS/nixpkgs/pull/348328

thundertheidiot commented 1 week ago

https://github.com/NixOS/nixpkgs/pull/348328

The issue is not with fetchFromSavannah.

nix-build --expr 'let pkgs = import <nixpkgs> {}; in pkgs.fetchFromSavannah { repo = "grub"; rev = "03e6ea18f6f834f177cad017279bedbb0a3de594"; hash = "sha256-lathsBb2f7urh8R86ihpTdwo3h1hAHnRiHd5gCLVpBc="; }' --check
fetching path input 'path:/nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
checking outputs of '/nix/store/26insl93pj226y8zrgjzch91dc8d2qda-source.drv'...

trying https://git.savannah.gnu.org/cgit/grub.git/snapshot/grub-03e6ea18f6f834f177cad017279bedbb0a3de594.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4977k    0 4977k    0     0  2541k      0 --:--:--  0:00:01 --:--:-- 2540k
unpacking source archive /build/grub-03e6ea18f6f834f177cad017279bedbb0a3de594.tar.gz
/nix/store/q73f2dbr8pmpj8d1cmmsjc0g8s9gl8nd-source
nix-build --expr 'let pkgs = import <nixpkgs> {}; in pkgs.fetchFromSavannah { repo = "gnulib"; rev = "9f48fb992a3d7e96610c4ce8be969cff2d61a01b"; hash = "sha256-mzbF66SNqcSlI+xmjpKpNMwzi13yEWoc1Fl7p4snTto="; }' --check
fetching path input 'path:/nix/store/60sn02zhawl3kwn0r515zff3h6hg6ydz-source'
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
checking outputs of '/nix/store/ifmqapblwzjjr3kh3pvf7g9mdkqjncmn-source.drv'...

trying https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-9f48fb992a3d7e96610c4ce8be969cff2d61a01b.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 400
error: cannot download source from any mirror
error: builder for '/nix/store/ifmqapblwzjjr3kh3pvf7g9mdkqjncmn-source.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://git.savannah.gnu.org/cgit/gnulib.git/snapshot/gnulib-9f48fb992a3d7e96610c4ce8be969cff2d61a01b.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 400
       > error: cannot download source from any mirror
       For full logs, run 'nix log /nix/store/ifmqapblwzjjr3kh3pvf7g9mdkqjncmn-source.drv'.