HOME: getEnv: does not exist

2005-04-18 Thread Niklas Broberg
Hi all,

when I try to use runghc to execute cgi scripts in apache (on redhat
linux), they all fail with with the message HOME: getEnv: does not
exist. I assume this means that GHC is trying to find the HOME dir of
the user for some reason, and fails since apache runs as nobody. Could
someone shed some light on this matter for me?

#!/usr/bin/runghc
main = do putStrLn Content-type: application/xhtml
  putStrLn Content-length: 5\n
  putStrLn Hello

Thanks,

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HOME: getEnv: does not exist

2005-04-18 Thread Malcolm Wallace
Niklas Broberg [EMAIL PROTECTED] writes:

 when I try to use runghc to execute cgi scripts in apache (on redhat
 linux), they all fail with with the message HOME: getEnv: does not
 exist. I assume this means that GHC is trying to find the HOME dir of
 the user for some reason, and fails since apache runs as nobody. Could
 someone shed some light on this matter for me?

I think runghc is acting like GHCi, and trying to read the file
$HOME/.ghci on startup.

Regards,
Malcolm
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


runghc badly broken

2005-04-18 Thread Niklas Broberg
Hi all,

I'm trying to use runghc (6.4 release version, redhat linux), but it
appears to be badly broken. It only processes the first argument given
to it, so while
---
 runghc Foo.hs
hello

with Foo.hs being simply
main = putStrLn hello
---

works just fine, while for instance
---
 runghc -v1 Foo.hs
Loading package base-1.0 ... linking ... done.

interactive:1:78:
Failed to load interface for `Main':
Could not find module `Main':
  it is not a module in the current program, or in any known package.
Leaving GHCi.
---

manages to be 1-verbose but doesn't find the file, and
---
 runghc Foo.hs -v1
hello
---

executes the file alright, but forgets verbosity. I can't imagine this
is the intended behavior?

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HOME: getEnv: does not exist

2005-04-18 Thread Niklas Broberg
 I think runghc is acting like GHCi, and trying to read the file
 $HOME/.ghci on startup.

Thanks, that may well be the case. Too bad you can't tell it not to,
see my other post about runghc and flags. :-(

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HOME: getEnv: does not exist

2005-04-18 Thread Ketil Malde
Malcolm Wallace [EMAIL PROTECTED] writes:

 I think runghc is acting like GHCi, and trying to read the file
 $HOME/.ghci on startup.

I toyed with this, and it seems like runghc is forking off a ghc
process, which then tries to read .ghci (and possibly .inputrc) from
the $HOME directory.

Unfortunately, while runghc apparently parses -ignore-dot-ghci
(i.e. it refuses illegal options), it later on seems to treat it's a
source file to run.

As far as I can tell.

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HOME: getEnv: does not exist

2005-04-18 Thread Niklas Broberg
 when I try to use runghc to execute cgi scripts in apache (on redhat
 linux), they all fail with with the message HOME: getEnv: does not
 exist. I assume this means that GHC is trying to find the HOME dir of
 the user for some reason, and fails since apache runs as nobody. Could
 someone shed some light on this matter for me?

The same seems to be the case with ghc itself, not only runghc. Giving
the flags -ignore-dot-ghci and -no-user-package-conf does not solve
the problem, I still get the same error.

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: HOME: getEnv: does not exist

2005-04-18 Thread Niklas Broberg
  when I try to use runghc to execute cgi scripts in apache (on redhat
  linux), they all fail with with the message HOME: getEnv: does not
  exist. I assume this means that GHC is trying to find the HOME dir of
  the user for some reason, and fails since apache runs as nobody. Could
  someone shed some light on this matter for me?
 
 The same seems to be the case with ghc itself, not only runghc. Giving
 the flags -ignore-dot-ghci and -no-user-package-conf does not solve
 the problem, I still get the same error.

Alright, after digging the the ghc source I found this to be a bug
that has been remedied in the current cvs HEAD. I guess it remains for
me to install a cvs version then.

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: runghc badly broken

2005-04-18 Thread Niklas Broberg
 I'm trying to use runghc (6.4 release version, redhat linux), but it
 appears to be badly broken. It only processes the first argument given
 to it...
[snip]

As a friend pointed out to me, some of this behavior may not be so
strange. Clearly, if you give arguments _after_ the specified source
file, you expect these to be arguments to that source file and not to
runghc itself. Thus the example
---
 runghc Foo.hs -v1
hello
---

executes as expected, since Foo.hs makes no use of -v1. That leaves
the other case, when the argument(s) is given _before_ the file
argument. It's obviously possible to give flags to runghc, shown by
runghc being verbose in the example
---
 runghc -v1 Foo.hs
Loading package base-1.0 ... linking ... done.

interactive:1:78:
   Failed to load interface for `Main':
   Could not find module `Main':
 it is not a module in the current program, or in any known package.
Leaving GHCi.
---

but only the first one is processed. IMHO the preferred behavior is
that any arguments given before the single file argument is given to
runghc itself, while any given after the file argument is given to the
script in that file. Comments?

/Niklas
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Partial application of type constructors?

2005-04-18 Thread Conal Elliott
GHC 6.4 objects to the following simple program, pointing to the partial
application of the type constructor AddL.  Is there a work-around?

{-# OPTIONS -fglasgow-exts #-}
data LMap a b
type AddL arr a b = a `arr` LMap a b
data DFunA arr a b = DFunA (a `arr` b) (DFunA (AddL arr) a b)

The complete error message:

Type synonym `AddL' should have 3 arguments, but has been given 1
When checking the data constructor:
  forall arr a b. DFunA (arr a b) (DFunA (AddL arr) a b)
In the data type declaration for `DFunA'

Is there a serious difficulty with handling partial type applications?

- Conal

___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users