Stephen Paul Weber | 12 Jan 23:36 2013
Picon

Environment variables in cabal config?

Is there any way to set the paths in my cabal-install config relative to 
$HOME or similar?  I tried ~ and $HOME and neither of those worked.

--

-- 
Stephen Paul Weber,  <at> singpolyma
See <http://singpolyma.net> for how I prefer to be contacted
edition right joseph
Simon Marlow | 9 Mar 18:19 2005
Picon

RE: environment variables for ghc

On 09 March 2005 08:29, Frederik Eaton wrote:

> Is it possible to set environment variables which ghc will look at,
> corresponding to command line options such as '-i' or '-package-conf'?
> I.e. the equivalent of gcc's LIBRARY_PATH, CPATH, etc... or perl's
> PERL5LIB or even PERL5OPT (which is the most flexible). These would be
> really convenient since I have a package.conf file in my home
> directory for locally installed packages, and some modules in another
> directory that I often link to.

There's the GHCRTS environment variable that you can use for setting
heap sizes and so on, and the ~/.ghci file, but nothing for setting ghc
command-line arguments.  We're a bit wary of adding more things that we
have to ask for in a bug report...

Cheers,
	Simon
Frederik Eaton | 9 Mar 19:01 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 05:19:18PM -0000, Simon Marlow wrote:
> On 09 March 2005 08:29, Frederik Eaton wrote:
> 
> > Is it possible to set environment variables which ghc will look at,
> > corresponding to command line options such as '-i' or '-package-conf'?
> > I.e. the equivalent of gcc's LIBRARY_PATH, CPATH, etc... or perl's
> > PERL5LIB or even PERL5OPT (which is the most flexible). These would be
> > really convenient since I have a package.conf file in my home
> > directory for locally installed packages, and some modules in another
> > directory that I often link to.
> 
> There's the GHCRTS environment variable that you can use for setting
> heap sizes and so on, and the ~/.ghci file, but nothing for setting ghc
> command-line arguments.  We're a bit wary of adding more things that we
> have to ask for in a bug report...

Oh, is that the only reason? That's a terrible reason to not have a
feature. :) You could just write a 'ghcbug' script which includes all
information automatically. See the output of 'perlbug -d' for example.

I guess I could write a wrapper to add the options myself ... but is
everybody supposed to do this who has a package.conf in their home
directory, or some common set of utility modules somewhere? It seems
like a fairly common use case that should be well-supported in a
standard way out of the box.

Frederik

--

-- 
http://ofb.net/~frederik/
(Continue reading)

Tomasz Zielonka | 9 Mar 19:03 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 10:01:40AM -0800, Frederik Eaton wrote:
> On Wed, Mar 09, 2005 at 05:19:18PM -0000, Simon Marlow wrote:
> > On 09 March 2005 08:29, Frederik Eaton wrote:
> > 
> Oh, is that the only reason? That's a terrible reason to not have a
> feature. :) You could just write a 'ghcbug' script which includes all
> information automatically. See the output of 'perlbug -d' for example.
> 
> I guess I could write a wrapper to add the options myself ... but is
> everybody supposed to do this who has a package.conf in their home
> directory, or some common set of utility modules somewhere? It seems
> like a fairly common use case that should be well-supported in a
> standard way out of the box.

I was complaing (only to myself) that rsync doesn't allow to put some
common options in ~/.rsyncrc or an environment variable. Then I simply
added an alias in my .bash_profile:

    alias rsync='rsync -v --progress'

Unfortunately, this is still something that developers would like to
know when facing a bug report :)

Best regards
Tomasz
Frederik Eaton | 9 Mar 19:27 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 07:03:38PM +0100, Tomasz Zielonka wrote:
> On Wed, Mar 09, 2005 at 10:01:40AM -0800, Frederik Eaton wrote:
> > On Wed, Mar 09, 2005 at 05:19:18PM -0000, Simon Marlow wrote:
> > > On 09 March 2005 08:29, Frederik Eaton wrote:
> > > 
> > Oh, is that the only reason? That's a terrible reason to not have a
> > feature. :) You could just write a 'ghcbug' script which includes all
> > information automatically. See the output of 'perlbug -d' for example.
> > 
> > I guess I could write a wrapper to add the options myself ... but is
> > everybody supposed to do this who has a package.conf in their home
> > directory, or some common set of utility modules somewhere? It seems
> > like a fairly common use case that should be well-supported in a
> > standard way out of the box.
> 
> I was complaing (only to myself) that rsync doesn't allow to put some
> common options in ~/.rsyncrc or an environment variable. Then I simply
> added an alias in my .bash_profile:
> 
>     alias rsync='rsync -v --progress'
> 
> Unfortunately, this is still something that developers would like to
> know when facing a bug report :)

