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,gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: bug#52230: 'guild compile' and C(++) extensions (in the context of LilyPond) Date: Sat, 19 Feb 2022 22:08:45 +0100 Message-ID: <1fbaea64-8a8f-ea4b-714c-68ced7e1eab8@abou-samra.fr> References: <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="7493"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: guile-user@gnu.org, guile-devel@gnu.org, 52230@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sat Feb 19 22:09:13 2022 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 1nLWyf-0001n3-73 for guile-bugs@m.gmane-mx.org; Sat, 19 Feb 2022 22:09:13 +0100 Original-Received: from localhost ([::1]:33852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nLWyd-0008K5-SD for guile-bugs@m.gmane-mx.org; Sat, 19 Feb 2022 16:09:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:54066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nLWyU-0008Ip-FC for bug-guile@gnu.org; Sat, 19 Feb 2022 16:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nLWyU-0001PM-3B for bug-guile@gnu.org; Sat, 19 Feb 2022 16:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nLWyT-0000RN-Vq for bug-guile@gnu.org; Sat, 19 Feb 2022 16:09:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <24ba24dc-004e-7c00-96eb-ea2412d2e89b@abou-samra.fr> Resent-From: Jean Abou Samra Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 19 Feb 2022 21:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52230 X-GNU-PR-Package: guile Original-Received: via spool by 52230-submit@debbugs.gnu.org id=B52230.16453049341679 (code B ref 52230); Sat, 19 Feb 2022 21:09:01 +0000 Original-Received: (at 52230) by debbugs.gnu.org; 19 Feb 2022 21:08:54 +0000 Original-Received: from localhost ([127.0.0.1]:58825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLWyM-0000R0-3L for submit@debbugs.gnu.org; Sat, 19 Feb 2022 16:08:54 -0500 Original-Received: from mout.kundenserver.de ([212.227.17.10]:41845) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nLWyJ-0000Qo-TX for 52230@debbugs.gnu.org; Sat, 19 Feb 2022 16:08:52 -0500 Original-Received: from [10.188.216.67] ([46.193.67.184]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1N3KDM-1oLmZg0Aa2-010Lrf; Sat, 19 Feb 2022 22:08:46 +0100 Content-Language: en-US X-Provags-ID: V03:K1:DLcwuMAG9K59sRACp+KmBud+Tlt7vYSidK8OEJjjYC9L9KKpmzi IfgOL+uox/akqTEsaPXhfOpKmNErNKrzpXtPMUQdvckmFoI4rDRr++OV2/VMHIPlKcCoZ1i K61kkIebuGde7uucDvl+SHF4kCmtiqNfoXiDf2PUCyixAJaz5Gg/xO8+3U3WMnxR2gt+Dcx OQonvseqUDSt8oVG6Jlhg== X-UI-Out-Filterresults: notjunk:1;V03:K0:dq9s6gcns/E=:aKXBAbRdeI/an3vsFnix0U qIDrERFDb0AtYzO6K3zzUv9t9vQwddRv9YIQhbLSC6aZ15zYjwFIeIEtE1p0ktILWQeRI7e6F 1/BquC62sFPpOSgFQpIMgVq/eIM00ftIEkNehJzJSDeBBpTbDJIL98DE+3yiqYeF4MX0QYACi ophxx73R0zF94rpv+nKTooEaZN23Ox5p2BgiU7Rziv8CX+av0wIsduQEBlkYFaiHukWjRqkEg 97/PLc8o3kB7dV7+IklezEejDWwNnrH670xZtxyYyrRlkZpGSHDb0qGq8D2PTZoklqokXnOON /gZG9/rI2nKZYtPE+LrzHvUBVQ1ltYBSCZC44XxDHsQGvQuBZUx+EQ4C7UO9f5ONvJzemQ8XS Dcx2UbLDo0G/TpX92qSfg5bSudDa/s8aSfycNQqOnOFbZb9eUbCE/w15zO4+uGNdB8Ea5lDUV 8i77QeHk7qcuDsGgAtNi6FlaiGHulRa8Q61rSSFObcnfjsUFe/gEvKO5ipGy3yW8trQoD+RwQ cyZN8ZvuFXN7CGEhif4fDUOriEk0arX0q9wzCPJFqnsrznaEtLJAHdQDOt5uASGdIToFfayyt tP+ZaILkbhWeKS1Yp28Y5H3X/bO+qCZXsCwAJDEYtQsnqSqUxgVKObSaMPUmXud3zgM0dsP96 2IgR0lvnjiSoU7kdfi/fHpQ4cSR5vUZslWkKrrquLXeV12vl0U/MtWYFniGTA4lxCIU8= 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:10246 gmane.lisp.guile.user:18109 gmane.lisp.guile.devel:21132 Archived-At: Hi, (Cross-posted to guile-user, guile-devel and the debbugs issue, I'm unsure where this should go.) In LilyPond, we have now made a development release with binaries using Guile 2.2. However, a major problem is that we don't ship Guile bytecode yet. Notably, one problem to get the bytecode in a build system is that we are currently forced to use GUILE_AUTO_COMPILE=1 to generate it -- which means we need to compile the entire suite of regression tests in order to exercise all files. This also means spurious test differences when Guile gets noisy about byte-compilation (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16364). In summary: it would mean a lot less headache to be able to use 'guild compile'. Unfortunately, this does not work. One issue is that our Scheme files are mostly not Guile modules, but loaded directly with primitive-load-path. This will be a lot of work to fix, but it is on our end. However, I don't understand how to get around another issue, which is how our Scheme code interfaces with C++.   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52230 Basically, if a Scheme file has something like   (define-public point-stencil (ly:make-stencil "" '(0 . 0) '(0 . 0))) where ly:make-stencil is a procedure defined in C++, I can get this file to compile, but I can't get files using it as a module to compile. Investigation shows that Guile is apparently trying to load the module when compiling. $ cat print.scm (define-module (print)) (display "Module running!") $ guild compile print.scm wrote `/home/jean/.cache/guile/ccache/3.0-LE-8-4.4/home/jean/repos/lilypond/print.scm.go' $ cat import.scm (use-modules (print)) $ guild compile -L . print.scm wrote `/home/jean/.cache/guile/ccache/3.0-LE-8-4.4/home/jean/repos/lilypond/print.scm.go' $ guild compile -L . import.scm Module running!wrote `/home/jean/.cache/guile/ccache/3.0-LE-8-4.4/home/jean/repos/lilypond/import.scm.go' For functions defined in C++, that does not work: they are added by the entry point in the function that scm_boot_guile calls, using scm_c_define_gsubr. They aren't defined until the program is actually run. So how is 'guild compile' supposed to work with C(++) code? Thanks in advance, Jean