GNU bug report logs - #10326
Need to document %load-path, %load-compiled-path, and add %search-load-compiled-path and load-compiled-from-path to API

Previous Next

Package: guile;

Reported by: Ian Hulin <ian <at> hulin.org.uk>

Date: Mon, 19 Dec 2011 15:03:01 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10326 in the body.
You can then email your comments to 10326 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#10326; Package guile. (Mon, 19 Dec 2011 15:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ian Hulin <ian <at> hulin.org.uk>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Mon, 19 Dec 2011 15:03:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ian Hulin <ian <at> hulin.org.uk>
To: bug-guile <at> gnu.org
Subject: Need to document %load-path, %load-compiled-path,
	and add %search-load-compiled-path and load-compiled-from-path to API
Date: Mon, 19 Dec 2011 15:00:19 +0000
Section 6.17.6 of the manual could do with a sections for %load-path
and %load-compiled-path.

e.g.
— Variable: %load-path

    The list of directories which will currently be searched by
load-from-path, primitive-load-path and %search-load-path to locate a
scheme file.

- Variable: %load-compiled-path

    The list of directories which will currently be searched by
load-compiled-from-path and %search-load-compiled-path to locate a
compiled scheme file.


Also, Guile really needs to provide a %search-load-compiled-path and a
load-compiled-from-path, it would have been useful in LilyPond code, and
Manual Section 4.7 (discussing site locations says)
"As with Scheme files, Guile searches a path to find compiled .go
files, the %load-compiled-path. By default, this path has two entries:
a path for Guile's files, and a path for site packages. You should
install your .go files into the latter. Currently there is no
procedure to get at this path, which is probably a bug."


— Scheme Procedure: %search-load-compiled-path filename
— C Function: scm_sys_search_load_compiled_path (filename)

    Search %load-compiled-path for the file named filename, which must
be readable by the current user. If filename is found in the list of
paths to search or is an absolute pathname, return its full pathname.
Otherwise, return #f.

— Scheme Procedure: load-compiled-from-path filename

    Similar to load-compiled, but searches for filename in the
compiled load paths.







Information forwarded to bug-guile <at> gnu.org:
bug#10326; Package guile. (Fri, 23 Dec 2011 23:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 10326 <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: 10326 <at> debbugs.gnu.org
Subject: Re: bug#10326: Need to document %load-path, %load-compiled-path,
	and add %search-load-compiled-path and load-compiled-from-path to API
Date: Fri, 23 Dec 2011 23:46:58 +0000
Ian Hulin <ian <at> hulin.org.uk> writes:

> Section 6.17.6 of the manual could do with a sections for %load-path
> and %load-compiled-path.
>
> e.g.
> — Variable: %load-path
>
>     The list of directories which will currently be searched by
> load-from-path, primitive-load-path and %search-load-path to locate a
> scheme file.
>
> - Variable: %load-compiled-path
>
>     The list of directories which will currently be searched by
> load-compiled-from-path and %search-load-compiled-path to locate a
> compiled scheme file.

%load-path is already documented in 2.0, in section 6.22.1, 6.17.6 may
be a better place for it though, as that is where
e.g. %search-load-path, %load-hook etc. are.

%load-compiled-path seems to be only indirectly referred to in the
%documentation for GUILE_LOAD_COMPILED_PATH and compiled-file-name.

> Also, Guile really needs to provide a %search-load-compiled-path and a
> load-compiled-from-path, it would have been useful in LilyPond code, and
> Manual Section 4.7 (discussing site locations says)

I don't see a %search-load-compiled-path or load-compiled-from-path in
guile 2.0's stable branch. Where these removed? Or have I missed them?

> "As with Scheme files, Guile searches a path to find compiled .go
> files, the %load-compiled-path. By default, this path has two entries:
> a path for Guile's files, and a path for site packages. You should
> install your .go files into the latter. Currently there is no
> procedure to get at this path, which is probably a bug."
>
>
> — Scheme Procedure: %search-load-compiled-path filename
> — C Function: scm_sys_search_load_compiled_path (filename)
>
>     Search %load-compiled-path for the file named filename, which must
> be readable by the current user. If filename is found in the list of
> paths to search or is an absolute pathname, return its full pathname.
> Otherwise, return #f.

