guix-devel
[Top][All Lists]
Advanced

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

Re: how to get the path of the logfile after an unsuccesful build?


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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Mark H Weaver <address@hidden> writes:

> ng0 <address@hidden> 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/guix/ 
>> 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/…-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/…-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



reply via email to

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