GNU bug report logs

#30647 [PATCH] guix build: Support '--remote-log-file=PACKAGE'.

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 28 Feb 2018 14:21:00 +0000
From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 28 09:21:00 2018
Received: from localhost ([127.0.0.1]:36611 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1er2bM-0007VN-76
	for submit@debbugs.gnu.org; Wed, 28 Feb 2018 09:21:00 -0500
Received: from eggs.gnu.org ([208.118.235.92]:41177)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <go.wigust@gmail.com>) id 1er2bL-0007VB-9t
 for submit@debbugs.gnu.org; Wed, 28 Feb 2018 09:20:59 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <go.wigust@gmail.com>) id 1er2bC-0007o3-TN
 for submit@debbugs.gnu.org; Wed, 28 Feb 2018 09:20:54 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:45881)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <go.wigust@gmail.com>) id 1er2bC-0007nx-Ph
 for submit@debbugs.gnu.org; Wed, 28 Feb 2018 09:20:50 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60316)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <go.wigust@gmail.com>) id 1er2b6-00011F-E4
 for guix-patches@gnu.org; Wed, 28 Feb 2018 09:20:50 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <go.wigust@gmail.com>) id 1er2b3-0007fd-3Y
 for guix-patches@gnu.org; Wed, 28 Feb 2018 09:20:44 -0500
Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:47012)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <go.wigust@gmail.com>) id 1er2b2-0007f6-Nl
 for guix-patches@gnu.org; Wed, 28 Feb 2018 09:20:41 -0500
Received: by mail-lf0-x22e.google.com with SMTP id r80so3726051lfe.13
 for <guix-patches@gnu.org>; Wed, 28 Feb 2018 06:20:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=ckRg2g1M0xfpPqTcVvIjqajlboISHELNNGeLYAY+CYw=;
 b=PhAgIdAcjKfOgOuRVGRzogkdEBtVa9uKgVeVPQAhjnDOF2D1ESzbHzDdhp9pITWzGh
 67dE6lQ7zZWKuPqFU/o9sI0HWQG4h35KswZ0TgYUaGRbn80Mm9xwWsAeFzVESxz0zQKV
 AZ3uEgaIy7X8CSrH/yuIh12J8sn71Cs7qWh7tbirAyxHAH9TWLwlcGoxBzhHh7fXFLWw
 LdTGzfMgK0D6p6vOtMOuqRs9IOgMvoM8JHKNk8YHUAPG53FVy7xEZdb6d4VNbfqq7F9k
 to41fNICn/xpWtjJSrE5Oq7C7dUUtRKCDAbi9tBbSOuovymNr08xldyZnQJVbA2n94fM
 YPlg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=ckRg2g1M0xfpPqTcVvIjqajlboISHELNNGeLYAY+CYw=;
 b=R2e7Wg83216Er7EMcRkWsjs1oT0qar5Ld32xezMfq26VqXE5b86EteJOoKvglWGraw
 /DDWzaBa4TGpcuL2eOnEjk2QpHEg+lZpEtK9FL8zASRvJc6tzCIX103hxz+YHYTF3qxT
 fHw7xR4agGIxKveD88J6EQYA3ygPkZDAvKy5K8OI0TfXAAztpSv8Lrji1SypQknzS9gO
 qaSIT+DhXN2HyubxQ40jcO3gttgi7LARiztjVsw8Md4LnCPd0k0C83d+aidCfqjoUx5F
 eL9YGjusKryL+IhQAq+S01CdMeKBsSoO2UuCJiZU6LTZ/chTN4PdYi4U9SgXyF21ayiR
 p6rA==
X-Gm-Message-State: APf1xPCsXagJIzQbq94jqkLPEvtO5ub1lXD5TMIDryYFNe6KV36mzeLl
 qVVnCZVjqjFGbwu3kTPeaUNwvw==
X-Google-Smtp-Source: AG47ELt2nVNmzxcXfuVLCtk94eLYaigy5vATAkjOFUjzql0CkPLPWU75BFScSBy0Pnd5X0tkqdTqkQ==
X-Received: by 10.25.37.139 with SMTP id l133mr13593437lfl.70.1519827639027;
 Wed, 28 Feb 2018 06:20:39 -0800 (PST)
Received: from localhost.localdomain (92-100-174-247.dynamic.avangarddsl.ru.
 [92.100.174.247])
 by smtp.gmail.com with ESMTPSA id d3sm375991lfj.95.2018.02.28.06.20.37
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 28 Feb 2018 06:20:38 -0800 (PST)
From: Oleg Pykhalov <go.wigust@gmail.com>
To: guix-patches@gnu.org
Subject: [PATCH] guix build: Support '--remote-log-file=PACKAGE'.
Date: Wed, 28 Feb 2018 17:19:59 +0300
Message-Id: <20180228141959.19789-1-go.wigust@gmail.com>
X-Mailer: git-send-email 2.16.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
Cc: Oleg Pykhalov <go.wigust@gmail.com>
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -4.0 (----)
‘--remote-log-file’ allows to get a URL for a build log file on a substitute
server regardless is it built locally.  ‘--log-file’ returns always local
build log file.

