
Hi, I'm trying to update the Debian packaging of hat so that hat is functional in Debian again (the currently Debian package doesn't work with any Haskell implementation available in Debian). I've run into several bugs (?) that I was able to work around, but I've now hit one that has me stumped. The first problem that I had is that the script to detect the current ghc version is wrong. It searches for the regular expression "^[0-9]*". Problem is, the ghc invocation it uses generates the following file: ----- cut here ----- 604 ----- cut here ----- As a result, hat's idea of the ghc version is "\n\n604", which wreaks all kinds of havoc as I'm sure you can imagine. The solution is to use the regular expression "^[0-9]\+" or the equivalent form "^[0-9][0-9]*". Next, I ran into some files that are in a different directory from what the build scripts want and break the build as a consequence. For instance, make[2]: *** No rule to make target `Foreign/ForeignPtr.hs', needed by `/home/daniel/debian-pkgs/NMU/hat/hat-2.04/debian/build-tools/targets/ix86-Linux/obj/hatlib/ghc6/Hat/Foreign/ForeignPtr.o'. Stop. ForeignPtr is in Hat/Foreign/, not Foreign/. I dealt with this by copying the file into the correct directory, and I did the same with PreludeBasic.hx (which is in the root of the hatlib source directory but is expected to be in Hat/). However, I now get this error message: /home/daniel/debian-pkgs/NMU/hat/hat-2.04/debian/build-tools/script/hat-trans -P. -I. -trusted -prelude -D__GLASGOW_HASKELL__=604 Foreign/ForeignPtr.hs hat-trans: ./Hat/Hack.hx: openFile: does not exist (No such file or directory) Hack.hx exists nowhere in the source tree. I don't really know what a .hx file is, but they appear to be some sort of specially processed form of the .hs modules. It looks like you forgot to include some files in the source distribution; would it be possible for you to email them to me? Thanks, Daniel

Sorry for the delay in response - your message got caught in the
haskell.org mail filters.
Daniel Burrows
The first problem that I had is that the script to detect the current ghc version is wrong. It searches for the regular expression "^[0-9]*".
Thanks for suggesting "^[0-9]+" as an alternative. We have gone through several different regular expressions since the 2.04 release in an attempt to exclude strange newlines and pre-processor directives. Your solution might be the cleanest.
make[2]: *** No rule to make target `Foreign/ForeignPtr.hs', needed by `/home/daniel/debian-pkgs/NMU/hat/hat-2.04/debian/build-tools/targets/ix86-Linux/obj/hatlib/ghc6/Hat/Foreign/ForeignPtr.o'. Stop.
ForeignPtr is in Hat/Foreign/, not Foreign/. I dealt with this by copying the file into the correct directory, and I did the same with PreludeBasic.hx (which is in the root of the hatlib source directory but is expected to be in Hat/).
There is definitely something odd happening here. The version in Hat/Foreign/ForeignPtr.hs has already been transformed by hat-trans from Foreign/ForeignPtr.hs When you copied it back to that location, the Makefile then tried to transform it a second time, which is the reason for the subsequent error:
hat-trans: ./Hat/Hack.hx: openFile: does not exist
But I am not sure why the original file Foreign/ForeignPtr.hs was no longer in its original location. It is certainly included in the tarfile, and 'make clean' should not remove it. Perhaps you just need to start again with a freshly unpacked archive and the 'script/confhc-hat' fix? Regards, Malcolm

On Tue, Mar 21, 2006 at 11:14:28AM +0000, Malcolm Wallace
Sorry for the delay in response - your message got caught in the haskell.org mail filters.
Daniel Burrows
writes: The first problem that I had is that the script to detect the current ghc version is wrong. It searches for the regular expression "^[0-9]*".
Thanks for suggesting "^[0-9]+" as an alternative. We have gone through several different regular expressions since the 2.04 release in an attempt to exclude strange newlines and pre-processor directives. Your solution might be the cleanest.
make[2]: *** No rule to make target `Foreign/ForeignPtr.hs', needed by `/home/daniel/debian-pkgs/NMU/hat/hat-2.04/debian/build-tools/targets/ix86-Linux/obj/hatlib/ghc6/Hat/Foreign/ForeignPtr.o'. Stop.
ForeignPtr is in Hat/Foreign/, not Foreign/. I dealt with this by copying the file into the correct directory, and I did the same with PreludeBasic.hx (which is in the root of the hatlib source directory but is expected to be in Hat/).
There is definitely something odd happening here. The version in Hat/Foreign/ForeignPtr.hs has already been transformed by hat-trans from Foreign/ForeignPtr.hs When you copied it back to that location, the Makefile then tried to transform it a second time, which is the reason for the subsequent error:
hat-trans: ./Hat/Hack.hx: openFile: does not exist
But I am not sure why the original file Foreign/ForeignPtr.hs was no longer in its original location. It is certainly included in the tarfile, and 'make clean' should not remove it. Perhaps you just need to start again with a freshly unpacked archive and the 'script/confhc-hat' fix?
Ah, my bad; I had missed some lines in debian/rules: rm -f src/hatlib/Foreign/ForeignPtr.hs rm -f src/hatlib/Foreign/ForeignPtr.hx I imagine this might explain my problem. :-) And indeed, when I pull those lines out, the compilation completes and the build script dies trying to run a target called "install-noinc". I guess maybe I'll look at what's up with that tomorrow. Daniel

Daniel Burrows
the compilation completes and the build script dies trying to run a target called "install-noinc". I guess maybe I'll look at what's up with that tomorrow.
I suggest you ask the maintainer of the debian package (Ian Lynagh?) what the intention is there. It may be something to do with installing files only, without running the ghc package registration step. Regards, Malcolm

OTTOMH: On Tue, Mar 21, 2006 at 09:23:35PM -0800, Daniel Burrows wrote:
On Tue, Mar 21, 2006 at 11:14:28AM +0000, Malcolm Wallace
was heard to say: Daniel Burrows
writes: make[2]: *** No rule to make target `Foreign/ForeignPtr.hs', needed by `/home/daniel/debian-pkgs/NMU/hat/hat-2.04/debian/build-tools/targets/ix86-Linux/obj/hatlib/ghc6/Hat/Foreign/ForeignPtr.o'. Stop.
ForeignPtr is in Hat/Foreign/, not Foreign/. I dealt with this by copying the file into the correct directory, and I did the same with PreludeBasic.hx (which is in the root of the hatlib source directory but is expected to be in Hat/).
But I am not sure why the original file Foreign/ForeignPtr.hs was no longer in its original location. It is certainly included in the tarfile, and 'make clean' should not remove it. Perhaps you just need to start again with a freshly unpacked archive and the 'script/confhc-hat' fix?
Ah, my bad; I had missed some lines in debian/rules:
rm -f src/hatlib/Foreign/ForeignPtr.hs rm -f src/hatlib/Foreign/ForeignPtr.hx
I think this dates from a time when ghc and nhc98/hugs had different libraries; you should get a different file copied/symlinked depending on which compiler is being used.
I imagine this might explain my problem. :-) And indeed, when I pull those lines out, the compilation completes and the build script dies trying to run a target called "install-noinc".
I think this is a target I added that either installs just the tools, or one that installs just the libraries (as hat wasn't designed to support multiple implementations with a single set of tools). It sounds like you have some of the Debian packaging stuff but not all of it? (perhaps just the debian/ directory?) Thanks Ian
participants (4)
-
Daniel Burrows
-
Daniel Burrows
-
Ian Lynagh
-
Malcolm Wallace