From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.bugs Subject: bug#52230: Variable not visible to compiler causes compilation failure when importing module Date: Wed, 1 Dec 2021 22:53:56 +0100 Message-ID: <24ba24dc-004e-7c00-96eb-ea2412d2e89b@abou-samra.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17427"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 To: 52230@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Wed Dec 01 22:55:14 2021 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msXZJ-0004IM-VY for guile-bugs@m.gmane-mx.org; Wed, 01 Dec 2021 22:55:13 +0100 Original-Received: from localhost ([::1]:46764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msXZJ-0004WN-0N for guile-bugs@m.gmane-mx.org; Wed, 01 Dec 2021 16:55:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msXZ9-0004W7-35 for bug-guile@gnu.org; Wed, 01 Dec 2021 16:55:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34399) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msXZ8-0000tr-IY for bug-guile@gnu.org; Wed, 01 Dec 2021 16:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1msXZ8-0005EH-Cf for bug-guile@gnu.org; Wed, 01 Dec 2021 16:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Wed, 01 Dec 2021 21:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52230 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.163839565220034 (code B ref -1); Wed, 01 Dec 2021 21:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Dec 2021 21:54:12 +0000 Original-Received: from localhost ([127.0.0.1]:45945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msXYK-0005D3-GQ for submit@debbugs.gnu.org; Wed, 01 Dec 2021 16:54:12 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:48318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1msXYI-0005Cw-Mh for submit@debbugs.gnu.org; Wed, 01 Dec 2021 16:54:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:48142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msXYH-0004Ol-PP for bug-guile@gnu.org; Wed, 01 Dec 2021 16:54:10 -0500 Original-Received: from mout.kundenserver.de ([217.72.192.75]:47347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msXYF-0000oC-Qc for bug-guile@gnu.org; Wed, 01 Dec 2021 16:54:09 -0500 Original-Received: from [10.188.216.67] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.184]) with ESMTPSA (Nemesis) id 1M4JeB-1msGZA1TVJ-000MJa for ; Wed, 01 Dec 2021 22:53:57 +0100 Content-Language: en-US X-Provags-ID: V03:K1:5c3713qtoRQOcbMzgjLoaGYYFmKGqMwky/e1aWgCkQZK63V6mM2 xMghqhlJbkuv+U3jJIiUDNV61Nlwd0yEhjqxWsTop9JW+u7lEnH6EkACEXj1NWyTd8DK7Xd OnV/CubglTjAJF1xtbciU0kl91hkQbsUfajN5oG3Om6yq00vj4DBoI/B19ouxtHBVYtp8qC c9ylg+DpoliTqK97gBTxA== X-UI-Out-Filterresults: notjunk:1;V03:K0:xj2eUIF+/7k=:uDVKSY2H+sBdZBqagrvPOV HIjEtx0jcT861ic37scdLbfXXmhH9YnGv3l8LJOSdkFxdqiCxuPY8Hf53uRx48Q37bLvAAMeW CsQ0oyFr3s//VxbIdxRIso9MZ5b1kdCG0TnSksQXBFCA39SVhIqvy+XUuKs6J6CQUf6Ihdirn cC88JfA85vy9m5UDH7sU3HiXMvuDI7dfPK5WMEGkhtfCsLTH7UKWT++h0fxJnqirh3LUtfdKh /URlaELpsnGyQoZpKb3zciD+WTyoouffUYrjWN54TRJ8g+gHp+KU11q6oJBThCPxf2isruwOp gR7ZA3uPvPxfI+XOiRYConLf3lu94BGT4ToH+KG2e+JuLeMh9H1BhQ2lIL+Nq3vXz7VM5czRR FvrrVaB0BITMXIf6krrAWe4eIfaIPojju6YmQQZSobtrZH3J+0IVFVcTHqeUpNQUaS5TJxKb6 luBKdtZYwY/1BmPJL9UOopOXL5SFouhPBg2DGlJMksJMJRpiPHstNprB9X+tGikBPh2gtwTRC Kn2PsRyCPEWVttD2UHcqU0THK/guGgI+KbMvbbIzLHMr+MvC7pmVsOpZndpmgIylAw3vDR9aa zOuyIgmInCNOGEAJ0dZuUQkC2wiqORfzqMta7uD3tYQ4u7v63E/NtYmByZ5Hzt3psyA5y1+TG s98VDgK94X8yzB03UbbT9BKTHNb28+CH4Eyuqw/l3Qgzgjb7s1M8B3uaz5tZCUyEucfg= Received-SPF: none client-ip=217.72.192.75; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10216 Archived-At: 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 # #:from _ #:to …)    261:27 18 (_ _ _) In ice-9/boot-9.scm:    2835:4 17 (save-module-excursion #) In language/scheme/compile-tree-il.scm:     31:15 16 (_) In ice-9/psyntax.scm:   1230:36 15 (expand-top-sequence (#) …)   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 #)   3556:26  3 (_) In unknown file:            2 (primitive-load-path "fail" #) 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.