Library Infrastructure code & help wanted

Greetings, I'm looking for some help on the library infrastructure project. The project and its goals are explained here: http://www.haskell.org/libraryInfrastructure/ And the code is here: http://www.haskell.org/libraryInfrastructure/code.html In brief, the Library Infrastructure Project is an effort to provide a framework for developers to more effectively contribute their software to the Haskell community. I'm hoping to not have to implement this entire proposal myself, and I'm very flexible about implementation details. I've made some concrete progress, and I just mirrored my code repository on my web site, so now is the time to get involved! Specifically, at the moment, I want a couple of things: 1) A version parser. I implemented a parser which parses versions that are made of dates, or simple numeric versions. I'd like it to do more kinds of versions, though. Distribution.Version is attached. What is this version stuff used for? Well for one thing, you can use it to say something like: ./haskell-config --user list "MyPackage>1.2" where "MyPackage" is the name of a package. This will list all of the user-installed packages whose versions are greater than 1.2. If you look at the HUnit tests at the bottom of the attached file, you'll get a good idea of what it does right now. It uses Parsec. BTW, I understand that the Debian project has some standard version number parser which might give you some ideas. 2) I also would like someone to help out with the package configuration file IO. Right now, it uses HaXmL, with no generated code. Someone who has seen HaXmL before could give me advice about how my code could be better, submit patches, or rewrite it. As discussed on libraries@haskell.org, I'm open to not using XML if someone wants to redo what I've got there (not a huge task). This parsing code is in Distribution.Package. I do want something more flexible than straight-up read/show. 3) Someone to make it work with in nhc & hugs. The HaXmL page says that it doesn't work w/ Hugs yet (can anyone tell me why?), so that's one step. Also, at least for the version of NHC I have on my system, Parsec is different. So maybe we have to move away from Parsec, or maybe a different version thereof? It is absolutely vital for this project to be completely cross-platform and cross-compiler, so if we have to avoid depending on such things, I'm very willing to change. 4) Someone to make it work with Windows. Avoid using a filename that's called "Aux" ;) ABOUT THE CODE: It only works with GHC at the moment (see above) :( Right now what I've got is a first stab at Distribution.Package and haskell-config as explained in the proposal [1], though some things may have changed. It's hosted with Arch[2], a newish version control system. You can branch my code on your own machine and submit patches. Arch has some tools to help with patches. I've also provided a tarball. Arch is cool, though. You should try it. The HUnit tests in some of the modules should be pretty illuminating. The interactive help for haskell-config is pretty OK. Get the code here: http://www.haskell.org/libraryInfrastructure/code.html peace, isaac [1] http://www.haskell.org/libraryInfrastructure/proposal/index.html [2] http://regexps.srparish.net/www/

Isaac Jones
3) Someone to make it work with in nhc & hugs. The HaXmL page says that it doesn't work w/ Hugs yet (can anyone tell me why?),
Ironically enough, the only reason was an inadequate packaging framework... There is a new version of HaXml sitting in CVS just waiting for a release, which does work just fine with the latest version of Hugs.
Also, at least for the version of NHC I have on my system, Parsec is different. So maybe we have to move away from Parsec, or maybe a different version thereof?
Parsec recently moved out of 'base' into its own package, and nhc98 hasn't had a release since then. That should be the only difference(?). Regards, Malcolm

I'm looking into testing the Library infrastructure software under Windows (initially using GHC), but am running into a hurdle regarding HaXml. As far as I can tell, there is no script for building a Windows version of HaXml. Looking at the HaXml kit it looks as if the easiest way to try and to this will be to find a suitable version of make (i.e. compatible with whatever is used to build the HaXml package), and use that in conjunction with the Makefiles supplied. Can anyone point me at a suitable version of make to run on Windows (2K/XP)? An alternative possibility might be to use GHC --make, but I'm not sufficiently familiar with the GHC package framework or the HaXml build structure to know if this is possible. The HaXml release notes suggest it is, but I don't see how to do it. Does anyone have any other suggestions? #g -- BTW, I'm working with: - GHC 6.2 - HaXML 1.10 ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact

Graham Klyne
An alternative possibility might be to use GHC --make, but I'm not sufficiently familiar with the GHC package framework or the HaXml build structure to know if this is possible. The HaXml release notes suggest it is, but I don't see how to do it.
You can avoid using 'configure' and 'make' by just following the
recipe in the Makefile by hand. Realising that as a Windows person
you are probably inexperienced in reading a Makefile, here is the
quick version.
cd src
ghc --make -cpp -i. -package-name HaXml $(SRCS)
[ Replace $(SRCS) with the cut-and-pasted list of files from the Makefile ]
ar r libHSHaXml.a $(OBJS)
[ $(OBJS) is the source-file list replacing .hs by .o ]
ld -r --whole-archive -o HSHaXml.o libHSHaXml.a
[ only if you need to play with it in GHCi ]
cp libHSHaXml.a HSHaXml.o $(GHC_LIB_DIR)
[ install the library archive(s) where GHC can find them ]
{ tar cf interfaces.tar `find Text -name *.hi -print`
cp interfaces.tar $(GHC_LIB_DIR)/imports
cd $(GHC_LIB_DIR)/imports
tar xf interfaces.tar
rm interfaces.tar
}
[ install the interface files where GHC can find them ]
ghc-pkg --add-package

Thanks, your recipe was helpful to get me started. I'm trying to turn this
into a Windows batch file, which I'll post back for your consideration
(work-in-progress copy below).
I notice that the Win32 distribution of GHC does not include ar, so I've
located and downloaded a MinGW kit.
...
Compiling the source kit, I find module:
Text/XML/HaXml/Validate.hs
imports FiniteMap when what is provided by GHC is Data.FiniteMap.
...
Otherwise, the compilation and library build seems to complete OK.
...
Copying the .hi files to the imports directory tree, I find that one
existing file (from the GHC installation) is requested to be overwritten:
Overwrite C:\DEV\ghc\ghc-6.2\imports\Text\PrettyPrint\HughesPJ.hi
For now, I've refused the override and renamed the source file in the HaXml
tree. Is there any reason that the GHC version should be replaced? (The
source codes seem to be quite different, but clearly based on the same
origin: a comment suggests that the HaXml version has been converted to
"Standard Haskell".)
...
Finally, I seem to be having a minor problem installing the resulting package:
[[
C:\DEV\Haskell\lib\HaXml-1.10\src>C:\DEV\ghc\ghc-6.2\bin\ghc-pkg.exe
--add-package 0 You can avoid using 'configure' and 'make' by just following the
recipe in the Makefile by hand. Realising that as a Windows person
you are probably inexperienced in reading a Makefile, here is the
quick version. cd src
ghc --make -cpp -i. -package-name HaXml $(SRCS)
[ Replace $(SRCS) with the cut-and-pasted list of files from the
Makefile ]
ar r libHSHaXml.a $(OBJS)
[ $(OBJS) is the source-file list replacing .hs by .o ]
ld -r --whole-archive -o HSHaXml.o libHSHaXml.a
[ only if you need to play with it in GHCi ]
cp libHSHaXml.a HSHaXml.o $(GHC_LIB_DIR)
[ install the library archive(s) where GHC can find them ]
{ tar cf interfaces.tar `find Text -name *.hi -print`
cp interfaces.tar $(GHC_LIB_DIR)/imports
cd $(GHC_LIB_DIR)/imports
tar xf interfaces.tar
rm interfaces.tar
}
[ install the interface files where GHC can find them ]
ghc-pkg --add-package Obviously I have used some Unix-isms here, but you will know the
Windows equivalents better than I can guess them. ------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact

Graham Klyne
Thanks, your recipe was helpful to get me started. I'm trying to turn this into a Windows batch file, which I'll post back for your consideration (work-in-progress copy below).
I notice that the Win32 distribution of GHC does not include ar, so I've located and downloaded a MinGW kit.
It might be possible that you can use gcc's ld to build the archive, using some options like "--dll --out-implib file.a" although I can't be sure from the manual page whether this is really the right thing.
Compiling the source kit, I find module: Text/XML/HaXml/Validate.hs imports FiniteMap when what is provided by GHC is Data.FiniteMap.
Yup, FiniteMap was the old name (still available in package lang I think), but Data.FiniteMap should be essentially identical.
Copying the .hi files to the imports directory tree, I find that one existing file (from the GHC installation) is requested to be overwritten: Overwrite C:\DEV\ghc\ghc-6.2\imports\Text\PrettyPrint\HughesPJ.hi
Ah, yes, Text.PrettyPrint.HughesPJ is only included in the HaXml distribution for backward compatibility with older compiler versions that didn't have it. Probably best to remove the source from the tree before building.
ghc-pkg.exe --add-package 0
I always get the same error too (on Linux and Solaris), even though the file does exist. Must be a bug in ghc-pkg. Regards, Malcolm
participants (3)
-
Graham Klyne
-
Isaac Jones
-
Malcolm Wallace