From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: how to get the path of the logfile after an unsuccesful build? Date: Sun, 11 Mar 2018 20:55:56 -0400 Message-ID: <87a7vejen7.fsf@netris.org> References: <20180309091549.lris2yvh3uh65and@abyayala> <87po4c7wcl.fsf@netris.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]:43899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evBlb-0000FA-9H for guix-devel@gnu.org; Sun, 11 Mar 2018 20:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evBlY-0002Ea-74 for guix-devel@gnu.org; Sun, 11 Mar 2018 20:56:43 -0400 Received: from world.peace.net ([50.252.239.5]:51506) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evBlY-0002E6-2L for guix-devel@gnu.org; Sun, 11 Mar 2018 20:56:40 -0400 In-Reply-To: <87po4c7wcl.fsf@netris.org> (Mark H. Weaver's message of "Fri, 09 Mar 2018 16:49:46 -0500") 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: guix-devel@gnu.org Mark H Weaver writes: > ng0 writes: > >> did we ever talk about that there's too little information on how to get >> the current log file of a failed build? I need this right now (the full = log) >> and I can't remember how, and making use of the log folder in var/log/gu= ix/ won't >> help either. > > Why won't /var/log/guix help? To see the most recent build logs for a > given package, say 'icecat', I do this: > > ls -ltr /var/log/guix/drvs/*/*-icecat* | tail I should also mention a few other ways to find a specific log file: Most importantly, the file names in /var/log/guix/drvs can be easily derived from the corresponding derivation (.drv) file name. The first two characters of hash become the directory name, and the rest becomes the file name, with ".bz2" added (unless you disabled log compression in the daemon). Here's an example .drv file and its corresponding log file: _________/gnu/store/8110245r80b1rqpjlf3x33k96h1f8gms-linux-libre-4.15.8.drv /var/log/guix/drvs/81/10245r80b1rqpjlf3x33k96h1f8gms-linux-libre-4.15.8.drv= .bz2 Note that the .drv file names are printed after "The following derivations will be built". If you lost the log where that message was printed, you could run "guix build --dry-run" again, assuming that you haven't updated Guix since the relevant build attempt. In typical cases, you might be able to use "guix build --log-file" to get the log file name, possibly also with "--no-grafts". You can pass it either a raw store item /gnu/store/... or a package specification. While I'm at it, here are some other tricks for finding logs of _successful_ builds: If you find that the log file contains only a single line of the form: grafting '/gnu/store/=E2=80=A6-foo' -> _ Then it corresponds to a grafted derivation, and you need to find the original ungrafted derivation. In most cases this can be done by running "guix build --log-file /gnu/store/=E2=80=A6-foo", passing the first= file name from the "grafting" message. Alternatively, you could look in the .drv file of the grafting derivation, which will include the file name of the original ungrafted derivation among its input derivations. Mark