* guix/scripts/build.scm (show-build-log): Split function.
(show-remote-build-log): New function.
(guix-build): Add this.
* doc/guix.texi (Invoking guix build): Document this.
---
 doc/guix.texi          | 18 +++++++++---------
 guix/scripts/build.scm | 31 ++++++++++++++++++++++---------
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 24db16761..782e532ce 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5812,9 +5812,8 @@ more on GC roots.
 
 @item --log-file
 @cindex build logs, access
-Return the build log file names or URLs for the given
-@var{package-or-derivation}, or raise an error if build logs are
-missing.
+Return the build log file names @var{package-or-derivation}, or raise an
+error if build logs are missing.
 
 This works regardless of how packages or derivations are specified.  For
 instance, the following invocations are equivalent:
@@ -5826,15 +5825,16 @@ guix build --log-file guile
 guix build --log-file -e '(@@ (gnu packages guile) guile-2.0)'
 @end example
 
-If a log is unavailable locally, and unless @code{--no-substitutes} is
-passed, the command looks for a corresponding log on one of the
-substitute servers (as specified with @code{--substitute-urls}.)
+@item --remote-log-file
+@cindex build logs, access
+
+Same as @code{--log-file} but on one of the substitute servers (as
+specified with @code{--substitute-urls}.
 
-So for instance, imagine you want to see the build log of GDB on MIPS,
-but you are actually on an @code{x86_64} machine:
+For example, you want to see the build log of GDB on MIPS:
 
 @example
-$ guix build --log-file gdb -s mips64el-linux
+$ guix build --remote-log-file gdb -s mips64el-linux
 https://hydra.gnu.org/log/@dots{}-gdb-7.10
 @end example
 
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 57f2d82c5..c45271e50 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -601,6 +601,9 @@ must be one of 'package', 'all', or 'transitive'~%")
          (option '("log-file") #f #f
                  (lambda (opt name arg result)
                    (alist-cons 'log-file? #t result)))
+         (option '("remote-log-file") #f #f
+                 (lambda (opt name arg result)
+                   (alist-cons 'remote-log-file? #t result)))
 
          (append %transformation-options
                  %standard-build-options)))
@@ -691,15 +694,20 @@ package '~a' has no source~%")
                 (map (cut transform store <>)
                      (options->things-to-build opts)))))
 
-(define (show-build-log store file urls)
-  "Show the build log for FILE, falling back to remote logs from URLS if
-needed."
-  (let ((log (or (log-file store file)
-                 (log-url store file #:base-urls urls))))
+(define (show-build-log store file)
+  "Show the build log for FILE."
+  (let ((log (log-file store file)))
     (if log
         (format #t "~a~%" log)
         (leave (G_ "no build log for '~a'~%") file))))
 
+(define (show-remote-build-log store file urls)
+  "Show the remote build log for FILE from URLS."
+  (let ((log (log-url store file #:base-urls urls)))
+    (if log
+        (format #t "~a~%" log)
+        (leave (G_ "no remote build log for '~a'~%") file))))
+
 
 ;;;
 ;;; Entry point.
@@ -713,6 +721,9 @@ needed."
   (define quiet?
     (assoc-ref opts 'quiet?))
 
+  (define (derivation-file-names drv items)
+    (delete-duplicates (append (map derivation-file-name drv) items)))
+
   (with-error-handling
     ;; Ask for absolute file names so that .drv file names passed from the
     ;; user to 'read-derivation' are absolute when it returns.
@@ -744,6 +755,7 @@ needed."
                                     opts)))
 
             (unless (or (assoc-ref opts 'log-file?)
+                        (assoc-ref opts 'remote-log-file?)
                         (assoc-ref opts 'derivations-only?))
               (show-what-to-build store drv
                                   #:use-substitutes?
@@ -752,10 +764,11 @@ needed."
                                   #:mode mode))
 
             (cond ((assoc-ref opts 'log-file?)
-                   (for-each (cut show-build-log store <> urls)
-                             (delete-duplicates
-                              (append (map derivation-file-name drv)
-                                      items))))
+                   (for-each (cut show-build-log store <>)
+                             (derivation-file-names drv items)))
+                  ((assoc-ref opts 'remote-log-file?)
+                   (for-each (cut show-remote-build-log store <> urls)
+                             (derivation-file-names drv items)))
                   ((assoc-ref opts 'derivations-only?)
                    (format #t "~{~a~%~}" (map derivation-file-name drv))
                    (for-each (cut register-root store <> <>)
-- 
2.16.1





Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Wed Sep 10 05:13:44 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.