Right. Well, to get it to work from makefiles etc., I'd need to create
a script in my path, something like

#!/bin/sh
ghc -i$HSPATH -package-conf $HSPKGCONF "$ <at> "

(Continue reading)

Tomasz Zielonka | 9 Mar 20:14 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 10:27:28AM -0800, Frederik Eaton wrote:
> On Wed, Mar 09, 2005 at 07:03:38PM +0100, Tomasz Zielonka wrote:
> > 
> > I was complaing (only to myself) that rsync doesn't allow to put some
> > common options in ~/.rsyncrc or an environment variable. Then I simply
> > added an alias in my .bash_profile:
> > 
> >     alias rsync='rsync -v --progress'
> > 
> > Unfortunately, this is still something that developers would like to
> > know when facing a bug report :)
> 
> Right. Well, to get it to work from makefiles etc., I'd need to create
> a script in my path, something like
> 
> #!/bin/sh
> ghc -i$HSPATH -package-conf $HSPKGCONF "$ <at> "
> 
> And I'd call it ghc. The thing is, I'm arguing that enough people
> would do this that we should standardize on the environment variable
> names. Plus, yeah, as you point out, I could just as well forget to
> mention in a bug report that 'ghc' is my own special script.

Why not simply do:

#!/bin/bash
/usr/.../ghc $GHCOPTS "$ <at> "

?

(Continue reading)

Frederik Eaton | 9 Mar 20:55 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 08:14:24PM +0100, Tomasz Zielonka wrote:
> On Wed, Mar 09, 2005 at 10:27:28AM -0800, Frederik Eaton wrote:
> > On Wed, Mar 09, 2005 at 07:03:38PM +0100, Tomasz Zielonka wrote:
> > > 
> > > I was complaing (only to myself) that rsync doesn't allow to put some
> > > common options in ~/.rsyncrc or an environment variable. Then I simply
> > > added an alias in my .bash_profile:
> > > 
> > >     alias rsync='rsync -v --progress'
> > > 
> > > Unfortunately, this is still something that developers would like to
> > > know when facing a bug report :)
> > 
> > Right. Well, to get it to work from makefiles etc., I'd need to create
> > a script in my path, something like
> > 
> > #!/bin/sh
> > ghc -i$HSPATH -package-conf $HSPKGCONF "$ <at> "
> > 
> > And I'd call it ghc. The thing is, I'm arguing that enough people
> > would do this that we should standardize on the environment variable
> > names. Plus, yeah, as you point out, I could just as well forget to
> > mention in a bug report that 'ghc' is my own special script.
> 
> Why not simply do:
> 
> #!/bin/bash
> /usr/.../ghc $GHCOPTS "$ <at> "
> 
> ?
(Continue reading)

Tomasz Zielonka | 9 Mar 21:49 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 11:55:11AM -0800, Frederik Eaton wrote:
> > I am still not convinced that it is a good idea to add such
> > functionality to GHC. Do you want to persuade developers of
> > every program you use to add similar feature?
> 
> Is the perceived difficulty of that task an argument against improving
> ghc?

No, it's about avoiding unneccesary complexity.

> I agree that the case you're presenting is indeed more difficult, but
> I don't think you're doing the estimations right for the one at hand.
> The cost and annoyance of perhaps tens of thousands of people adding
> and remembering to maintain wrappers named 'ghc' somewhere in their
> path to accomplish this simple task (after scrounging in the
> documentation to find that ghc for some reason fails to be like many
> other compilers, a nontrivial cost in itself since the lack of
> environment variables isn't specifically documented) - or simply not
> doing so, and typing in -package-conf hundreds of times as I have
> done, because they may not have write access to the main package.conf
> - I think outweighs the cost of one person, once, adding central
> support for environment variables, a bit of documentation in the man
> page, perhaps a ghcbug program if we want super-detailed bug
> reports...

Are you volunteering to be that person? ;-)

Best regards
Tomasz
(Continue reading)

Frederik Eaton | 9 Mar 22:12 2005
Picon

Re: environment variables for ghc

