RE: package name mismatch

2002-07-18 Thread Simon Marlow


 Simon Marlow wrote:
  
   It must have been only a warning in 5.02.3, or I could never have
   compiled it there.  (Before 5.02.3 we didn't use the package
   system like this at all.)
 [snip]
  
  Can't you just fix your build so that the situation doesn't occur?
 [snip]
 In fact I have been unable to reproduce the problem with 
 ghc5.04 anyway.
 My guess would be that GHC now searches the package 
 directories before the
 current directory.  So we're all happy, unless someone wants 
 to override a 
 module in an imported package.  Even then a better solution 
 would be to
 write another package containing the altered module, and put 
 it first in
 the search path.
 
 Is the order in which GHC looks for imported modules 
 specified anywhere?

No, but our position is that you shouldn't have more than one module
with the same name, regardless of whether they are in separate packages
or not, and that the import path for the home package should not overlap
with the import path for any other package.  The only exception is
perhaps two packages that aren't intended to be used together.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: package name mismatch

2002-07-16 Thread Simon Marlow

 It must have been only a warning in 5.02.3, or I could never have
 compiled it there.  (Before 5.02.3 we didn't use the package
 system like this at all.)
 
 Actually I would like this message to go away altogether in this case,
 if possible.  The actual situation is that GetPut.hs is in fact part
 of the package uni-events-test, and the compiler is told to load
 uni-events-test on the command line.  However GetPut.hs is *also* in
 the current directory during this compilation, so GHC loads 
 it from there 
 instead.   I'm not sure what logic would be best here, but my 
 suggestion 
 would be that where a .hi file is found in an import declaration and
 has an unexpected package name, GHC keeps on searching.  If it finds
 a .hi file with a matching package name, it accepts it, otherwise
 accept the .hi file with the wrong package name and issue a warning.
 
 If that's too complicated, just ignore .hi files with the 
 wrong package name.  But then people might complain . . .

I think this is all way too complicated.  GHC's view of modules is
fairly simple: they either reside in the home package or another
package.  If a module occurs in both, then previously it was an error,
now it is just a warning.  If we were using packages for dynamic
libraries, one of the reasons we originally added packages, then it
really *would* be an error and you'd be in trouble if you did this!

Can't you just fix your build so that the situation doesn't occur?

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: package name mismatch

2002-07-16 Thread George Russell

Simon Marlow wrote:
[snip]
 Can't you just fix your build so that the situation doesn't occur?
[snip]
Grumble.  Yes, I suppose so.

I hate being an implementor instead of a bug-reporter.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: package name mismatch

2002-07-15 Thread Simon Marlow

 Building htk, I've got an error:
 
 TestGetPut.hs:6:
 Module `GetPut' is located in package `Main'
 but its interface file claims it is part of package
 `uni-events-test'
 
 It happened (as far as I got) when ghc saw in current path
 the *.hi file built for installation. There are some ways to
 work around it, but, there was a lot of such places, so can
 I just skip the 'package name' check and go as it is?

This was converted to a warning in, I think, ghc 5.02.3.  Please
upgrade, preferably to 5.04.

Cheers,
Simon
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



RE: package name mismatch

2002-07-15 Thread George Russell

Simon Marlow quoted Max Kirillov
[snip]
  Building htk, I've got an error:
 =20
  TestGetPut.hs:6:
  Module `GetPut' is located in package `Main'
  but its interface file claims it is part of package
  `uni-events-test'
 =20
  It happened (as far as I got) when ghc saw in current path
  the *.hi file built for installation. There are some ways to
  work around it, but, there was a lot of such places, so can
  I just skip the 'package name' check and go as it is?
 
 This was converted to a warning in, I think, ghc 5.02.3.  Please
 upgrade, preferably to 5.04.
[snip]
It must have been only a warning in 5.02.3, or I could never have
compiled it there.  (Before 5.02.3 we didn't use the package
system like this at all.)

Actually I would like this message to go away altogether in this case,
if possible.  The actual situation is that GetPut.hs is in fact part
of the package uni-events-test, and the compiler is told to load
uni-events-test on the command line.  However GetPut.hs is *also* in
the current directory during this compilation, so GHC loads it from there 
instead.   I'm not sure what logic would be best here, but my suggestion 
would be that where a .hi file is found in an import declaration and
has an unexpected package name, GHC keeps on searching.  If it finds
a .hi file with a matching package name, it accepts it, otherwise
accept the .hi file with the wrong package name and issue a warning.

If that's too complicated, just ignore .hi files with the wrong package
name.  But then people might complain . . .

[ - for Max's eyes only -
As a matter of fact, this file is not needed for uni-htk anyway (it's
just part of a test case) so Max could just work around it.  If you just
do gmake package rather than gmake or gmake all I don't think it
will occur, though that will also mean the test programs don't get made.
If you want the HTk examples go into htk/examples and do gmake main
and/or gmake test there. - ]
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



package name mismatch

2002-07-13 Thread Max Kirillov

Hello!

Building htk, I've got an error:

TestGetPut.hs:6:
Module `GetPut' is located in package `Main'
but its interface file claims it is part of package
`uni-events-test'

It happened (as far as I got) when ghc saw in current path
the *.hi file built for installation. There are some ways to
work around it, but, there was a lot of such places, so can
I just skip the 'package name' check and go as it is?

In

http://www.haskell.org/pipermail/glasgow-haskell-users/2002-January/002849.html

Simon Marlow said that it is a warning. That wold be nice,
but I see an error.

that's ghc-5.02

Max.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users