GNU bug report logs - #21613
Include messes up when compiling file in load path

Previous Next

Package: guile;

Reported by: taylanbayirli <at> gmail.com (Taylan Ulrich Bayırlı/Kammer)

Date: Sun, 4 Oct 2015 14:37:02 UTC

Severity: normal

Merged with 49452, 66046, 70778

Full log


View this message in rfc822 format

From: taylanbayirli <at> gmail.com (Taylan Ulrich Bayırlı/Kammer)
To: 21613 <at> debbugs.gnu.org
Subject: bug#21613: Include messes up when compiling file in load path
Date: Mon, 05 Oct 2015 00:31:34 +0200
[Message part 1 (text/plain, inline)]
taylanbayirli <at> gmail.com (Taylan Ulrich "Bayırlı/Kammer") writes:

> This seems to be related to 'compile-file' setting
> '%file-port-name-canonicalization' to 'relative', but I don't know
> what the correct fix is.

With the following trivial patch changing 'relative' to 'absolute',
Guile's test suite passes and the bug seems to be fixed, but I still
don't know whether this is the right fix...

[0001-Fix-include-for-files-in-load-path.patch (text/x-diff, inline)]
From 3e508926631a6fe3d81f6a584352562afc0e96ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli <at> gmail.com>
Date: Mon, 5 Oct 2015 00:15:56 +0200
Subject: [PATCH] Fix 'include' for files in load path.

Fixes <http://debbugs.gnu.org/21613>.

* module/system/base/compile.scm (compile-file): Set
  %file-port-name-canonicalization to 'absolute by default.
(compile-and-load): Ditto.
---
 module/system/base/compile.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index c522b74..66eec44 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -136,7 +136,7 @@
                        (to 'objcode)
                        (env (default-environment from))
                        (opts '())
-                       (canonicalization 'relative))
+                       (canonicalization 'absolute))
   (with-fluids ((%file-port-name-canonicalization canonicalization))
     (let* ((comp (or output-file (compiled-file-name file)
                      (error "failed to create path for auto-compiled file"
@@ -157,7 +157,7 @@
 
 (define* (compile-and-load file #:key (from (current-language)) (to 'value)
                            (env (current-module)) (opts '())
-                           (canonicalization 'relative))
+                           (canonicalization 'absolute))
   (with-fluids ((%file-port-name-canonicalization canonicalization))
     (read-and-compile (open-input-file file)
                       #:from from #:to to #:opts opts
-- 
2.5.0


This bug report was last modified 172 days ago.

Previous Next


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