From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Guy Gastineau Newsgroups: gmane.lisp.guile.bugs Subject: bug#43394: DYNAMIC-LINK is unbound when using r6rs library syntax Date: Sun, 13 Sep 2020 23:07:26 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000027819a05af3d56f4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3433"; mail-complaints-to="usenet@ciao.gmane.io" To: 43394@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Mon Sep 14 07:05:08 2020 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 1kHgfr-0000m5-Ut for guile-bugs@m.gmane-mx.org; Mon, 14 Sep 2020 07:05:08 +0200 Original-Received: from localhost ([::1]:53894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHgfq-0004SO-V6 for guile-bugs@m.gmane-mx.org; Mon, 14 Sep 2020 01:05:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHgfm-0004SD-VJ for bug-guile@gnu.org; Mon, 14 Sep 2020 01:05:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHgfm-0003ow-Lp for bug-guile@gnu.org; Mon, 14 Sep 2020 01:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kHgfm-0006em-G0 for bug-guile@gnu.org; Mon, 14 Sep 2020 01:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Guy Gastineau Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 14 Sep 2020 05:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43394 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160005986425538 (code B ref -1); Mon, 14 Sep 2020 05:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Sep 2020 05:04:24 +0000 Original-Received: from localhost ([127.0.0.1]:52273 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHgf7-0006do-OO for submit@debbugs.gnu.org; Mon, 14 Sep 2020 01:04:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:56104) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHeqC-0003pc-9j for submit@debbugs.gnu.org; Sun, 13 Sep 2020 23:07:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHeqC-0002nv-5E for bug-guile@gnu.org; Sun, 13 Sep 2020 23:07:40 -0400 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:41174) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHeqA-00086Y-70 for bug-guile@gnu.org; Sun, 13 Sep 2020 23:07:39 -0400 Original-Received: by mail-qt1-x831.google.com with SMTP id t20so12432136qtr.8 for ; Sun, 13 Sep 2020 20:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=t5G/iXfQhMLUDnyMCxGm8JKUWGAAUPxoRmKbIHHygso=; b=PDEdJG9AAia0u4H5GUkNB92Q0ATCQKPoL8Eh3OiQJgKY8UL6AwKcKnplhNHuHicqZX 4/ZEAT4YuCfP/0+KozmI9uEwduqzxefrXbeqJp/nkKHVMgXyf6gQuXbSDeDI1doTsvlP +xiTjHw/Y7kgaDpP1j3GycbFVMckLVWRRvSgVA7E7RZIm+fAIxs18v06XRmqXGLXLBi+ tSTKs76DQ7kTiuBu8+WbsF9d1pl+j45qfEc1gOEpu5zrpTU03JZ4OIzZVhWZ5cXXPqBp 1DoeWCBBFm+wYZAZy+MrqK1HNnK3avE3DYKChe8/cnjc55xnzaSbegKYp982jtIhRu3k A8FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=t5G/iXfQhMLUDnyMCxGm8JKUWGAAUPxoRmKbIHHygso=; b=cGAInwcUSB/takTLQAZNmVRSAz6Hz0aWHepScYoN6sQpvKzkkgrfYKXS7TAIKntuqJ Se4gIyjdBGc2sImhri+LsUiIZbpXcXD1Kyp+xqGCWJAKfD18WXdjvzBPEaByW2NkMUkw uxa/2n0ppNw7RKuCjDTfD9XWyBMsDqm1Jthfn/SYqc3mtM5GdOQfxPjy17byfaC5Zydi SUpa9JW1n75s0xENnzPzVE0yYiXDUX3ZdoC1GORsYZnaWPExzNUoMkPIlXIzmS/1G6zc RtbG9t/rYVbrTFiqBLYuEqd31PiuVhx71MPADTp0/7KyEJBU1KS1ziW1a7dohwMOOsUb j77g== X-Gm-Message-State: AOAM533LzskwcKgxB1VKdV0o9+e6+VN/Q9R8Pq3Mb50i3G/42IWp9Enz HKeN/ZtUl7Gw+sOBawlBJeCdG1kY0p9K5FR6Nw5u7UsAYD1G2w== X-Google-Smtp-Source: ABdhPJzicngOeW7xn2qXl4bt5kB050RB79JAZfqQ4QSLBOIACL2BQF8B4COtgiUM+va36cxTKsm0IKuMihqrllK/pHk= X-Received: by 2002:ac8:32b6:: with SMTP id z51mr6805491qta.303.1600052856847; Sun, 13 Sep 2020 20:07:36 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::831; envelope-from=strings.stringsandstrings@gmail.com; helo=mail-qt1-x831.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 14 Sep 2020 01:04:20 -0400 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:9885 Archived-At: --00000000000027819a05af3d56f4 Content-Type: text/plain; charset="UTF-8" Guile version 3.0.4.38-64c894 I am on 64 bit arch linux, and I built guile3.0 from the AUR package guile-git on Sep 12 2020 https://aur.archlinux.org/guile-git.git for the PKGBUILD (the config options were practically non-existent). I am writing to modules that dynamically link. DYNAMIC-LINK works in the top level REPL, and when using DEFINE-MODULE. When using the r6rs library syntax DYNAMIC-LINK is considered unbound and the compilation fails. The following is an example of the behavior with a minimally viable source for reproducing the bug. (library (fail-link (0 1)) (export link) (import) (define link dynamic-link)) What I get: ;;; note: source file /home/guy/guile-fail-link.scm ;;; newer than compiled /home/guy/.cache/guile/ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go ;;; compiling /home/guy/guile-fail-link.scm ;;; guile-fail-link.scm:4:2: warning: possibly unbound variable `dynamic-link' ;;; compiled /home/guy/.cache/guile/ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go ice-9/boot-9.scm:1669:16: In procedure raise-exception: Unbound variable: dynamic-link What I expect: ;;; note: source file /home/guy/guile-fail-link.scm ;;; newer than compiled /home/guy/.cache/guile/ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go ;;; compiling /home/guy/guile-fail-link.scm ;;; compiled /home/guy/.cache/guile/ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go Additional information: After I load the failing library I lose a bunch of top level definitions and syntax. Like IMPORT is no longer recognized and I have to `,q` in order to get the REPL in a usable state again. I can just use DEFINE-MODULE, but honestly I like the r6rs syntax. Even though imports between schemes differ enough (and FFI anyway) that none of these libraries will end up being portable, I still like r6rs library syntax. If I need to find extra information for to help you all figure out what is happening, please just let me know. Also, thank you all for your hard work. I am excited to have this snappy Guile 3 on my system now ;) - Guy Gastineau --00000000000027819a05af3d56f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Guile version 3.0.4.38-64c894

