From: "Ludovic Courtès" <ludo@gnu.org>
To: "Nicolò Balzarotti" <anothersms@gmail.com>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: guix build --repair might not always work
Date: Sat, 25 Jan 2020 19:06:09 +0100 [thread overview]
Message-ID: <878slv8l7y.fsf@gnu.org> (raw)
In-Reply-To: <87k15ib5d4.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> ("Nicolò Balzarotti"'s message of "Thu, 23 Jan 2020 15:43:35 +0100")
Hi,
anothersms@gmail.com (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’.
next prev parent reply other threads:[~2020-01-25 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 14:43 guix build --repair might not always work Nicolò Balzarotti
2020-01-25 18:06 ` Ludovic Courtès [this message]
2020-03-02 16:39 ` zimoun
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=878slv8l7y.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=anothersms@gmail.com \
--cc=guix-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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
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.