The gnucash binary now removed from CVS - (and config issues)

Derek Atkins warlord@MIT.EDU
21 Nov 2001 13:37:44 -0500


I think that, by default, you should get what was found/set at
configure time.  That provides the path-of-least-resistance to
new users.  What I mean is that in a distributed environment
the package-builder might know better than the end-user what
is required to run Gnucash in the environment.

For example, if gnucash is compiled against guile 1.4, but both
1.4 and 1.3.4 are available (and 1.3.4 happens to be in the
user's path first), Gnucash will die a horrible death.

I don't mind allowing the user to over-ride the default.  That's fine.
But a user should not need to do anything special to run gnucash, and
the package-builder should have to do all the work to get the
environment set up properly.

In my case, I've built gnucash so that 10,000 people can use it.
Requiring all 10,000 people to have the right PATH, LD_LIBRARY_PATH,
GC_FOO_ENV, etc variables set properly in order to run gnucash is
unacceptable.  They should just be able to:

	add gnucash; gnucash

where add is a local command that basically adds 'gnucash' to the path
from a network file system.  Note that 'add' does not add dependencies
to the path, nor does it deal with conflicts.

This invocation currently works for 1.6.4, and it has worked for CVS
until today.  I haven't tested it with the new version, yet, to see if
it still works.  However, users shouldn't have to know where the
version of 'guile' was when I built gnucash.

-derek

Rob Browning <rlb@defaultvalue.org> writes:

> I've rearranged things a bit and finally done away with the gnucash
> binary.
> 
> Let me know if there are any problems.
> 
> There is also a new script, which may or may not stay around,
> depending on what Dave and I decide, called gnucash-env.  You can use
> this to run arbitrary commands with suitable gnucash environment
> settings.  It is already being used by the main gnucash script, and
> you invoke it like this:
> 
>   gnucash-env some-cmd arg1 arg2
> 
> so if you just wanted to run a guile script that uses the gnucash
> infrastructure, you might do this:
> 
>   gnucash-env guile -s some-script arg1 arg2
> 
> One thing that's not clear to me ATM is what the semantics wrt to
> choosing the right "guile" should be.  If you just say "guile" as
> above, should you get the one that was found at configure-time, or
> should you get whichever one is currently in your path?
> 
> This is another one of those somewhat ugly configuration questions:
> should the user have the flexibility at run-time to modify which tools
> they're using via the traditional PATH (and sometimes LD_LIBRARY_PATH)
> mechanisms, or should we force usage of the tools that were determined
> at configure-time?
> 
> It looks like gnucash-run-script may address this question by using a
> GNC_GUILE environment variable for overrides.  I'm not sure what the
> best approach is.
> 
> I can see situations where any of the above approaches could be
> problematic.  I'm wondering if a well-documented and suitably flexible
> gnucash-env command might be the answer -- i.e. with command-line
> switches to give you different behaviors i.e.:
> 
>   gnucash-env --use-guile-in-path ...
>   gnucash-env --configured-guile ...
> 
> but even here you're going to run in to trouble -- how do you choose
> the configured guile?  If you just invoke it explicitly with a full
> path, then you'll get the one you want, but any sub-execlp's from your
> script will get the wrong one.
> 
> Alternately, if you just augment the PATH to make sure you get the
> right one, how do you do that?  Do you put the dir at the end of the
> PATH as a default, or do you put it at the front so you're sure it's
> used.  If the latter, then what if the guile that was found at
> configure time was /usr/bin/guile, and so now you're adding /usr/bin
> to the front of the PATH, and probably screwing up anyone who has
> important tools in /usr/local/bin that should shadow /usr/bin...
> 
> -- 
> Rob Browning
> rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
> Previously @cs.utexas.edu
> GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel@lists.gnumatic.com
> http://www.gnumatic.com/cgi-bin/mailman/listinfo/gnucash-devel

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available