> > I agree that the case you're presenting is indeed more difficult, but
> > I don't think you're doing the estimations right for the one at hand.
> > The cost and annoyance of perhaps tens of thousands of people adding
> > and remembering to maintain wrappers named 'ghc' somewhere in their
> > path to accomplish this simple task (after scrounging in the
> > documentation to find that ghc for some reason fails to be like many
> > other compilers, a nontrivial cost in itself since the lack of
> > environment variables isn't specifically documented) - or simply not
> > doing so, and typing in -package-conf hundreds of times as I have
> > done, because they may not have write access to the main package.conf
> > - I think outweighs the cost of one person, once, adding central
> > support for environment variables, a bit of documentation in the man
> > page, perhaps a ghcbug program if we want super-detailed bug
> > reports...
> 
> Are you volunteering to be that person? ;-)

Are you saying that a patch would be accepted?

Frederik

--

-- 
http://ofb.net/~frederik/
Tomasz Zielonka | 9 Mar 22:11 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 01:12:49PM -0800, Frederik Eaton wrote:
> > Are you volunteering to be that person? ;-)
> 
> Are you saying that a patch would be accepted?

I am not the one to decide.

Best regards
Tomasz
John Meacham | 9 Mar 22:26 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 01:12:49PM -0800, Frederik Eaton wrote:
> > > I agree that the case you're presenting is indeed more difficult, but
> > > I don't think you're doing the estimations right for the one at hand.
> > > The cost and annoyance of perhaps tens of thousands of people adding
> > > and remembering to maintain wrappers named 'ghc' somewhere in their
> > > path to accomplish this simple task (after scrounging in the
> > > documentation to find that ghc for some reason fails to be like many
> > > other compilers, a nontrivial cost in itself since the lack of
> > > environment variables isn't specifically documented) - or simply not
> > > doing so, and typing in -package-conf hundreds of times as I have
> > > done, because they may not have write access to the main package.conf
> > > - I think outweighs the cost of one person, once, adding central
> > > support for environment variables, a bit of documentation in the man
> > > page, perhaps a ghcbug program if we want super-detailed bug
> > > reports...
> > 
> > Are you volunteering to be that person? ;-)
> 
> Are you saying that a patch would be accepted?

A ghcbug script would be great IMHO. 
        John

--

-- 
John Meacham - ⑆repetae.net⑆john⑈ 
Simon Marlow | 9 Mar 23:40 2005
Picon

RE: environment variables for ghc

On 09 March 2005 21:13, Frederik Eaton wrote:

>>> I agree that the case you're presenting is indeed more difficult,
>>> but I don't think you're doing the estimations right for the one at
>>> hand. The cost and annoyance of perhaps tens of thousands of people
>>> adding and remembering to maintain wrappers named 'ghc' somewhere
>>> in their path to accomplish this simple task (after scrounging in
>>> the documentation to find that ghc for some reason fails to be like
>>> many other compilers, a nontrivial cost in itself since the lack of
>>> environment variables isn't specifically documented) - or simply not
>>> doing so, and typing in -package-conf hundreds of times as I have
>>> done, because they may not have write access to the main
>>> package.conf - I think outweighs the cost of one person, once,
>>> adding central support for environment variables, a bit of
>>> documentation in the man page, perhaps a ghcbug program if we want
>>> super-detailed bug reports...
>> 
>> Are you volunteering to be that person? ;-)
> 
> Are you saying that a patch would be accepted?
> 
> Frederik

We'll definitely take the environment variable patch if it comes with a
ghcbug script :-)

Cheers,
	Simon
Frederik Eaton | 9 Mar 23:51 2005
Picon

Re: environment variables for ghc

OK, well I'll be busy for the next few weeks so if someone else wants
to step up and do it, don't wait for me. But otherwise I'll put in on
my todo list.

Cheers,

Frederik

On Wed, Mar 09, 2005 at 10:40:03PM -0000, Simon Marlow wrote:
> On 09 March 2005 21:13, Frederik Eaton wrote:
> 
> >>> I agree that the case you're presenting is indeed more difficult,
> >>> but I don't think you're doing the estimations right for the one at
> >>> hand. The cost and annoyance of perhaps tens of thousands of people
> >>> adding and remembering to maintain wrappers named 'ghc' somewhere
> >>> in their path to accomplish this simple task (after scrounging in
> >>> the documentation to find that ghc for some reason fails to be like
> >>> many other compilers, a nontrivial cost in itself since the lack of
> >>> environment variables isn't specifically documented) - or simply not
> >>> doing so, and typing in -package-conf hundreds of times as I have
> >>> done, because they may not have write access to the main
> >>> package.conf - I think outweighs the cost of one person, once,
> >>> adding central support for environment variables, a bit of
> >>> documentation in the man page, perhaps a ghcbug program if we want
> >>> super-detailed bug reports...
> >> 
> >> Are you volunteering to be that person? ;-)
> > 
> > Are you saying that a patch would be accepted?
> > 
(Continue reading)