I am on 64 bit arch linux, and I built guile3.0 from the AUR package guil= e-git on Sep 12 2020
https://aur.archlinux.org/guile-git.git for the PKGBUILD (the c= onfig options were practically non-existent).

I am= writing to modules that dynamically link.=C2=A0 DYNAMIC-LINK works in the = top level REPL, and when using DEFINE-MODULE.
When using the r6rs= library syntax DYNAMIC-LINK is considered unbound and the compilation fail= s.
The following is an example of the behavior with a minimally v= iable source for reproducing the bug.

(library (fa= il-link (0 1))
=C2=A0 (export link)
=C2=A0 (import)
=C2=A0 (define link dynamic-link))

What I g= et:
;;; note: source file /home/guy/guile-fail-link.scm =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0
;;; =C2=A0 =C2=A0 =C2=A0 newer than compiled /home/guy/.cache/guile= /ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0
;;; compiling /home/guy/guile-fail-link.scm = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
;;; guile-fail-link.scm:4:2: war= ning: possibly unbound variable `dynamic-link' =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
;;; compiled /home/guy/.cache/= guile/ccache/3.0-LE-8-4.4/home/guy/guile-fail-link.scm.go =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0
ice-9/boot-9.scm:1669:16: In procedure raise-exception: = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
U= nbound variable: dynamic-link

What I expect:
=
;;; note: source file /home/guy/guile-fail-link.scm =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
;;; = =C2=A0 =C2=A0 =C2=A0 newer than compiled /home/guy/.cache/guile/ccache/3.0-= LE-8-4.4/home/guy/guile-fail-link.scm.go =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0
;;; compiling /home/guy/guile-fail-link.scm =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0
;;; compiled /home/guy/.cache/guile/ccache/3.0= -LE-8-4.4/home/guy/guile-fail-link.scm.go

Addition= al information:
After I load the failing library I lose a bunch o= f top level definitions and syntax.=C2=A0 Like IMPORT is no longer recogniz= ed and I have to `,q`
in order to get the REPL in a usable state = again.

I can just use DEFINE-MODULE, but honestly = I like the r6rs syntax.=C2=A0 Even though imports between schemes differ en= ough (and FFI anyway)
that none of these libraries will end up be= ing portable, I still like r6rs library syntax.

If= I need to find extra information for to help you all figure out what is ha= ppening, please just let me know.

Also, thank you = all for your hard work.=C2=A0 I am excited to have this snappy Guile 3 on m= y system now ;)

- Guy Gastineau
--00000000000027819a05af3d56f4--