From mboxrd@z Thu Jan 1 00:00:00 1970 From: csanchezdll@gmail.com (Carlos =?utf-8?Q?S=C3=A1nchez?= de La Lama) Subject: Re: Boostrap tar cannot exec xz Date: Mon, 03 Oct 2016 09:22:29 +0200 Message-ID: <7th98tew22.fsf@gmail.com> References: <7tzimpmyss.fsf@gmail.com> <87eg41kv66.fsf@gnu.org> <7th98xnjq0.fsf@gmail.com> <87k2dsi80c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqxaB-0006Sa-8N for guix-devel@gnu.org; Mon, 03 Oct 2016 03:22:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqxa7-0001Tj-2e for guix-devel@gnu.org; Mon, 03 Oct 2016 03:22:38 -0400 In-Reply-To: <87k2dsi80c.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 01 Oct 2016 14:11:31 +0200") 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.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Hi Ludo, > So apparently, tar 1.27 did not execute xz via /bin/sh, but current tar > does not either: > It does not when extracting, but seems to do when compressing (which is what causes my bootstrapping problem). Your experiment yields similar results here: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build bootstrap-binaries /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0 $ /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar = --version tar (GNU tar) 1.29 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. $ strace -e execve -f /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap= -binaries-0/bin/tar xf ~/foo.tar.xz=20 execve("/gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bi= n/tar", ["/gnu/store/2g5cgcv8fsmaps528jn6n"..., "xf", "/home/csanchez/foo.t= ar.xz"], [/* 25 vars */]) =3D 0 /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: T= his does not look like a tar archive Process 1608 attached [pid 1608] execve("/home/csanchez/bin/xz", ["xz", "-d"], [/* 25 vars */]) = =3D -1 ENOENT (No such file or directory) [pid 1608] execve("/home/csanchez/bin/xz", ["xz", "-d"], [/* 25 vars */]) = =3D -1 ENOENT (No such file or directory) [pid 1608] execve("/home/csanchez/bin/xz", ["xz", "-d"], [/* 25 vars */]) = =3D -1 ENOENT (No such file or directory) [pid 1608] execve("/bin/xz", ["xz", "-d"], [/* 25 vars */]) =3D -1 ENOENT = (No such file or directory) [pid 1608] execve("/sbin/xz", ["xz", "-d"], [/* 25 vars */]) =3D -1 ENOENT= (No such file or directory) [pid 1608] execve("/usr/bin/xz", ["xz", "-d"], [/* 25 vars */]) =3D 0 xz: (stdin): File format not recognized [pid 1608] +++ exited with 1 +++ --- SIGCHLD {si_signo=3DSIGCHLD, si_code=3DCLD_EXITED, si_pid=3D1608, si_ui= d=3D1000, si_status=3D1, si_utime=3D0, si_stime=3D0} --- /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: C= hild returned status 1 /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: E= rror is not recoverable: exiting now +++ exited with 2 +++ --8<---------------cut here---------------end--------------->8--- However, when *compressing*, it needs /bin/sh. --8<---------------cut here---------------start------------->8--- $ touch ~/foo $ strace -f -e execve /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap= -binaries-0/bin/tar cvfa ~/foo.tar.xz ~/foo execve("/gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bi= n/tar", ["/gnu/store/2g5cgcv8fsmaps528jn6n"..., "cvfa", "/home/csanchez/foo= .tar.xz", "/home/csanchez/foo"], [/* 25 vars */]) =3D 0 /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: R= emoving leading `/' from member names /home/csanchez/foo Process 1615 attached [pid 1615] execve("/gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-bash-4.3.42= /bin/sh", ["/gnu/store/eeeeeeeeeeeeeeeeeeeee"..., "-c", "xz"], [/* 25 vars = */]) =3D -1 ENOENT (No such file or directory) tar (child): xz: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now [pid 1615] +++ exited with 2 +++ --- SIGCHLD {si_signo=3DSIGCHLD, si_code=3DCLD_EXITED, si_pid=3D1615, si_ui= d=3D1000, si_status=3D2, si_utime=3D0, si_stime=3D0} --- /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: C= hild returned status 2 /gnu/store/2g5cgcv8fsmaps528jn6np241mkyyidm-bootstrap-binaries-0/bin/tar: E= rror is not recoverable: exiting now +++ exited with 2 +++ --8<---------------cut here---------------end--------------->8--- This is what makes -make-4.2.tar.xz-builder to fail, stopping the bootstrap. >> Another option that just came to my mind is replacing all the nuked >> store referenced in the static binaries with references to the unpacked >> store path after extraction. As the nuked references can be easily >> identified by the "eeeeee..." fake path, this should be doable. > > That=E2=80=99s not doable because we don=E2=80=99t know the hash in advan= ce. When creating the tarball, we don't know the hash it will have when extracted, so the references are nuked. But when creating the package from the tarball, in the bootstraping machine (my linux-powerpc in this case), couldn't we "un-nuke" the references, making them point to the store path we just created? Thanks! Carlos