Frederik Eaton | 9 Mar 23:54 2005
Picon

Re: environment variables for ghc

> We'll definitely take the environment variable patch if it comes with a
> ghcbug script :-)

OK, well I'll be busy for the next few weeks so if someone else wants
to step up and do it, don't wait for me. But otherwise I'll put in on
my todo list.

Cheers,

Frederik

--

-- 
http://ofb.net/~frederik/
Frederik Eaton | 17 Apr 11:06 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 10:40:03PM -0000, Simon Marlow wrote:
> On 09 March 2005 21:13, Frederik Eaton wrote:
> 
> >>> I agree that the case you're presenting is indeed more difficult,
> >>> but I don't think you're doing the estimations right for the one at
> >>> hand. The cost and annoyance of perhaps tens of thousands of people
> >>> adding and remembering to maintain wrappers named 'ghc' somewhere
> >>> in their path to accomplish this simple task (after scrounging in
> >>> the documentation to find that ghc for some reason fails to be like
> >>> many other compilers, a nontrivial cost in itself since the lack of
> >>> environment variables isn't specifically documented) - or simply not
> >>> doing so, and typing in -package-conf hundreds of times as I have
> >>> done, because they may not have write access to the main
> >>> package.conf - I think outweighs the cost of one person, once,
> >>> adding central support for environment variables, a bit of
> >>> documentation in the man page, perhaps a ghcbug program if we want
> >>> super-detailed bug reports...
> >> 
> >> Are you volunteering to be that person? ;-)
> > 
> > Are you saying that a patch would be accepted?
> > 
> > Frederik
> 
> We'll definitely take the environment variable patch if it comes with a
> ghcbug script :-)

Looking around ... why not just add environment variable information
to the output of ghc -v (already it lists all packages). Or did you
want something that would also submit a bug to the mailing list? One
(Continue reading)

Simon Marlow | 9 Mar 23:43 2005
Picon

RE: environment variables for ghc

On 09 March 2005 19:55, Frederik Eaton wrote:

> I agree that the case you're presenting is indeed more difficult, but
> I don't think you're doing the estimations right for the one at hand.
> The cost and annoyance of perhaps tens of thousands of people adding
> and remembering to maintain wrappers named 'ghc' somewhere in their
> path to accomplish this simple task (after scrounging in the
> documentation to find that ghc for some reason fails to be like many
> other compilers, a nontrivial cost in itself since the lack of
> environment variables isn't specifically documented) - or simply not
> doing so, and typing in -package-conf hundreds of times as I have
> done, because they may not have write access to the main package.conf
> - I think outweighs the cost of one person, once, adding central
> support for environment variables, a bit of documentation in the man
> page, perhaps a ghcbug program if we want super-detailed bug
> reports...

By the way, GHC 6.4 keeps a local package.conf in your home directory,
and you can install packages into it with ghc-pkg --user, or ./setup
--user for Cabal packages.

Cheers,
	Simon
Simon Marlow | 9 Mar 23:40 2005
Picon

RE: environment variables for ghc

On 09 March 2005 21:13, Frederik Eaton wrote:

>>> I agree that the case you're presenting is indeed more difficult,
>>> but I don't think you're doing the estimations right for the one at
>>> hand. The cost and annoyance of perhaps tens of thousands of people
>>> adding and remembering to maintain wrappers named 'ghc' somewhere
>>> in their path to accomplish this simple task (after scrounging in
>>> the documentation to find that ghc for some reason fails to be like
>>> many other compilers, a nontrivial cost in itself since the lack of
>>> environment variables isn't specifically documented) - or simply not
>>> doing so, and typing in -package-conf hundreds of times as I have
>>> done, because they may not have write access to the main
>>> package.conf - I think outweighs the cost of one person, once,
>>> adding central support for environment variables, a bit of
>>> documentation in the man page, perhaps a ghcbug program if we want
>>> super-detailed bug reports...
>> 
>> Are you volunteering to be that person? ;-)
> 
> Are you saying that a patch would be accepted?
> 
> Frederik

We'll definitely take the environment variable patch if it comes with a
ghcbug script :-)

