unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: Modified load-path proposal
Date: Sun, 30 Oct 2005 18:04:58 +0000	[thread overview]
Message-ID: <87u0ey3mph.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <87vezhbknv.fsf@ossau.uklinux.net> (Neil Jerram's message of "Fri, 28 Oct 2005 18:45:08 +0100")

Neil Jerram <neil@ossau.uklinux.net> writes:

> So all that's left is:
>
> - config.scm, as previously described but with simpler format like
>   this:
>
>   ((load-path
>     "/usr/share/guile/site"
>     "/usr/share/guile"
>     "/usr/share/guile/1.6"
>     ...)
>    ...)
>
> - Guile's reading of config.scm on startup, as previously described
>   (and respecting $sysconfdir)
>
> - guile-config ensure-load-path and guile-config clean-load-path, for
>   use at package author's discretion in Makefile.am.
>
> Everyone happy with that?

Well, I'm not sure I am.  This is still not quite nice, in that (i)
editing config.scm when a 3rd party package is installed or removed is
not as neat as just creating or deleting a file in an init.d style
directory; (ii) there's no trace of why a load path directory is
present in config.scm, i.e. which packages are relying on it.

I've reviewed everything I'm aware of that's been written on this
subject, starting from Marius's and Rob's original proposal at
http://lists.gnu.org/archive/html/guile-devel/2004-11/msg00016.html,
and I'm finally inclined to think that an init.d approach is nicer
than a config.scm file that can be automatically edited.

In the init.d approach, there would be a directory named
$sysconfdir/guile/X.Y/init.d, and we would distribute an init.scm file
(which Guile normally loads on startup) which would load all the files
in $sysconfdir/guile/X.Y/init.d.  So, for example, when a package
guile-foo is installed under $prefix, it would create the file
$sysconfdir/guile/X.Y/init.d/guile-foo with contents:

(require-load-path-directory "$prefix/wherever/my/scheme/files/are")

There was consensus in the previous discussion that a package should
not do anything in such files except for load path modification.  We
could enforce this by making the contents instead:

"$prefix/wherever/my/scheme/files/are"

and making init.scm read the file instead of loading it, but that
would mean that if we ever do think of something else that the init.d
files should be able to do, we'd have to enhance the whole mechanism
again.  On balance I think it's best to load the init.d files (hence
theoretically allowing arbitrary code) but make it clear by
documentation/convention that only load path extension is expected.

In comparison with the config.scm idea, the advantages are that you
can immediately see from the contents of the init.d directory which
packages are relying on particular load path directories (and, from
the free software point of view, you can see where to go to find the
scheme files for guile-foo), that there is no need for a heuristic to
decide when to remove a directory, and that creating or deleting an
init.d file is similar to what packaging systems already do when
installing an add-on for other subsystems.

Some other details from the past discussions ...

1. Whether init.scm is seen as belonging to Guile, to the
   distribution, or to the local sysadmin.

   It would be nice to put most of the code for the init.d system into
   boot-9.scm (or a file that boot-9.scm loads), so that init.scm can
   have just a one-liner which makes it all happen.  (If we want to
   get sophisticated, there could be options to this one-liner to
   exclude the processing of particular packages, or to limit the set
   of packages that is processed to a named set, or to force an
   ordering ...)

   Then I think it is easy for either the distribution or the sysadmin
   to tweak init.scm as they need, but still clear how to get the
   "standard" Guile behaviour.

2. An option for suppressing the loading of init.scm.

   It seems straightforward that this is a good idea, like
   --no-site-file in Emacs.  (Note that more finegrained selection -
   i.e. "run this part of init.scm but not that part" - can be
   implemented within the code of init.scm itself, if that is ever
   useful.)

3. Reading from $sysconfdir/guile/common/init.d as well as
   $sysconfdir/guile/X.Y/init.d, for packages that are not dependent
   on a particular Guile version.

   Seems like a good idea also.  We could make the default one-liner
   invocation do this, put provide an option for more precise control
   if the distribution or sysadmin needs it.

