GNU bug report logs - #66046
Relative includes in R7RS define-library seem broken

Previous Next

Package: guile;

Reported by: Daphne Preston-Kendal <dpk <at> nonceword.org>

Date: Sun, 17 Sep 2023 08:23:01 UTC

Severity: normal

Merged with 21613, 49452, 70778

Full log


View this message in rfc822 format

From: Amirouche <amirouche <at> hyper.dev>
To: "66046 <at> debbugs.gnu.org" <66046 <at> debbugs.gnu.org>
Subject: bug#66046: Relative includes in R7RS define-library seem broken
Date: Sat, 11 Nov 2023 11:58:49 +0000
If I am not mistaken, the patch is not backward compatible.

The problem with the current patch is that it force the included file 
to be next to the including file, there is no fallback  mechanism. 
The algorithm should be dynamic using an ordered list a priority to
the favorite behavior. 

The most relevant hunk is:

--- a/module/ice-9/psyntax.scm
+++ b/module/ice-9/psyntax.scm
@@ -3260,15 +3260,20 @@
   (let ((syntax-dirname (lambda (stx)
                           (define src (syntax-source stx))
                           (define filename (and src (assq-ref src 'filename)))
-                          (and (string? filename)
-                               (dirname filename)))))
+                          (define source-file-name
+                            (fluid-ref compilation-source-file-name))
+                          (or (and source-file-name
+                                   (dirname source-file-name))
+                              (and (string? filename)
+                                   (dirname filename))))))

Here the code says: the included file must be in (syntax-dirname). 
It is preferable to have fallbacks, to be backward compatible.

`syntax-dirname' must be `syntax-dirnames' to return candidate directories 
sorted list with biggest priority coming first where to find included 
files.

Also, mind the use of the fluid and how it interact with parallel compilation.

BR

ref: https://github.com/justinethier/cyclone/issues/494#issuecomment-1328958946
ref: https://github.com/justinethier/cyclone/commit/ab25e360a9d7b67c2e5eda086001ca0761a3f34f#diff-b9136575f3ccbf09887d1da9fb4b6e136e4e32a839c10cf855696ec1cf6add4bR54-R58





This bug report was last modified 173 days ago.

Previous Next


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