Cheers,
	Simon
Frederik Eaton | 9 Mar 23:51 2005
Picon

Re: environment variables for ghc

OK, well I'll be busy for the next few weeks so if someone else wants
to step up and do it, don't wait for me. But otherwise I'll put in on
my todo list.

Cheers,

Frederik

On Wed, Mar 09, 2005 at 10:40:03PM -0000, Simon Marlow wrote:
> On 09 March 2005 21:13, Frederik Eaton wrote:
> 
> >>> I agree that the case you're presenting is indeed more difficult,
> >>> but I don't think you're doing the estimations right for the one at
> >>> hand. The cost and annoyance of perhaps tens of thousands of people
> >>> adding and remembering to maintain wrappers named 'ghc' somewhere
> >>> in their path to accomplish this simple task (after scrounging in
> >>> the documentation to find that ghc for some reason fails to be like
> >>> many other compilers, a nontrivial cost in itself since the lack of
> >>> environment variables isn't specifically documented) - or simply not
> >>> doing so, and typing in -package-conf hundreds of times as I have
> >>> done, because they may not have write access to the main
> >>> package.conf - I think outweighs the cost of one person, once,
> >>> adding central support for environment variables, a bit of
> >>> documentation in the man page, perhaps a ghcbug program if we want
> >>> super-detailed bug reports...
> >> 
> >> Are you volunteering to be that person? ;-)
> > 
> > Are you saying that a patch would be accepted?
> > 
(Continue reading)

Frederik Eaton | 9 Mar 23:54 2005
Picon

Re: environment variables for ghc

> We'll definitely take the environment variable patch if it comes with a
> ghcbug script :-)

OK, well I'll be busy for the next few weeks so if someone else wants
to step up and do it, don't wait for me. But otherwise I'll put in on
my todo list.

Cheers,

Frederik

--

-- 
http://ofb.net/~frederik/
Frederik Eaton | 17 Apr 11:06 2005
Picon

Re: environment variables for ghc

On Wed, Mar 09, 2005 at 10:40:03PM -0000, Simon Marlow wrote:
> On 09 March 2005 21:13, Frederik Eaton wrote:
> 
> >>> I agree that the case you're presenting is indeed more difficult,
> >>> but I don't think you're doing the estimations right for the one at
> >>> hand. The cost and annoyance of perhaps tens of thousands of people
> >>> adding and remembering to maintain wrappers named 'ghc' somewhere
> >>> in their path to accomplish this simple task (after scrounging in
> >>> the documentation to find that ghc for some reason fails to be like
> >>> many other compilers, a nontrivial cost in itself since the lack of
> >>> environment variables isn't specifically documented) - or simply not
> >>> doing so, and typing in -package-conf hundreds of times as I have
> >>> done, because they may not have write access to the main
> >>> package.conf - I think outweighs the cost of one person, once,
> >>> adding central support for environment variables, a bit of
> >>> documentation in the man page, perhaps a ghcbug program if we want
> >>> super-detailed bug reports...
> >> 
> >> Are you volunteering to be that person? ;-)
> > 
> > Are you saying that a patch would be accepted?
> > 
> > Frederik
> 
> We'll definitely take the environment variable patch if it comes with a
> ghcbug script :-)

Looking around ... why not just add environment variable information
to the output of ghc -v (already it lists all packages). Or did you
want something that would also submit a bug to the mailing list? One
(Continue reading)

Simon Marlow | 9 Mar 23:43 2005
Picon

RE: environment variables for ghc

On 09 March 2005 19:55, Frederik Eaton wrote:

> I agree that the case you're presenting is indeed more difficult, but
> I don't think you're doing the estimations right for the one at hand.
> The cost and annoyance of perhaps tens of thousands of people adding
> and remembering to maintain wrappers named 'ghc' somewhere in their
> path to accomplish this simple task (after scrounging in the
> documentation to find that ghc for some reason fails to be like many
> other compilers, a nontrivial cost in itself since the lack of
> environment variables isn't specifically documented) - or simply not
> doing so, and typing in -package-conf hundreds of times as I have
> done, because they may not have write access to the main package.conf
> - I think outweighs the cost of one person, once, adding central
> support for environment variables, a bit of documentation in the man
> page, perhaps a ghcbug program if we want super-detailed bug
> reports...

By the way, GHC 6.4 keeps a local package.conf in your home directory,
and you can install packages into it with ghc-pkg --user, or ./setup
--user for Cabal packages.

Cheers,
	Simon

Gmane