GNU bug report logs - #29091
VPATH builds are broken

Previous Next

Package: guix;

Reported by: Eric Bavier <bavier <at> cray.com>

Date: Tue, 31 Oct 2017 19:16:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 29091 in the body.
You can then email your comments to 29091 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#29091; Package guix. (Tue, 31 Oct 2017 19:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Bavier <bavier <at> cray.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 31 Oct 2017 19:16:02 GMT) Full text and rfc822 format available.

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

From: Eric Bavier <bavier <at> cray.com>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>
Subject: VPATH builds are broken
Date: Tue, 31 Oct 2017 19:15:19 +0000
Starting at commit 2890ad332fcdfd4bc92b127d783975437c8b718b, vpath builds no longer work.  I.e. one must configure and build in $(top_srcdir).  I believe this also means that `make distcheck` will fail.  I get the following backtrace from compile-all.scm:

```
Backtrace:
In ice-9/boot-9.scm:
 160: 15 [catch #t #<catch-closure d86d160> ...]
In unknown file:
   ?: 14 [apply-smob/1 #<catch-closure d86d160>]
In ice-9/boot-9.scm:
  66: 13 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 432: 12 [eval # #]
In ice-9/boot-9.scm:
2412: 11 [save-module-excursion #<procedure d8a07c0 at ice-9/boot-9.scm:4084:3 ()>]
4091: 10 [#<procedure d8a07c0 at ice-9/boot-9.scm:4084:3 ()>]
1734: 9 [%start-stack load-stack ...]
1739: 8 [#<procedure d8c46c0 ()>]
In unknown file:
   ?: 7 [primitive-load "/home/users/bavier/src/guix-work/_build/../build-aux/compile-all.scm"]
In ice-9/r4rs.scm:
  90: 6 [dynamic-wind #<procedure f4e2d20 at ice-9/eval.scm:416:20 ()> ...]
  90: 5 [dynamic-wind #<procedure f4e2c60 at ice-9/eval.scm:416:20 ()> ...]
In ice-9/eval.scm:
 432: 4 [eval # #]
 432: 3 [eval # #]
 481: 2 [lp (#<fluid 5>) (#<output: void f6b2dd0>)]
In ice-9/boot-9.scm:
2903: 1 [resolve-interface (.. guix base16) #:select ...]
In unknown file:
   ?: 0 [scm-error misc-error #f "~A ~S" ("no code for module" (.. guix base16)) #f]

ERROR: In procedure scm-error:
ERROR: no code for module (.. guix base16)
Makefile:5269: recipe for target 'make-go' failed
make[2]: *** [make-go] Error 1
make[2]: Leaving directory '/home/users/bavier/src/guix-work/_build'
Makefile:4400: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/users/bavier/src/guix-work/_build'
Makefile:2990: recipe for target 'all' failed
make: *** [all] Error 2
```

Eric Bavier, Scientific Libraries, Cray Inc.




Information forwarded to bug-guix <at> gnu.org:
bug#29091; Package guix. (Sun, 05 Nov 2017 13:42:02 GMT) Full text and rfc822 format available.

Message #8 received at 29091 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Eric Bavier <bavier <at> cray.com>
Cc: 29091 <at> debbugs.gnu.org
Subject: Re: bug#29091: VPATH builds are broken
Date: Sun, 05 Nov 2017 14:41:42 +0100
[Message part 1 (text/plain, inline)]
Hi Eric,

Eric Bavier <bavier <at> cray.com> skribis:

> Starting at commit 2890ad332fcdfd4bc92b127d783975437c8b718b, vpath builds no longer work.  I.e. one must configure and build in $(top_srcdir).  I believe this also means that `make distcheck` will fail.  I get the following backtrace from compile-all.scm:

Good catch!  AFAICS this is fixed by the attached patch.  I’ll commit it
soon if that’s fine with you.

Thanks for your report!

Ludo’.

