From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: guix build --repair might not always work Date: Sat, 25 Jan 2020 19:06:09 +0100 Message-ID: <878slv8l7y.fsf@gnu.org> References: <87k15ib5d4.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:49442) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ivPoz-0004lo-3V for guix-devel@gnu.org; Sat, 25 Jan 2020 13:06:14 -0500 In-Reply-To: <87k15ib5d4.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me> (=?utf-8?Q?=22Nicol=C3=B2?= Balzarotti"'s message of "Thu, 23 Jan 2020 15:43:35 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: =?utf-8?Q?Nicol=C3=B2?= Balzarotti Cc: Guix-devel Hi, anothersms@gmail.com (Nicol=C3=B2 Balzarotti) skribis: > #+begin_src bash :results list > # This is the broken system > guix gc --verify=3Drepair,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 =E2=80=9Cguix= hash -r=E2=80=9D 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 =E2=80=98--no-grafts=E2=80=99 if you want to repair the ung= rafted variant. > #+begin_src sqlite :eval never > select * from ValidPaths where path =3D "/gnu/store/mwfb8a9mkcn65nfnsnvj3= 9xly9d8qa90-libxft-2.3.3"; > #+end_src > > > #+RESULTS: > | 24700 | /gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3 | sha2= 56:2e3ddbf0882e7d70ee67808b998f1ba9ddeffbefc6efe6252d7b67ad3ab1dd21 | 15797= 15645 | /gnu/store/ajkyhj4qsbzw7kqc4wp9yfzci7r5xgyy-libxft-2.3.3.drv | 1010= 4 | So that=E2=80=99s indeed different from what =E2=80=9Cguix hash -r=E2=80=9D= 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->bytevec= tor "12lx9ar5vb2l4dwgw1cfjqyrfscca4rs6vmnxnza7l8qys97zps3")) $5 =3D "43df7f92f618d1a3beedb66ea333518c69973d968e05fe782354ac5db24a9d8a" --8<---------------cut here---------------end--------------->8--- Thus, =E2=80=98guix gc --verify=3Dcontents=E2=80=99 should report it as cor= rupt. > #+begin_src bash :eval never > sudo mount -o remount,rw /gnu/store > echo "hello" > /gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3/l= ib/libXft.so.2.3.3 > guix build --repair libxft > #+end_src > > > Results: > > #+begin_example > path `/gnu/store/mwfb8a9mkcn65nfnsnvj39xly9d8qa90-libxft-2.3.3' is corrup= ted 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=E2=80=99.