unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Ian Hulin <ian@hulin.org.uk>
Cc: guile-user@gnu.org, Patrick@asmtp3.iomartmail.com,
	Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Re: Generating compiled scm (.go) files as part of LilyPond build
Date: Fri, 28 Jan 2011 17:17:20 +0100	[thread overview]
Message-ID: <m3sjwdc8a7.fsf@unquote.localdomain> (raw)
In-Reply-To: <4D1C7061.1000701@hulin.org.uk> (Ian Hulin's message of "Thu, 30 Dec 2010 11:43:29 +0000")

Hi Ian,

On Thu 30 Dec 2010 12:43, Ian Hulin <ian@hulin.org.uk> writes:

> On 01/12/10 22:08, Andy Wingo wrote:
>> On Wed 01 Dec 2010 22:21, Ian Hulin <ian@hulin.org.uk> writes:
>> 
>>> ian@greebo$ guile-tools compile scm/lily-library.scm
>>> wrote
>>> `/home/ian/.cache/guile/ccache/2.0-0.S-LE-4/home/ian/lilypond/scm/lily-library.scm.go'
>> 
>> You will want to set the -o option, as in GCC. See guile-tools compile
>> --help.
>
> Thanks for the work-round, but I think there are problems with
> compiled-file-name, which in turn affect guile-tool compile,
> load-from-path and what happens when autocompile is in force.
>
> Documentation for compiled-file-name
> "— Scheme Procedure: compiled-file-name file
>
>     Compute an appropriate name for a compiled version of a Scheme file
> named file.
>
>     Usually, the result will be the original file name with the .scm
> suffix replaced with .go, but the exact behavior depends on the contents
> of the %load-extensions and %load-compiled-extensions lists. "

This documentation was out-of-date.  I have just committed updates to
master, which are not very good, but at least more truthy.

Basically compiled-file-name doesn't do any path searches.  It simply
computes a place in ~/.cache in which to cache the result of compiling
FILE.

As the comment in compile.scm says:

;;; This function is among the trickiest I've ever written. I tried many
;;; variants. In the end, simple is best, of course.
;;;
;;; After turning this around a number of times, it seems that the the
;;; desired behavior is that .go files should exist in a path, for
;;; searching. That is orthogonal to this function. For writing .go
;;; files, either you know where they should go, in which case you tell
;;; compile-file explicitly, as in the srcdir != builddir case; or you
;;; don't know, in which case this function is called, and we just put
;;; them in your own ccache dir in ~/.guile-ccache.

> 3. compiled-file-name isn't available at the API until either you've
> used compile-file or else explicitly loaded
> module (system base compile).

Load (system base compile) then, no?

> It looks like (compiled-file-name) uses a hard-coded default setting for
> %load-compiled-files to use as the root for cache.

It doesn't use that path at all.  It uses %compile-fallback-path.

Cheers,

Andy
-- 
http://wingolog.org/



  reply	other threads:[~2011-01-28 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-27 17:42 Generating compiled scm (.go) files as part of LilyPond build Ian Hulin
2010-11-28 12:01 ` Neil Jerram
2010-11-30 18:02   ` Ian Hulin
2010-11-29 21:17 ` Andy Wingo
2010-12-01 21:21   ` Ian Hulin
2010-12-01 22:08     ` Andy Wingo
2010-12-30 11:43       ` Ian Hulin
2011-01-28 16:17         ` Andy Wingo [this message]
     [not found]           ` <4D433723.50501@hulin.org.uk>
2011-01-29 11:21             ` Andy Wingo
2011-07-19 13:18               ` Ian Hulin
2011-07-19 14:28                 ` Andy Wingo
2011-07-19 23:08                   ` Ian Hulin
2011-07-20 17:38                     ` Andy Wingo
2011-07-21 12:43                     ` Ludovic Courtès

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=m3sjwdc8a7.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=Patrick@asmtp3.iomartmail.com \
    --cc=guile-user@gnu.org \
    --cc=hanwenn@gmail.com \
    --cc=ian@hulin.org.uk \
    /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).