[0001-compile-Fix-VPATH-builds.patch (text/x-patch, inline)]
From 17b45feb84594e57b487d525810d3d70693ad792 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo <at> gnu.org>
Date: Sun, 5 Nov 2017 12:49:57 +0100
Subject: [PATCH] compile: Fix VPATH builds.

Fixes <https://bugs.gnu.org/29091>.
Reported by Eric Bavier <bavier <at> cray.com>.

* guix/build/compile.scm (relative-file): New procedure.
(load-files): Use it before calling 'file-name->module-name'.
(compile-files): Likewise before calling 'scm->go'.
* guix/build/pull.scm (build-guix): Remove 'with-directory-excursion'
and file name hack from ce33c3af76b0e5c68cc42dddf2b9c4b017386fd8.
Pass OUT to 'all-scheme-files'.
---
 guix/build/compile.scm | 28 ++++++++++++++++----------
 guix/build/pull.scm    | 53 +++++++++++++++++++++-----------------------------
 2 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index ea0c36fa3..8b5a2faf8 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -77,6 +77,12 @@
   "Strip the \".scm\" suffix from FILE, and append \".go\"."
   (string-append (string-drop-right file 4) ".go"))
 
+(define (relative-file directory file)
+  "Return FILE relative to DIRECTORY, if possible."
+  (if (string-prefix? (string-append directory "/") file)
+      (string-drop file (+ 1 (string-length directory)))
+      file))
+
 (define* (load-files directory files
                      #:key
                      (report-load (const #f))
@@ -93,13 +99,14 @@
          (report-load #f total completed))
        *unspecified*)
       ((file files ...)
-       (report-load file total completed)
-       (format debug-port "~%loading '~a'...~%" file)
+       (let ((file (relative-file directory file)))
+         (report-load file total completed)
+         (format debug-port "~%loading '~a'...~%" file)
 
-       (parameterize ((current-warning-port debug-port))
-         (resolve-interface (file-name->module-name file)))
+         (parameterize ((current-warning-port debug-port))
+           (resolve-interface (file-name->module-name file)))
 
-       (loop files (+ 1 completed))))))
+         (loop files (+ 1 completed)))))))
 
 (define-syntax-rule (with-augmented-search-path path item body ...)
   "Within the dynamic extent of BODY, augment PATH by adding ITEM to the
@@ -135,11 +142,12 @@ files are for HOST, a GNU triplet such as \"x86_64-linux-gnu\"."
     (with-fluids ((*current-warning-prefix* ""))
       (with-target host
         (lambda ()
-          (compile-file file
-                        #:output-file (string-append build-directory "/"
-                                                     (scm->go file))
-                        #:opts (append warning-options
-                                       (optimization-options file))))))
+          (let ((relative (relative-file source-directory file)))
+            (compile-file file
+                          #:output-file (string-append build-directory "/"
+                                                       (scm->go relative))
+                          #:opts (append warning-options
+                                         (optimization-options relative)))))))
     (with-mutex progress-lock
       (set! completed (+ 1 completed))))
 
