unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guile-vm .go files in GUILE_LOAD_PATH
@ 2008-09-17 22:57 dsmich
  2008-09-18  3:55 ` David Séverin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: dsmich @ 2008-09-17 22:57 UTC (permalink / raw)
  To: guile-devel

I've been tracking the guile-vm branch lately and had a recent problem.  After much head scratching we finally figured out that a previously installed .go file was being used during the buld.

We (Andy and I on irc) hacked around it by creating a new environment variable that pre-inst-guile-env can use to override or disable things that libguile adds to the load-path.  However, I think there is still a problem.

Basically, a .go file will be preferred over a .scm file even if the .scm file is earlier in the load-path.  I think that the file earlier in the load-path should win.

Thoughts?

-Dale





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
  2008-09-17 22:57 guile-vm .go files in GUILE_LOAD_PATH dsmich
@ 2008-09-18  3:55 ` David Séverin
  2008-09-18  7:26 ` Neil Jerram
  2008-09-18 18:40 ` Andy Wingo
  2 siblings, 0 replies; 7+ messages in thread
From: David Séverin @ 2008-09-18  3:55 UTC (permalink / raw)
  To: dsmich; +Cc: guile-devel

Le Wed, 17 Sep 2008 18:57:19 -0400,
<dsmich@roadrunner.com> a écrit :

> I've been tracking the guile-vm branch lately and had a recent problem.
> After much head scratching we finally figured out that a previously
> installed .go file was being used during the buld.
> 
> We (Andy and I on irc) hacked around it by creating a new environment
> variable that pre-inst-guile-env can use to override or disable things that
> libguile adds to the load-path.  However, I think there is still a problem.
> 
> Basically, a .go file will be preferred over a .scm file even if the .scm
> file is earlier in the load-path.  I think that the file earlier in the
> load-path should win.
> 
> Thoughts?
> -Dale

Should it not be a user responsibility? I mean:

I would place my .go files next to my .scm files and expect the
loading process to warn me if the .scm file was newer, but still would
load all .go files when available.

David




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
  2008-09-17 22:57 guile-vm .go files in GUILE_LOAD_PATH dsmich
  2008-09-18  3:55 ` David Séverin
@ 2008-09-18  7:26 ` Neil Jerram
  2008-09-18 18:40 ` Andy Wingo
  2 siblings, 0 replies; 7+ messages in thread
From: Neil Jerram @ 2008-09-18  7:26 UTC (permalink / raw)
  To: dsmich; +Cc: guile-devel

2008/9/18  <dsmich@roadrunner.com>:
> Basically, a .go file will be preferred over a .scm file even if the .scm file is earlier in the load-path.  I think that the file earlier in the load-path should win.
>
> Thoughts?

I agree.  I think that's what Emacs does, and Emacs is a good example
to follow.  It may also be worth checking out what Python does.


    Neil




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
  2008-09-17 22:57 guile-vm .go files in GUILE_LOAD_PATH dsmich
  2008-09-18  3:55 ` David Séverin
  2008-09-18  7:26 ` Neil Jerram
@ 2008-09-18 18:40 ` Andy Wingo
  2 siblings, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2008-09-18 18:40 UTC (permalink / raw)
  To: dsmich; +Cc: guile-devel

Hi,

On Thu 18 Sep 2008 00:57, <dsmich@roadrunner.com> writes:

> Basically, a .go file will be preferred over a .scm file even if the
> .scm file is earlier in the load-path. I think that the file earlier
> in the load-path should win.

