unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Vijay Marupudi <vijaymarupudi@gatech.edu>
To: Taylan Kammer <taylan.kammer@gmail.com>, 49452@debbugs.gnu.org
Subject: bug#49452: Confusing behavior with (include) used in file in GUILE_LOAD_PATH
Date: Thu, 8 Jul 2021 06:43:05 -0500	[thread overview]
Message-ID: <ac84f060-b09c-f182-9473-a6cbcd743820@gatech.edu> (raw)
In-Reply-To: <f043844e-dc06-6849-688a-d780e4706237@gmail.com>

Thank you Taylan. This does appear to be the same bug. This bug can be
closed as a duplicate. Looks like Andy Wingo suggested a potential fix,
but there was no follow-up. If someone is willing to show me the ropes
when I need them, I can take a stab at learning the Guile codebase and
fixing the bug.

Vijay

On 7/7/21 3:29 AM, Taylan Kammer wrote:
> On 07.07.2021 02:31, Vijay Marupudi wrote:
>> Hello all,
>>
>> It is unclear to me what the intended behavior for (include
>> "filename.scm") is, so I'm sending an email about this potential bug.
>>
>> The Local Inclusion docs
>> <https://www.gnu.org/software/guile/manual/html_node/Local-Inclusion.html>
>> seem to state that relative paths are found relative to the file that
>> included them.
>>
>>> If file-name is a relative path, it is searched for relative to the
>>> path that contains the file that the include form appears in.
>>
>> So if I have a file "/libraries/libname/main.scm" than has (include
>> "./helpers.scm"), then the file "/libraries/libname/helpers.scm"
>> *should* (I think) be imported.
>>
>> But this does not seem to work if "/libraries" is in the GUILE_LOAD_PATH
>> and my current working directory is somewhere else, say "/home/user" and
>> I'm running "/home/user/program.scm" that imports the (libname main)
>> library from "/libraries". Then Guile seems to try to include the
>> "libname/helpers.scm" file from the current directory, which does not
>> exist.
>>
>> Conversations with leoprikler in IRC have revealed to me that
>> call-with-include-port is the function responsible for this behavior
>> <https://git.savannah.gnu.org/cgit/guile.git/tree/module/ice-9/psyntax.scm#n3231>.
>> `syntax-source` returns a file path relative to the load path, and
>> include tries to use that path to open a file relative to the current
>> working directory.
>>
>> In Guile's bug guidelines
>> <https://www.gnu.org/software/guile/docs/docs-2.2/guile-ref/Reporting-Bugs.html>,
>> to me this fits
>>
>> * Whenever documentation and actual behavior differ, you have certainly
>>   found a bug, either in the documentation or in the program.
>>
>> and potentially
>>
>> * When some part of the documentation is not clear and does not make
>>   sense to you even after re-reading the section, it is a bug.
>>
>> I believe this is a bug, but I may be wrong, so emailing to clarify.
>> Thank you!
>>
>> Vijay Marupudi
>> PhD Student in Human Centered-Computing
>> Georgia Institute of Technology
> 
> Hi Vijay,
> 
> I believe this is the same bug as this one I reported 5-6 years ago:
> 
> https://bugs.gnu.org/21613
> 
> Sadly there was no progress on it as far as I know.
> 





  reply	other threads:[~2021-07-08 11:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-07  0:31 bug#49452: Confusing behavior with (include) used in file in GUILE_LOAD_PATH Vijay Marupudi
2021-07-07  8:29 ` Taylan Kammer
2021-07-08 11:43   ` Vijay Marupudi [this message]
2021-07-07 21:22 ` Bengt Richter
2021-07-09  4:08   ` Vijay Marupudi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac84f060-b09c-f182-9473-a6cbcd743820@gatech.edu \
    --to=vijaymarupudi@gatech.edu \
    --cc=49452@debbugs.gnu.org \
    --cc=taylan.kammer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).