From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daphne Preston-Kendal Newsgroups: gmane.lisp.guile.bugs Subject: bug#66046: Relative includes in R7RS define-library seem broken Date: Sun, 17 Sep 2023 10:22:20 +0200 Message-ID: <6C8500AC-6352-4849-A2C9-2DFEB34F21D5@nonceword.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20513"; mail-complaints-to="usenet@ciao.gmane.io" To: 66046@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Sun Sep 17 10:23:17 2023 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 1qhn3j-00054Y-MT for guile-bugs@m.gmane-mx.org; Sun, 17 Sep 2023 10:23:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhn3R-0006LX-Bj; Sun, 17 Sep 2023 04:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhn3O-0006LF-Ts for bug-guile@gnu.org; Sun, 17 Sep 2023 04:22:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhn3O-0008BI-MI for bug-guile@gnu.org; Sun, 17 Sep 2023 04:22:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhn3W-0000gv-3p for bug-guile@gnu.org; Sun, 17 Sep 2023 04:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daphne Preston-Kendal Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 17 Sep 2023 08:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66046 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16949389792646 (code B ref -1); Sun, 17 Sep 2023 08:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Sep 2023 08:22:59 +0000 Original-Received: from localhost ([127.0.0.1]:49013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhn3S-0000gb-Tn for submit@debbugs.gnu.org; Sun, 17 Sep 2023 04:22:59 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:53720) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhn3P-0000gL-CH for submit@debbugs.gnu.org; Sun, 17 Sep 2023 04:22:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhn3B-0006Iv-B7 for bug-guile@gnu.org; Sun, 17 Sep 2023 04:22:41 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhn39-00088W-BA for bug-guile@gnu.org; Sun, 17 Sep 2023 04:22:41 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id C944E3200935 for ; Sun, 17 Sep 2023 04:22:33 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 17 Sep 2023 04:22:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nonceword.org; h=cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :sender:subject:subject:to:to; s=fm2; t=1694938953; x= 1695025353; bh=Xp/MOoyoW8xOh3Va4uXTTi2c3gx/7P/WNyJctxmXOSo=; b=Y UuPyCpVJ+xnKbXqdUuNPodGEQSEbMf89S9kkAjfnmEpdOYYHLF2hJqjZWdGIY2DJ cBygEaCK3mfGN61YGEFDAyPttsJlXXjQ+k+hP8szhXxK003Jf2f9HX32YnVlRfPq ZwwbPFKAmgCBG+IS84Mx/U298KTbKBYCgDhGB29wGM+ihqyjJ/aMCxYRXkPziexj FH2qwW4jyUBqVqkuySsg5Dod35uYvzU5BnCzPkfR/nYZ57DdiUajEpKm4Ndt5OIw Kz8wv8tSeS7Soa0a8ioMF3Z4PIfUnvNqjabPGzk+o9KdjcipDl3bSg27L4Rs/hbO BZ+wjA4JNo/V9X6ftav6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1694938953; x=1695025353; bh=Xp/MOoyoW8xOh 3Va4uXTTi2c3gx/7P/WNyJctxmXOSo=; b=ld0Zm7b/3dFC9h1MFi7ipFioDA/KI pTs8u5eTVWmEVxdU+XMVO/5Kt/j6K+YlFH4bPsNS7vV+WLQCL4gmoYa4UM6ce5B4 KQwzfKf683en1emtpww7PYSc+ngEK7O254/Jb024LuYO+YaTzr7pwrkyEcSmpW5l ER/QagI91fVzNe5nh7HKNStmYLSjuTwKwzJKsTixfnd66YE7GlxxJrUPiG2HaQHL WKZDMOmC4Q35GB/Mt52YOMhMH9S2HUTktjYWwuSQ0kl1nhBt777I2ZgHsDHggUmZ 7eeTzbAaZO2buKFV08lCZK1LlEWtKuWCHOHp4DzPr5fQTUqs6dzEPtQ6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejiedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhtgfgggfukfffvffosehtqhhmtd hhtdejnecuhfhrohhmpeffrghphhhnvgcurfhrvghsthhonhdqmfgvnhgurghluceoughp khesnhhonhgtvgifohhrugdrohhrgheqnecuggftrfgrthhtvghrnhepieeuffeiuedvfe dtgfdvveefudelgeeiueejudetvdehheduteevjeffleefudffnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughpkhesnhhonhgtvgifohhrug drohhrgh X-ME-Proxy: Feedback-ID: ibc314252:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sun, 17 Sep 2023 04:22:32 -0400 (EDT) X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=64.147.123.21; envelope-from=dpk@nonceword.org; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-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-bounces+guile-bugs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.bugs:10661 Archived-At: A standard layout for R7RS libraries is to have an .sld file containing the library import and export declarations with a parallel .scm file with the same name in the same directory, which the .sld file (include ...)s. E.g. lib/dpk/mylibrary.sld: (define-library (dpk mylibrary) (import (scheme base)) (export make-frob #;etc) (include "mylibrary.scm")) and then mylibrary.scm is also in the same lib/dpk directory as mylibrary.scm and includes the actual code. Guile supports looking for .sld files before .scm files if started in --r7rs mode. However, in this case, it will not find the .scm file if it=E2=80=99s included from the .sld file. Starting Guile with: guile --r7rs -L './lib' or by setting the GUILE_LOAD_PATH environment variable, (in both cases with absolute paths or relative ones) and attempting to import libraries such as this results in a file not found error for the included .scm file, e.g.: scheme@(guile-user)> (import (chibi shell)) ;;; note: source file /Users/dpk/Projects/r7rs/lib/chibi/shell.sld ;;; newer than compiled = /Users/dpk/.cache/guile/ccache/3.0-LE-8-4.6/Users/dpk/Projects/r7rs/lib/ch= ibi/shell.sld.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /Users/dpk/Projects/r7rs/lib/chibi/shell.sld ;;; WARNING: compilation of /Users/dpk/Projects/r7rs/lib/chibi/shell.sld = failed: ;;; In procedure open-file: No such file or directory: "chibi/shell.scm" scheme@(guile-user)>=20 Curiously, including a file which *actually* doesn=E2=80=99t exist = results in two different, one of which correctly reports the full path of the file it=E2=80=99s purportedly trying to include: scheme@(guile-user)> (import (chibi shell)) ;;; note: source file /Users/dpk/Projects/r7rs/lib/chibi/shell.sld ;;; newer than compiled = /Users/dpk/.cache/guile/ccache/3.0-LE-8-4.6/Users/dpk/Projects/r7rs/lib/ch= ibi/shell.sld.go ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=3D0 ;;; or pass the --no-auto-compile argument to disable. ;;; compiling /Users/dpk/Projects/r7rs/lib/chibi/shell.sld ;;; WARNING: compilation of /Users/dpk/Projects/r7rs/lib/chibi/shell.sld = failed: ;;; In procedure open-file: No such file or directory: = "chibi/wonderpants.scm" While compiling expression: In procedure open-file: No such file or directory: = "/Users/dpk/Projects/r7rs/lib/chibi/wonderpants.scm" scheme@(guile-user)>=20 So this smells like a bug where the part of the R7RS library code looks in the wrong place and fails, but after it=E2=80=99s already = failed, a second part of the code looks again in the correct location and reports another error if the file really didn=E2=80=99t exist. This is a strange hypothesis but it=E2=80=99s the only thing I can think of. Changing the path in the include declaration to be absolute fixes the problem, but then it no longer works on other people=E2=80=99s machines. Guile version: 3.0.9 installed from nix-unstable