diff --git a/guix/build/pull.scm b/guix/build/pull.scm
index 3573241a7..a011e366f 100644
--- a/guix/build/pull.scm
+++ b/guix/build/pull.scm
@@ -121,41 +121,32 @@ containing the source code.  Write any debugging output to DEBUG-PORT."
 
     ;; Compile the .scm files.  Hide warnings.
     (parameterize ((current-warning-port (%make-void-port "w")))
-      (with-directory-excursion out
-        ;; Filter out files depending on Guile-SSH when Guile-SSH is missing.
-        (let ((files (filter has-all-its-dependencies?
-                             (all-scheme-files "."))))
-          (compile-files out out
+      ;; Filter out files depending on Guile-SSH when Guile-SSH is missing.
+      (let ((files (filter has-all-its-dependencies?
+                           (all-scheme-files out))))
+        (compile-files out out files
 
-                         ;; XXX: 'compile-files' except ready-to-use relative
-                         ;; file names.
-                         (map (lambda (file)
-                                (if (string-prefix? "./" file)
-                                    (string-drop file 2)
-                                    file))
-                              files)
+                       #:workers (parallel-job-count)
 
-                         #:workers (parallel-job-count)
+                       ;; Disable warnings.
+                       #:warning-options '()
 
-                         ;; Disable warnings.
-                         #:warning-options '()
+                       #:report-load
+                       (lambda (file total completed)
+                         (display #\cr log-port)
+                         (format log-port
+                                 "loading...\t~5,1f% of ~d files" ;FIXME: i18n
+                                 (* 100. (/ completed total)) total)
+                         (force-output log-port)
+                         (format debug-port "~%loading '~a'...~%" file))
 
-                         #:report-load
-                         (lambda (file total completed)
-                           (display #\cr log-port)
-                           (format log-port
-                                   "loading...\t~5,1f% of ~d files" ;FIXME: i18n
-                                   (* 100. (/ completed total)) total)
-                           (force-output log-port)
-                           (format debug-port "~%loading '~a'...~%" file))
-
-                         #:report-compilation
-                         (lambda (file total completed)
-                           (display #\cr log-port)
-                           (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n
-                                   (* 100. (/ completed total)) total)
-                           (force-output log-port)
-                           (format debug-port "~%compiling '~a'...~%" file)))))))
+                       #:report-compilation
+                       (lambda (file total completed)
+                         (display #\cr log-port)
+                         (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n
+                                 (* 100. (/ completed total)) total)
+                         (force-output log-port)
+                         (format debug-port "~%compiling '~a'...~%" file))))))
 
   (newline)
   #t)
-- 
2.14.2


Information forwarded to bug-guix <at> gnu.org:
bug#29091; Package guix. (Mon, 06 Nov 2017 15:11:01 GMT) Full text and rfc822 format available.

Message #11 received at 29091 <at> debbugs.gnu.org (full text, mbox):

From: Eric Bavier <bavier <at> cray.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: "29091 <at> debbugs.gnu.org" <29091 <at> debbugs.gnu.org>
Subject: Re: bug#29091: VPATH builds are broken
Date: Mon, 6 Nov 2017 15:10:28 +0000
LGTM.  Thanks for the quick fix!

Eric Bavier, Scientific Libraries, Cray Inc.

________________________________________
From: Ludovic Courtès <ludo <at> gnu.org>
Sent: Sunday, November 5, 2017 07:41
To: Eric Bavier
Cc: 29091 <at> debbugs.gnu.org
Subject: Re: bug#29091: VPATH builds are broken

Hi Eric,

Eric Bavier <bavier <at> cray.com> skribis:

> Starting at commit 2890ad332fcdfd4bc92b127d783975437c8b718b, vpath builds no longer work.  I.e. one must configure and build in $(top_srcdir).  I believe this also means that `make distcheck` will fail.  I get the following backtrace from compile-all.scm:

Good catch!  AFAICS this is fixed by the attached patch.  I’ll commit it
soon if that’s fine with you.

Thanks for your report!

Ludo’.





Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Mon, 06 Nov 2017 23:16:01 GMT) Full text and rfc822 format available.

Notification sent to Eric Bavier <bavier <at> cray.com>:
bug acknowledged by developer. (Mon, 06 Nov 2017 23:16:02 GMT) Full text and rfc822 format available.

Message #16 received at 29091-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Eric Bavier <bavier <at> cray.com>
Cc: "29091 <at> debbugs.gnu.org" <29091-done <at> debbugs.gnu.org>
Subject: Re: bug#29091: VPATH builds are broken
Date: Tue, 07 Nov 2017 00:15:26 +0100
Eric Bavier <bavier <at> cray.com> skribis:

> LGTM.  Thanks for the quick fix!

Pushed as c9405c461b1b37740bc0bb33c7043313978c0014, thanks!

Ludo'.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Dec 2017 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 152 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.