Unless you meant %search-load-compiled-path, this sounds similar to the
documented procedure 'compiled-file-name'
>
> — Scheme Procedure: load-compiled-from-path filename
>
>     Similar to load-compiled, but searches for filename in the
> compiled load paths.
If the above is correct, this is just
(compose load-compiled compiled-file-name), yes?
Might be useful for symmetry with 'load-from-path'

-- 
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




Information forwarded to bug-guile <at> gnu.org:
bug#10326; Package guile. (Sat, 24 Dec 2011 12:25:02 GMT) Full text and rfc822 format available.

Message #11 received at 10326 <at> debbugs.gnu.org (full text, mbox):

From: Ian Hulin <ian <at> hulin.org.uk>
To: Ian Price <ianprice90 <at> googlemail.com>
Cc: 10326 <at> debbugs.gnu.org
Subject: Re: bug#10326: Need to document %load-path, %load-compiled-path,
	and add %search-load-compiled-path and load-compiled-from-path to API
Date: Sat, 24 Dec 2011 12:22:34 +0000
Hi Ian,
On 23/12/11 23:46, Ian Price wrote:
> Ian Hulin <ian <at> hulin.org.uk> writes:
> 
>> Section 6.17.6 of the manual could do with a sections for
>> %load-path and %load-compiled-path.
>> 
>> e.g. — Variable: %load-path
>> 
>> The list of directories which will currently be searched by 
>> load-from-path, primitive-load-path and %search-load-path to
>> locate a scheme file.
>> 
>> - Variable: %load-compiled-path
>> 
>> The list of directories which will currently be searched by 
>> load-compiled-from-path and %search-load-compiled-path to locate
>> a compiled scheme file.
> 
> %load-path is already documented in 2.0, in section 6.22.1, 6.17.6
> may be a better place for it though, as that is where e.g.
> %search-load-path, %load-hook etc. are.
> 
Or a cross-ref,or move it from 6.22 and put the cross-ref in here,
depending on Guile's documentation policies.
> %load-compiled-path seems to be only indirectly referred to in the 
> %documentation for GUILE_LOAD_COMPILED_PATH and
> compiled-file-name.
> 
>> Also, Guile really needs to provide a %search-load-compiled-path
>> and a load-compiled-from-path, it would have been useful in
>> LilyPond code, and Manual Section 4.7 (discussing site locations
>> says)
> 
> I don't see a %search-load-compiled-path or load-compiled-from-path
> in guile 2.0's stable branch. Where these removed? Or have I missed
> them?
> 
I don't think they were ever implemented.
>> "As with Scheme files, Guile searches a path to find compiled
>> .go files, the %load-compiled-path. By default, this path has two
>> entries: a path for Guile's files, and a path for site packages.
>> You should install your .go files into the latter. Currently
>> there is no procedure to get at this path, which is probably a
>> bug."
>> 
>> 
>> — Scheme Procedure: %search-load-compiled-path filename — C
>> Function: scm_sys_search_load_compiled_path (filename)
>> 
>> Search %load-compiled-path for the file named filename, which
>> must be readable by the current user. If filename is found in the
>> list of paths to search or is an absolute pathname, return its
>> full pathname. Otherwise, return #f.
> 
> Unless you meant %search-load-compiled-path, this sounds similar to
> the documented procedure 'compiled-file-name'
No: compiled-file-name does more and different things which are
intimately linked in to --auto-compile and its related cache.

If you're compiling things to locations outside of this cache (as we
need to do for LilyPond) you need to set a directory as an entry in
%load-compiled-path and pass this explicitly to compile-file (guild
compile if your doing this from within a build environment).

We then need to have custom code to load the compiled files during
startup. This is because the built-in things in load-from-path et al.
rely on compiled-file-name which don't do the right thing if you're
compiling to a location outside the --auto-compile cache.

