GNU bug report logs - #70778
`include' is unable to include local file

Previous Next

Package: guile;

Reported by: Владимир ВНИИАЭС <var-vniiaes <at> mail.ru>

Date: Sun, 5 May 2024 11:04:01 UTC

Severity: normal

To reply to this bug, email your comments to 70778 AT debbugs.gnu.org.

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-guile <at> gnu.org:
bug#70778; Package guile. (Sun, 05 May 2024 11:04:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Владимир ВНИИАЭС <var-vniiaes <at> mail.ru>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Sun, 05 May 2024 11:04:01 GMT) Full text and rfc822 format available.

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

From: Владимир ВНИИАЭС
 <var-vniiaes <at> mail.ru>
To: bug-guile <at> gnu.org
Subject:  `include' is unable to include local file 
Date: Sun, 05 May 2024 14:02:18 +0300
[Message part 1 (text/plain, inline)]
Guile include logic fails when '-L incdir' option is provided.
 
The `syntax-source' function in such case strips out file's directory;
as a result the `call-with-include-port' function is trying to open file
from current directory. Note that `incdir' here is equal to file folder:
 
amaya <at> t460s:~/tmp$ cat include-test.sh && LANG=C sh include-test.sh
D=/tmp/incdir;    mkdir -p $D
echo                     > $D/a.scm
echo '(include "a.scm")' > $D/b.scm
guile --version
guile -L $D                $D/b.scm
 
guile (GNU Guile) 3.0.9
Copyright (C) 2023 Free Software Foundation, Inc.
 
License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
;;; note: source file /tmp/incdir/b.scm
;;;       newer than compiled /home/amaya/.cache/guile/ccache/3.0-LE-8-4.6/tmp/incdir/b.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /tmp/incdir/b.scm
;;; WARNING: compilation of /tmp/incdir/b.scm failed:
;;; In procedure open-file: No such file or directory: "./a.scm"
Backtrace:
           7 (primitive-load "/tmp/incdir/b.scm")
In ice-9/eval.scm:
   721:20  6 (primitive-eval (include "a.scm"))
In ice-9/psyntax.scm:
  1229:36  5 (expand-top-sequence (#<syntax:b.scm:1:0 (include #<s?>) ?)
  1121:20  4 (parse _ (("placeholder" placeholder)) ((top) #(# # ?)) ?)
  1342:32  3 (syntax-type (include #<syntax:b.scm:1:9 "a.scm">) ((?)) ?)
  1562:32  2 (expand-macro #<procedure 7fa0e7eefa58 at ice-9/psynta?> ?)
  3274:16  1 (_ _ #<procedure 7fa0e8089da0 at ice-9/psyntax.scm:329?> ?)
In unknown file:
           0 (open-file "./a.scm" "r" #:encoding #f #:guess-encoding #)
 
ERROR: In procedure open-file:
In procedure open-file: No such file or directory: "./a.scm"
 
 
[Message part 2 (text/html, inline)]

This bug report was last modified 125 days ago.

Previous Next


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