A few thoughts:

 (1) Guile shouldn't have installed paths (its system paths) in its path
     when running uninstalled, otherwise you can get strange issues like
     you saw -- it's not limited to .go files, it could be .scm as well

 (2) I can imagine cases in which you would want compiled files not in
     the same location as source; e.g. /usr/lib64/guile/ vs
     /usr/share/guile/; although currently .go files are not
     platform-dependent (I don't think)

 (3) Currently there is no linkage between the absolute directory of the
     .scm file and the .go file, neither in the compilation nor in the
     loading; but there is a linking with the relative path if you use
     primitive-load-path

 (4) We already check to make sure that the .go file is newer than the
     .scm file

I would suggest that the current way is sufficient, if we disable
loading from the installed paths when running pre-inst-guile; because I
kinda want to allow (2), but I don't want to deal with ordering issues
within %load-path of "compiled locations" versus "source locations".

Sorry about your bug, I know it was a bit painful. But you would not
have had it if guile were operating correctly in the first place,
regardless of the .go vs .scm issue.

We certainly need to have a better story regarding versioning, so we
don't load incompatible .go files.

Andy
-- 
http://wingolog.org/




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
@ 2008-09-18 20:49 dsmich
  2008-09-18 21:14 ` Andy Wingo
  2008-09-18 22:32 ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: dsmich @ 2008-09-18 20:49 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

---- Andy Wingo <wingo@pobox.com> wrote: 
> Hi,
> 
> On Thu 18 Sep 2008 00:57, <dsmich@roadrunner.com> writes:
> 
> > Basically, a .go file will be preferred over a .scm file even if the
> > .scm file is earlier in the load-path. I think that the file earlier
> > in the load-path should win.
> 
> A few thoughts:
> 
>  (1) Guile shouldn't have installed paths (its system paths) in its path
>      when running uninstalled, otherwise you can get strange issues like
>      you saw -- it's not limited to .go files, it could be .scm as well

True.

>  (2) I can imagine cases in which you would want compiled files not in
>      the same location as source; e.g. /usr/lib64/guile/ vs
>      /usr/share/guile/; although currently .go files are not
>      platform-dependent (I don't think)

Hmm.  Also true.

>  (4) We already check to make sure that the .go file is newer than the
>      .scm file

Good.

> I would suggest that the current way is sufficient, if we disable
> loading from the installed paths when running pre-inst-guile; because I
> kinda want to allow (2), but I don't want to deal with ordering issues
> within %load-path of "compiled locations" versus "source locations".

I'm pretty sure the case of not using the already installed system .scm files while building is handled now.  I'm thinking more along the lines of some user wanted to override a system file for some reason. This issue came up for me when I wanted to use a newer gnus than what came with the system supplied emacs.  At that time I didn't have admin privs so I just installed gnus somewhere under my home dir and made sure that the emacs load path searched there first.  Can this situation ever come up in Guile?  Maybe.

As Neil mentioned, emacs is a good example to follow.  That's why I'm suggesting this.

> Sorry about your bug, I know it was a bit painful. But you would not
> have had it if guile were operating correctly in the first place,
> regardless of the .go vs .scm issue.

No problem there.  Finding (and fixing) bugs is what makes using developing code fun. ;^)

Thanks,
   -Dale





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
  2008-09-18 20:49 dsmich
@ 2008-09-18 21:14 ` Andy Wingo
  2008-09-18 22:32 ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Andy Wingo @ 2008-09-18 21:14 UTC (permalink / raw)
  To: dsmich; +Cc: guile-devel

Heya Dale,

On Thu 18 Sep 2008 22:49, <dsmich@roadrunner.com> writes:

> I'm pretty sure the case of not using the already installed system .scm
> files while building is handled now.

It is, but only because the uninstalled dirs are before the installed
dirs.

I committed a patch to the vm branch to remove the installed dirs from
guile's load path when running as pre-inst-guile:

    http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=02b84691b274155f4528f99e90fbe39c77ed546d

NB, relative to master, that patch depends on this one:

    http://git.savannah.gnu.org/gitweb/?p=guile.git;a=commitdiff;h=be52b55a3213c8f683d1007a542771daa3f9a06b

> I'm thinking more along the lines
> of some user wanted to override a system file for some reason. This
> issue came up for me when I wanted to use a newer gnus than what came
> with the system supplied emacs. At that time I didn't have admin privs
> so I just installed gnus somewhere under my home dir and made sure that
> the emacs load path searched there first. Can this situation ever come
> up in Guile? Maybe.

Sure it can. Hopefully you could get through it via the newer-than
check... but I do see your point.

> As Neil mentioned, emacs is a good example to follow. That's why I'm
> suggesting this.

I did look at its docs for quite some time before implementing it the
way that I did. That said, your solution may be the better one in the
long term. Does anyone else have an opinion?

Cheers,

Andy
-- 
http://wingolog.org/




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: guile-vm .go files in GUILE_LOAD_PATH
  2008-09-18 20:49 dsmich
  2008-09-18 21:14 ` Andy Wingo
@ 2008-09-18 22:32 ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2008-09-18 22:32 UTC (permalink / raw)
  To: guile-devel

Hi,

<dsmich@roadrunner.com> writes:

> I'm pretty sure the case of not using the already installed system
> .scm files while building is handled now.  I'm thinking more along the
> lines of some user wanted to override a system file for some
> reason. This issue came up for me when I wanted to use a newer gnus
> than what came with the system supplied emacs.  At that time I didn't
> have admin privs so I just installed gnus somewhere under my home dir
> and made sure that the emacs load path searched there first.  Can this
> situation ever come up in Guile?  Maybe.

That can be handled by setting $GUILE_LOAD_PATH appropriately; even
`boot-9.scm' can be overridden this way (which `-L' and `%load-path' do
not allow).

Thanks,
Ludo'.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-09-18 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-17 22:57 guile-vm .go files in GUILE_LOAD_PATH dsmich
2008-09-18  3:55 ` David Séverin
2008-09-18  7:26 ` Neil Jerram
2008-09-18 18:40 ` Andy Wingo
  -- strict thread matches above, loose matches on Subject: below --
2008-09-18 20:49 dsmich
2008-09-18 21:14 ` Andy Wingo
2008-09-18 22:32 ` Ludovic Courtès

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).