guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guix build --repair might not always work


From: Ludovic Courtès
Subject: Re: guix build --repair might not always work
Date: Sat, 25 Jan 2020 19:06:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi,

address@hidden (Nicolò Balzarotti) skribis:

> #+begin_src bash :results list
> # This is the broken system
> guix gc --verify=repair,contents
> #+end_src
>
>
> #+RESULTS:
> - reading the store...
> - checking path existence...
> - checking hashes...
>
> And nothing else.  So, let's check the hash

In particular, you should compare the actual hash returned by “guix hash
-r” with that stored in the local database.  If they match, then the
store item is not considered corrupt.

> The manual also suggests this command:
>
> #+begin_src bash :results table :dir /sudo:localhost:
> # This is the broken system
> guix build --repair libxft
> #+end_src

You should pass ‘--no-grafts’ if you want to repair the ungrafted
variant.

> #+begin_src sqlite :eval never
> select * from ValidPaths where path = 
> "/gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3";
> #+end_src
>
>
> #+RESULTS:
> | 24700 | /gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3 | 
> sha256:2e3ddbf0882e7d70ee67808b998f1ba9ddeffbefc6efe6252d7b67ad3ab1dd21 | 
> 1579715645 | /gnu/store/ajkyhj4qsbzw7kqc4wp9yfzci7r5xgyy-libxft-2.3.3.drv | 
> 10104 |

So that’s indeed different from what “guix hash -r” returned:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> ,use(guix base32)
scheme@(guile-user)> ,use(guix base16)
scheme@(guile-user)> (bytevector->base16-string (nix-base32-string->bytevector 
"12lx9ar5vb2l4dwgw1cfjqyrfscca4rs6vmnxnza7l8qys97zps3"))
$5 = "43df7f92f618d1a3beedb66ea333518c69973d968e05fe782354ac5db24a9d8a"
--8<---------------cut here---------------end--------------->8---

Thus, ‘guix gc --verify=contents’ should report it as corrupt.

> #+begin_src bash :eval never
> sudo mount -o remount,rw /gnu/store
> echo "hello" > 
> /gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3/lib/libXft.so.2.3.3
> guix build --repair libxft
> #+end_src
>
>
> Results:
>
> #+begin_example
> path `/gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3' is corrupted 
> or missing!
> applying 2 grafts for 
> /gnu/store/ajkyhj4qsbzw7kqc4wp9yfzci7r5xgyy-libxft-2.3.3.drv...
> grafting '/gnu/store/844ngi6h6icrc3kkmxc1rni4pvwijhzg-libxft-2.3.3' -> 
> '/gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3'...
> successfully built 
> /gnu/store/ajkyhj4qsbzw7kqc4wp9yfzci7r5xgyy-libxft-2.3.3.drv
> /gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3
> #+end_example

This seems good, no?

I guess we need tests for the repair functionality (repairing itself is
currently untested for the reasons explained in tests/store.scm:901, but
we could arrange to test it somehow.)

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]