unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: file names embedded in .go
Date: Tue, 20 Apr 2010 01:23:37 +0200	[thread overview]
Message-ID: <87pr1vvxfq.fsf@gnu.org> (raw)
In-Reply-To: m34oj7bili.fsf@pobox.com

Hey,

Andy Wingo <wingo@pobox.com> writes:

> Oftentimes you would
> want to be able to map a .go file to a corresponding .scm, and currently
> it's difficult. For example if you compile in a +build subdirectory of
> Guile via `../configure', then the `port-filename' is e.g.
> "../../module/ice-9/boot-9.scm", which doesn't make any sense.

Likewise, this caused problems for coverage testing, where relative
paths weren’t correctly interpreted by LCOV, hence this change to embed
absolute paths:
<http://git.sv.gnu.org/cgit/guile.git/commit/?h=wip-coverage&id=873e4d69a08a9ceb2a7a0296130b6a884738324f>.

> One could instead embed the absolute path, but then you have the problem
> that you might remove your build or source directory; it doesn't make
> sense to have installed files pointing to build paths. DWARF does this,
> but only because with C you don't install the source, but with Guile you
> should.

Both good points!

(This obviously invalidates the absolute path change above.)

> So for me the right thing to do, by default, is to embed a path relative
> to the `%load-path', so that one can find the source file via something
> like:
>
>     (use-modules (system vm program))
>     (define (program-source-file p)
>       (search-path %load-path (source:file (program-source p 0))))

OK, though that’s unavoidably ambiguous: ‘%load-path’ could be different
than its compile-time value, etc.

> I added a keyword argument to compile-file and compile-and-load for this
> purpose,

OK.

> to parameterize %file-port-name-canonicalization during the extent of
> the given file's compilation.

As noted in the other thread, I’d rather get rid of this fluid and have
‘compile’ & co. call ‘canonicalize-path’.

Thanks,
Ludo’.





      parent reply	other threads:[~2010-04-19 23:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 14:52 file names embedded in .go Andy Wingo
2010-04-19 21:46 ` Thien-Thi Nguyen
2010-04-20  0:08   ` Jose A. Ortega Ruiz
2010-04-20 11:35     ` Thien-Thi Nguyen
2010-04-20 19:15       ` Jose A. Ortega Ruiz
2010-04-21  7:45         ` Thien-Thi Nguyen
2010-04-20  9:45   ` Andy Wingo
2010-04-20 10:34     ` Thien-Thi Nguyen
2010-04-19 23:12 ` port-filename and path canonicalization Ludovic Courtès
2010-04-20  9:42   ` Andy Wingo
2010-04-20 11:15     ` Thien-Thi Nguyen
2010-04-21  8:49       ` Ludovic Courtès
2010-04-21 19:16         ` Thien-Thi Nguyen
2010-04-21 22:26           ` Ludovic Courtès
2010-04-22  7:42             ` Thien-Thi Nguyen
2010-04-20 16:57     ` Ludovic Courtès
2010-04-22 11:10       ` Andy Wingo
2010-04-22 12:50         ` Ludovic Courtès
2010-04-19 23:23 ` Ludovic Courtès [this message]

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=87pr1vvxfq.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).