
Hi, Using cabal and cabal-install from yesterday: D:\sources\contrib\google-chart>cabal install --hugs cabal: user error (Pattern match failure in do expression at Hackage/Install.hs: 99:6-19) D:\sources\contrib\google-chart>runhaskell Setup configure --hugs Configuring GoogleChart-0.2... Setup: The following installed packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used. Two separate errors, one in cabal, one in cabal-install. The cabal error should at least tell me which packages are missing. Thanks Neil

On Tue, 2008-03-04 at 14:35 +0000, Neil Mitchell wrote:
Hi,
Using cabal and cabal-install from yesterday:
D:\sources\contrib\google-chart>cabal install --hugs cabal: user error (Pattern match failure in do expression at Hackage/Install.hs: 99:6-19)
D:\sources\contrib\google-chart>runhaskell Setup configure --hugs Configuring GoogleChart-0.2... Setup: The following installed packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.
Two separate errors, one in cabal, one in cabal-install. The cabal error should at least tell me which packages are missing.
Both errors are a consequence of the fact that we do not know what packages are installed for hugs. It is printing all the packages that it thinks are missing, that is... none. That's because we do not know of any installed packages at all. It comes from this quirk of PackageIndex.dependencyClosure: -- * Note that if any of the result is @Right []@ it is because at -- least one of the original given 'PackageIdentifier's do not occur -- in the index. It should probably deal with that case better, but the reason it happens is because all of the packages that the current package depends on are not installed (at least as far as cabal knows). So that second error simply needs to be fixed because the Cabal lib has previously worked with implementations that do not track installed packages. The sensible fix is probably just to skip the check entirely for hugs and other implementations where we do not know the installed packages. The first error is basically unfixable unless we get code to enumerate the installed packages for hugs. It's not really possible for a package manager to limp along without knowing what packages are already installed. So it should be possible already to get some minimal information for the names of hugs packages by looking in /usr/lib/hugs/packages/ or the equivalent on other OSs. Unfortunately that does not give us versions. I don't know of any portable way to discover where hugs keeps its packages directory. We know where cabal would install packages for hugs but that's not necessarily the same thing. For a future hugs release it would be enormously helpful if it would include the InstalledPackageInfo files for all the bundled packages and if there was a way of discovering what directory to look in to find these packages. Then we could build a proper index of the installed packages as we do for ghc. Also we need a hugs --version flag so Cabal can actually figure out the hugs version so it knows whether it supports an installed package database. Currently hugs is almost unversioned (check System.Info.compilerVersion). So yes, it'd be great if Cabal could work better with hugs but we'll need some help from hugs. Duncan