So. . . if we want to load our compiled scheme files, possibly
produced from guild compile in a build, outside of the --auto-compile
cache, we have to use load-compiled, which explicitly says "Load the
compiled file named /filename/.  The load paths are not searched."

>> 
>> — Scheme Procedure: load-compiled-from-path filename
>> 
>> Similar to load-compiled, but searches for filename in the 
>> compiled load paths.
> If the above is correct, this is just (compose load-compiled
> compiled-file-name), yes?
No.  See above
> Might be useful for symmetry with 'load-from-path'
> 
Yes.

Cheers,
Ian Hulin




Information forwarded to bug-guile <at> gnu.org:
bug#10326; Package guile. (Sat, 24 Dec 2011 12:26:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guile <at> gnu.org:
bug#10326; Package guile. (Fri, 27 Jan 2012 13:50:01 GMT) Full text and rfc822 format available.

Message #17 received at 10326 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Ian Hulin <ian <at> hulin.org.uk>
Cc: 10326 <at> debbugs.gnu.org
Subject: Re: bug#10326: Need to document %load-path, %load-compiled-path, and
	add %search-load-compiled-path and load-compiled-from-path to API
Date: Fri, 27 Jan 2012 13:20:08 +0100
Hi Ian,

Thank you for the bug report.  As a result of this report we have added
a fair amount of documentation and reorganized other things.

In particular, see the new sections:

  Modules and the File System
  Installing Site Packages
  Load Paths

On Mon 19 Dec 2011 16:00, Ian Hulin <ian <at> hulin.org.uk> writes:

> - Variable: %load-compiled-path
>
>     The list of directories which will currently be searched by
> load-compiled-from-path and %search-load-compiled-path to locate a
> compiled scheme file.

There is no load-compiled-from-path or %search-load-compiled-path.
There is, however, search-path and %load-compiled-path.

Guile doesn't simply look for compiled files: it looks for compiled
files that correspond to source files.  They could be in the
load-compiled path or in the fallback path.  The search rules are
different here -- see "Load Paths" and "Compilation", for details.
Auto-compilation only happens with the fallback path.

Do you still think that load-compiled-from-path would be useful to you?
If everything is set up correctly, load-from-path should be sufficient,
as it would find the corresponding compiled file.

> "As with Scheme files, Guile searches a path to find compiled .go
> files, the %load-compiled-path. By default, this path has two entries:
> a path for Guile's files, and a path for site packages. You should
> install your .go files into the latter. Currently there is no
> procedure to get at this path, which is probably a bug."

I'll see about fixing this.

Andy
-- 
http://wingolog.org/




Reply sent to Andy Wingo <wingo <at> pobox.com>:
You have taken responsibility. (Sun, 10 Mar 2013 22:24:01 GMT) Full text and rfc822 format available.

Notification sent to Ian Hulin <ian <at> hulin.org.uk>:
bug acknowledged by developer. (Sun, 10 Mar 2013 22:24:01 GMT) Full text and rfc822 format available.

Message #22 received at 10326-done <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Ian Hulin <ian <at> hulin.org.uk>
Cc: 10326-done <at> debbugs.gnu.org
Subject: Re: bug#10326: Need to document %load-path, %load-compiled-path, and
	add %search-load-compiled-path and load-compiled-from-path to API
Date: Sun, 10 Mar 2013 23:22:26 +0100
On Fri 27 Jan 2012 13:20, Andy Wingo <wingo <at> pobox.com> writes:

>> "As with Scheme files, Guile searches a path to find compiled .go
>> files, the %load-compiled-path. By default, this path has two entries:
>> a path for Guile's files, and a path for site packages. You should
>> install your .go files into the latter. Currently there is no
>> procedure to get at this path, which is probably a bug."
>
> I'll see about fixing this.

Added %site-ccache-dir, and updated docs.

Andy
-- 
http://wingolog.org/




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 08 Apr 2013 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 72 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.