unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#52230: Variable not visible to compiler causes compilation failure when importing module
@ 2021-12-01 21:53 Jean Abou Samra
  0 siblings, 0 replies; only message in thread
From: Jean Abou Samra @ 2021-12-01 21:53 UTC (permalink / raw)
  To: 52230

In experiments with using guild for byte compilation
in LilyPond, I am hitting what seems like a bug. When
a variable is not defined declaratively in a way that
makes the compiler aware of it, the module it is
defined in can compile, but modules using it cannot.
Here is an example. fail.scm contains:

(define-module (fail))

variable-coming-from-somewhere-but-not-known-at-compile-time


import.scm is just:

(use-modules (fail))


Compiling fail.scm works:

$ guild compile fail.scm
fail.scm:3:0: warning: possibly unbound variable 
`variable-coming-from-somewhere-but-not-known-at-compile-time'
wrote `/home/jean/.cache/guile/ccache/3.0-LE-8-4.4/.../fail.scm.go'

Compiling import.scm gives this traceback:

$ guild compile -L . import.scm
Backtrace:
In system/base/compile.scm:
    327:39 19 (read-and-compile #<input: import.scm 13> #:from _ #:to …)
    261:27 18 (_ _ _)
In ice-9/boot-9.scm:
    2835:4 17 (save-module-excursion #<procedure 7f35bd197ea0 at lang…>)
In language/scheme/compile-tree-il.scm:
     31:15 16 (_)
In ice-9/psyntax.scm:
   1230:36 15 (expand-top-sequence (#<syntax:import.scm:1:0 (#<synt…>) …)
   1222:19 14 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
    259:10 13 (parse _ (("placeholder" placeholder)) (()) _ c&e (# #) #)
In ice-9/boot-9.scm:
   3927:20 12 (process-use-modules _)
    222:17 11 (map1 (((fail))))
   3928:31 10 (_ ((fail)))
   3326:17  9 (resolve-interface (fail) #:select _ #:hide _ #:prefix _ …)
In ice-9/threads.scm:
     390:8  8 (_ _)
In ice-9/boot-9.scm:
   3252:13  7 (_)
In ice-9/threads.scm:
     390:8  6 (_ _)
In ice-9/boot-9.scm:
   3536:20  5 (_)
    2835:4  4 (save-module-excursion #<procedure 7f35bd260960 at ice-…>)
   3556:26  3 (_)
In unknown file:
            2 (primitive-load-path "fail" #<procedure 7f35bd1a0860 at…>)
In fail.scm:
       3:0  1 (_)
In ice-9/boot-9.scm:
   1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: 
variable-coming-from-somewhere-but-not-known-at-compile-time


I would appreciate any workarounds.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-01 21:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 21:53 bug#52230: Variable not visible to compiler causes compilation failure when importing module Jean Abou Samra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).