Hi
Both errors are a consequence of the fact that we do not know what packages are installed for hugs. It is printing all the packages that it thinks are missing, that is... none.
For cabal-install, I can accept this. But from what you are saying cabal seems to have recently become broken so that it just won't work with Hugs at all? That is a real shame.
For a future hugs release it would be enormously helpful if it would include the InstalledPackageInfo files for all the bundled packages and if there was a way of discovering what directory to look in to find these packages. Then we could build a proper index of the installed packages as we do for ghc. Also we need a hugs --version flag so Cabal can actually figure out the hugs version so it knows whether it supports an installed package database. Currently hugs is almost unversioned (check System.Info.compilerVersion).
File suffient bugs (http://hackage.haskell.org/trac/hugs) and hopefully they will get fixed. Thanks Neil

On Wed, 2008-03-05 at 08:41 +0000, Neil Mitchell wrote:
Hi
Both errors are a consequence of the fact that we do not know what packages are installed for hugs. It is printing all the packages that it thinks are missing, that is... none.
For cabal-install, I can accept this. But from what you are saying cabal seems to have recently become broken so that it just won't work with Hugs at all? That is a real shame.
I said:
So that second error simply needs to be fixed because the Cabal lib has previously worked with implementations that do not track installed packages. The sensible fix is probably just to skip the check entirely for hugs and other implementations where we do not know the installed packages.
And I've pushed the fix:
Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
For a future hugs release it would be enormously helpful if it would include the InstalledPackageInfo files for all the bundled packages and if there was a way of discovering what directory to look in to find these packages. Then we could build a proper index of the installed packages as we do for ghc. Also we need a hugs --version flag so Cabal can actually figure out the hugs version so it knows whether it supports an installed package database. Currently hugs is almost unversioned (check System.Info.compilerVersion).
File suffient bugs (http://hackage.haskell.org/trac/hugs) and hopefully they will get fixed.
Ok. Duncan

On Wed, 2008-03-05 at 09:40 +0000, Duncan Coutts wrote:
File suffient bugs (http://hackage.haskell.org/trac/hugs) and hopefully they will get fixed.
Ok.
Actually, both done already: #44 Hugs does not provide version numbers for installed packages http://hackage.haskell.org/trac/hugs/ticket/44 which I commented on. Ross had already suggested to install the full InstalledPackageInfo. #81 support --version flag http://hackage.haskell.org/trac/hugs/ticket/81 filed by yours truly 2 months ago. Ross mentions in #44 that InstalledPackageInfo is somewhat ghc-specific. I'd like to know if there's specifically anything that would cause problems for hugs. We've been designing cabal-install on the assumption that eventually every implementation would catch up and provide full InstalledPackageInfo. If it is inappropriate info for hugs we need to fix it now. Duncan

Hi
And I've pushed the fix:
Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
* Fix configure for hugs where we don't know what packages are installed For Hugs, nhc98 and other compilers we do not know what packages are
Which works perfectly. Any chance that (if its not too much effort) cabal install on Hugs could just assume that all the necessary packages are already installed? It would at least give me the ability to do "cabal install --hugs" in a darcs repo, instead of three runhaskell Setup invocations. Thanks Neil

On Wed, 2008-03-05 at 11:24 +0000, Neil Mitchell wrote:
Hi
And I've pushed the fix:
Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
* Fix configure for hugs where we don't know what packages are installed For Hugs, nhc98 and other compilers we do not know what packages are Which works perfectly.
Any chance that (if its not too much effort) cabal install on Hugs could just assume that all the necessary packages are already installed? It would at least give me the ability to do "cabal install --hugs" in a darcs repo, instead of three runhaskell Setup invocations.
Done. Give it a go... In theory this might work too: $ cabal install foobar That is it should download and install foobar from hackage, assuming of course that all of foobar's dependencies are already installed. Or if foobar is already installed, then we'll install it again, yay! I get some weird failures on installing cabal-install which go away when I delete the pre-existing instllation of cabal-install. Also, user installs are not going to work without tweaking the scripts that call runhugs to adjust the search path to look at other user libs. Perhaps you can send us a patch for that. Perhaps it needs some fat warnings so people don't make the mistake of assuming it's going to work. Duncan

Hi
Any chance that (if its not too much effort) cabal install on Hugs could just assume that all the necessary packages are already installed? It would at least give me the ability to do "cabal install --hugs" in a darcs repo, instead of three runhaskell Setup invocations.
Done. Give it a go...
No luck still: E:\Neil\yhc\src\libraries\core>cabal install --hugs cabal: user error (Pattern match failure in do expression at Hackage/Install.hs: 99:6-19) Thanks Neil

On Wed, 2008-03-05 at 21:53 +0000, Neil Mitchell wrote:
Hi
Any chance that (if its not too much effort) cabal install on Hugs could just assume that all the necessary packages are already installed? It would at least give me the ability to do "cabal install --hugs" in a darcs repo, instead of three runhaskell Setup invocations.
Done. Give it a go...
No luck still:
E:\Neil\yhc\src\libraries\core>cabal install --hugs cabal: user error (Pattern match failure in do expression at Hackage/Install.hs: 99:6-19)
It looks like you have not recompiled, that line used to be: Just installed <- getInstalledPackages verbosity comp packageDB conf it is now: installed <- getInstalledPackages verbosity comp packageDB conf So there is no possibility of pattern match failure on that line any more. The change is definitely in the darcs repo, see: http://darcs.haskell.org/cabal-install/Hackage/Install.hs Duncan

Hi
It looks like you have not recompiled, that line used to be:
Just installed <- getInstalledPackages verbosity comp packageDB conf
I recompiled using cabal clean && cabal install, but that didn't seem to pick up the change... In the end it took a runhaskell Setup configure/build/install to get it working. With that patch, I have now successfully installed things to Hugs using cabal install. It should be said that cabal install is absolutely wonderful - well done to everyone who has worked on it! Thanks Neil

Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
* Fix configure for hugs where we don't know what packages are installed For Hugs, nhc98 and other compilers we do not know what packages are already installed, so we just make some up,
Hmm, although you may not know, there is a way to find out. :-) On nhc98 at least, a simple directory listing of include/packages/*.cabal will tell you what is installed. I agree that this is not the friendliest interface in the world, so I have now made it easier, by adding the 'nhc98-pkg list' command (in darcs). For instance: $ nhc98-pkg list array-0.1 base-3.0 bytestring-0.9 Cabal-1.3.6 containers-0.1 directory-1.0 filepath-1.1 fps-0.8 haskell-src-1.0.1.1 haskell98-1.0.1 HaXml-1.19.2 html-1.0.1.1 HUnit-1.2.0.0 old-locale-1.0 old-time-1.0 packedstring-0.1 parsec-2.1.0.0 polyparse-1.1 pretty-1.0 process-1.0 QuickCheck-1.1.0.0 random-1.0 xhtml-3000.0.2.1 Regards, Malcolm

On Fri, 2008-03-07 at 12:21 +0000, Malcolm Wallace wrote:
Wed Mar 5 02:36:26 GMT 2008 Duncan Coutts
* Fix configure for hugs where we don't know what packages are installed For Hugs, nhc98 and other compilers we do not know what packages are already installed, so we just make some up, Hmm, although you may not know, there is a way to find out. :-) On nhc98 at least, a simple directory listing of
A simple directory listing is absolutely fine!
include/packages/*.cabal
That tells us what package names and versions are installed but it doesn't help with finding out what the installed packages depend on or what cpp flags they used or anything else. For that we need the InstalledPackageInfo rather than the unconfigured .cabal files.
will tell you what is installed. I agree that this is not the friendliest interface in the world, so I have now made it easier, by adding the 'nhc98-pkg list' command (in darcs). For instance:
$ nhc98-pkg list array-0.1 base-3.0 bytestring-0.9 Cabal-1.3.6 containers-0.1 directory-1.0 filepath-1.1 fps-0.8 haskell-src-1.0.1.1 haskell98-1.0.1 HaXml-1.19.2 html-1.0.1.1 HUnit-1.2.0.0 old-locale-1.0 old-time-1.0 packedstring-0.1 parsec-2.1.0.0 polyparse-1.1 pretty-1.0 process-1.0 QuickCheck-1.1.0.0 random-1.0 xhtml-3000.0.2.1
So what we now use with ghc is to call 'ghc-pkg describe *' and it gives us the concatenation of the InstalledPackageInfo for every installed package. It's not at all a problem to go look in a dir, so long as it's always clear what dir to look in (eg nhc98 --print-libdir or equivalent), the most important thing for top-notch cabal support is knowing all the info about all the installed packages. It'll allows us to do pre-processing correctly, where installed packages provide header files or need certain cpp flags or use C libs. It'll allow cabal-install to generating correct install plans that respect the dependencies of existing installed packages. Duncan

Duncan Coutts
That tells us what package names and versions are installed but it doesn't help with finding out what the installed packages depend on or what cpp flags they used or anything else. For that we need the InstalledPackageInfo rather than the unconfigured .cabal files.
With respect, the nhc98 compiler neither has nor uses an InstalledPackageInfo for any package. If Cabal wants that information, Cabal should (a) generate it, and (b) store it. I don't see the point of duplicating all that machinery in nhc98, when we don't need it. Cabal is the package manager, after all. Regards, Malcolm

On Fri, 2008-03-07 at 13:48 +0000, Malcolm Wallace wrote:
Duncan Coutts
wrote: That tells us what package names and versions are installed but it doesn't help with finding out what the installed packages depend on or what cpp flags they used or anything else. For that we need the InstalledPackageInfo rather than the unconfigured .cabal files.
With respect, the nhc98 compiler neither has nor uses an InstalledPackageInfo for any package. If Cabal wants that information, Cabal should (a) generate it, and (b) store it. I don't see the point of duplicating all that machinery in nhc98, when we don't need it. Cabal is the package manager, after all.
Yes, absolutely. For Hugs Cabal already generates an InstalledPackageInfo file and installs it with each package. We just need to get it to do the same for nhc98 which will be trivial. The one thing we'd need from nhc98 is for those generated files to be included for the core packages that come with a standard nhc98 install. Cabal can then take care of installing them for all packages the user installs later. So I guess we'd need to adapt the nhc98 build procedure a bit to use Cabal to generate the info files so they can be included into the install. Does that sounds reasonable? Duncan
participants (3)
-
Duncan Coutts
-
Malcolm Wallace
-
Neil Mitchell