guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generating compiled scm (.go) files as part of LilyPond build


From: Andy Wingo
Subject: Re: Generating compiled scm (.go) files as part of LilyPond build
Date: Fri, 28 Jan 2011 17:17:20 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Ian,

On Thu 30 Dec 2010 12:43, Ian Hulin <address@hidden> writes:

> On 01/12/10 22:08, Andy Wingo wrote:
>> On Wed 01 Dec 2010 22:21, Ian Hulin <address@hidden> writes:
>> 
>>> address@hidden 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 via email to

[Prev in Thread] Current Thread [Next in Thread]