Finally, to be concrete about how this would end up looking in a 3rd
party package's files, I think it would be something like this:

---8<---guile-foo.in---8<---
(require-load-path-directory "@-datadir-@/guile")
---8<---guile-foo.in---8<---

---8<---Makefile.am---8<---
...
guileinitdir = @guileconfdir@/@GUILE_EFFECTIVE_VERSION@/init.d
guileinit_DATA = guile-foo

guile-foo: guile-foo.in
	sed -e "s,@-datadir-@,@datadir@,g" < $< > $@
...
---8<---Makefile.am---8<---

And some autoconfery would be needed to make @guileconfdir@ expand to
`guile-config info sysconfdir`/guile.

Sorry to have been carrying on this discussion for so long, and for
changing direction a couple of times.  If anyone is still reading, I'd
appreciate hearing your thoughts (again).

     Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


  reply	other threads:[~2005-10-30 18:04 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-13 18:21 Modified load-path proposal Neil Jerram
2005-10-13 18:40 ` Greg Troxel
2005-10-13 22:08   ` Neil Jerram
2005-10-14  0:37     ` Greg Troxel
2005-10-14  1:28       ` Andreas Rottmann
2005-10-15 11:17         ` Neil Jerram
2005-10-15 15:03           ` Greg Troxel
2005-10-15 17:53             ` Neil Jerram
2005-10-22 23:16           ` Kevin Ryde
2005-10-28 17:45             ` Neil Jerram
2005-10-30 18:04               ` Neil Jerram [this message]
2005-10-30 18:15                 ` Tomas Zerolo
2005-10-30 20:37                 ` Thien-Thi Nguyen
2005-10-30 22:59                   ` Neil Jerram
2005-10-31 10:55                     ` Thien-Thi Nguyen
2005-10-31 19:22                       ` Neil Jerram
2005-11-08 12:37                         ` Thien-Thi Nguyen
2005-10-31 13:17                   ` Tomas Zerolo
2005-10-30 23:48                 ` Kevin Ryde
2005-10-31 13:20                   ` Tomas Zerolo
2005-10-31 19:20                   ` Neil Jerram
2005-10-31 23:54                     ` Kevin Ryde
2005-11-12  9:47                       ` Neil Jerram
2005-11-01 23:31                     ` Vorfeed Canal
2005-11-12 17:54                       ` Neil Jerram
2005-11-02  8:44                 ` Ludovic Courtès
2005-12-03 13:05                   ` Neil Jerram
2005-12-13  8:38                     ` Ludovic Courtès
2005-12-16  0:16                       ` Neil Jerram
2005-12-16  1:00                         ` Neil Jerram
2005-12-16  9:55                         ` Ludovic Courtès
2006-01-07 13:37                           ` Neil Jerram
2006-01-11  4:49                             ` steve tell
2006-01-12 18:01                               ` Neil Jerram
2005-10-15 11:24       ` Neil Jerram
2005-10-15 15:01         ` Greg Troxel
2005-10-15 17:49           ` Neil Jerram
2005-10-14  7:24 ` Ludovic Courtès
2005-10-15 11:55   ` Neil Jerram
2005-10-15 15:40     ` Greg Troxel
2005-10-17  8:04       ` Ludovic Courtès
2005-10-17 17:52         ` Greg Troxel
2005-10-18  8:23           ` Search path for C libraries Ludovic Courtès
2005-10-18 10:12             ` Vorfeed Canal
2005-10-17 17:54         ` Modified load-path proposal Neil Jerram
2005-10-18  7:57           ` Ludovic Courtès
2005-10-19 22:30             ` Neil Jerram
2005-10-20  7:56               ` Vorfeed Canal
2005-10-20  8:05               ` Ludovic Courtès
2005-10-20 22:23                 ` Neil Jerram
2005-10-21  7:59                   ` Ludovic Courtès
2005-10-17 18:10       ` Neil Jerram
2005-10-18 16:16         ` Greg Troxel
2005-10-18 21:24           ` Vorfeed Canal
2005-10-19 22:29           ` Neil Jerram

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=87u0ey3mph.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    /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).