Re: ghc-cvs-snapshot with wxHaskell

Hi, Patrick and I found some answers to the questions/problems we encountered. Finally got the thing to work. (patches appended) Versions: ghc-6.4.20050215 wxHaskell-0.8. 1. dep-files the new ghc produces a different dependency file. It includes also dependencies for imported modules. i.e.
module A import B it generates: B.o : B.hs A.o : A.hs A.o : B.hi where as the old ghc omitted the first line, which is not necessary IMO. The problem with the wx-Makefile is now that the .o and .hi files should reside in another directory namely out/... The current approach is to use "sed". However on the new depfiles it generates rules, which are not correct and which lead to the problems Patrick experiences. I have a possible fix: add -odir out/... to the call of ghc -M. This produces correct paths for the .o files. use "grep" to filter module A Problem: the .hi files have still the source path. Question @Daan: Why do they have to by in out/...? It seams to complicate the thing. Solution: "sed" I fixed that in "makefile.lib".
Now the dependency stuff seams to work fine. No double compilation anymore. 2. correct import-search path the make file calls ghc from the wxHaskell-root. Therefore -icurrent/source/path has to be included. I fixed that in "makefile". 3. Package stuff I included package files in the new style to the configure script. Problem: the environment variable are not substituted any longer by ghc-pkg ? My hack: let configure sustitude the variable, i.e. configure:750
wxhlibdir="${libdir}" . . import-dirs: ${wxhlibdir}/imports instead of import-dirs: \${wxhlibdir}/imports
This might cause problems with the rpm install stuff. Additionally, I had problems with the license field. It seams to be a choice rather a text-field. I took BSD3 since it worked. @Simon: How can I add a custom license like "wxWindows" @Daan: Please complete the package files. There are a couple of new entries. Also some exports from wxcore might be better in the hidden-modules field. Honestly I have no idea where it is for. A had to add a
extra-libs : wxc-gtk2.4.2-0.8 to wxcore package info. This seams not quite portable :-). @Daan: please replace this by a proper variable
4. Module name clash
ghc complained:
wxdirect/src/Set.hs:1:0:
Module `Set' is a member of package data-1.0.
To compile this module, please use -ignore-package data-1.0.
I love ghc's error messages! Great job Simon!
@Daan: the configure script uses /usr as a default prefix. I think /usr/local is more standard here. Additionally the modules are installed to <prefix>/lib/imports. I would rather like <prefix>/lib/wxHaskell/imports.
How do we make sure that nobody else wants to use the path lib/imports?
This is a fairly common, or at least non-specific, directory name in my eyes.
Cheers,
Georg
On Thu, 17 Feb 2005 00:44:23 +0100, Patrick Scheibe
On Wednesday 16 February 2005 16:48, you wrote:
Hi Simon and Daan.
I took the stable ghc source from yesterday, 15th of february. I think Simon fixed the creation of .depfiles problem, am I right? Touching of these files is unnecessary now.
In earlier versions the ghc seems to make the right thing when you call ghc -M ./dir1/dir2/src/Moduldir/Modul.hs
Now there are errors when you call it from outside the modulpath:
Could not find module `ParseEiffel': use -v to see a list of the files searched for (imported from wxdirect/src/CompileDefs.hs)
I fixed this with giving the -i./dir1/dir2/src option to every call. @Simon: is this a feature? Do I make something strange with this fix?
Now the compilation runs fine (:-) but when I do a make install, the makefile begins to compile again!?? After a while of compilation it breaks with a "no rule to make.." error. How can ghc forget the compiled stuff? The objects are definitely there, so there is no need to recompile WX.o, ...
@Daan: I tried to delete the dependency wx from the install rule of the makefile but that doesn't matter. I would like to install it by myself to see if the lib is working. Do you have a quick bad fix of this?
Cheers Patrick
-- ---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net ---------

Georg Martius wrote:
Hi,
Patrick and I found some answers to the questions/problems we encountered. Finally got the thing to work. (patches appended)
Great!
I have a possible fix: add -odir out/... to the call of ghc -M. This produces correct paths for the .o files.
Ok, this makes sense and, importantly, it also works for older ghc's
use "grep" to filter module A Problem: the .hi files have still the source path. Question @Daan: Why do they have to by in out/...? It seams to complicate the thing. Solution: "sed" I fixed that in "makefile.lib".
I do not understand what you are saying here. Can you explain in more detail? What is the issue with .hi files? The files definitely have to go to "out/.." to get everything nicely separated. Secondly, maybe ghc should not generate the spurious extra rules? (and generate exactly what it generated at version 6.2.2). What do you think Simon?
2. correct import-search path the make file calls ghc from the wxHaskell-root. Therefore -icurrent/source/path has to be included. I fixed that in "makefile".
This is weird. It works with ghc-6.2.2, so there should not be an extra include path. All files are referenced by absolute paths everywhere! (that's why I use sed in the first place to process .d files)
3. Package stuff I included package files in the new style to the configure script. Problem: the environment variable are not substituted any longer by ghc-pkg ?
Simon?
My hack: let configure sustitude the variable, i.e. configure:750
wxhlibdir="${libdir}"
Ok. Thanks a lot for you hard work on this! -- Daan.

On Thu, 17 Feb 2005 14:48:11 +0100, Daan Leijen
Georg Martius wrote:
Hi,
Patrick and I found some answers to the questions/problems we encountered. Finally got the thing to work. (patches appended)
Great!
I have a possible fix: add -odir out/... to the call of ghc -M. This produces correct paths for the .o files.
Ok, this makes sense and, importantly, it also works for older ghc's
use "grep" to filter module A Problem: the .hi files have still the source path. Question @Daan: Why do they have to by in out/...? It seams to complicate the thing. Solution: "sed" I fixed that in "makefile.lib".
I do not understand what you are saying here. Can you explain in more detail? What is the issue with .hi files? example: src/A.hs (import src/B.hs with "import B") ghc -M -odir out depfile: out/B.o: src/B.hs -- this line is new, as said before out/A.o: src/A.hs out/A.o: src/B.hi -- this line referes to a .hi, which is not there, it is under out/B.hs
The original code in the makefile.lib replaced (basename input.hs) with (basename output.o) and *.hi with *.o which is a quite weird approach to the problem. I'am not sure but I think the new approach is better: let the .o files be correct through the -odir flag replace (dir input)/FILE.hi with (dir output)/$FILE.o However it is just a guess. The thing is that we have no rules for *.hs to *.hi. If so it would be easier. A more general question: We doesn't -ohi dir/filename.hi is not reflected in the dependencies. I tried:
ghc -M -odir out -ohi out/A.hi A.hs but nothing changed.
2. correct import-search path the make file calls ghc from the wxHaskell-root. Therefore -icurrent/source/path has to be included. I fixed that in "makefile".
This is weird. It works with ghc-6.2.2, so there should not be an extra include path. All files are referenced by absolute paths everywhere! (that's why I use sed in the first place to process .d files) Okay it was my fault. If all dependencies are resolved correctly then it works fine, also with ghc-6.4. Sorry! The -i$({WXD|WXCORW|...}-SRCDIR) flags can be removed from the makefile.diff.
Cheers, Georg

The original code in the makefile.lib replaced (basename input.hs) with (basename output.o) and *.hi with *.o which is a quite weird approach to the problem. I'am not sure but I think the new approach is better: let the .o files be correct through the -odir flag replace (dir input)/FILE.hi with (dir output)/$FILE.o
This seems indeed much more sensible. I'll try this out with ghc 6.2.2.
A more general question: We doesn't -ohi dir/filename.hi is not reflected in the dependencies. I tried:
ghc -M -odir out -ohi out/A.hi A.hs
but nothing changed.
Simon?? Thanks again for your bug fixing, -- Daan.

Hi again, Fuck! The problem is different indeed! As Patrick pointed out earlier, the problem with the import-paths is the -M run, not the normal compilation run.
/usr/bin/ghc -M wxcore/src/Graphics/UI/WXCore/WxcClassTypes.hs \ -iout/wxcore/imports -Iwxc/include works fine with ghc-6.2, but ghc-6.4: Could not find module `Graphics.UI.WXCore.WxcObject' Therefore Patrick suggested to include -iwxcore/src/ However it should not be necessary for ghc, but I see why it needs it to produce the spurious line :-) Simon?
/usr/bin/ghc -M wxcore/src/Graphics/UI/WXCore/WxcClassTypes.hs \ -iout/wxcore/imports -Iwxc/include -iwxcore/src \ -odir out/wxcore/imports/Graphics/UI/WXCore/
Another bug in ghc! produces (among others):
out/wxcore/imports/Graphics/UI/WXCore//Graphics/UI/WXCore/WxcClassTypes.o : \ wxcore/src/Graphics/UI/WXCore/WxcClassTypes.hs where you see that the -odir is not handled correctly.
Now I see the reason why I added the source directories to the import search-path in general. The current appoach for the depfiles (until the -odir thing is fixed):
- include -isourcepath and NO -odir
- use grep to get rid of the spurious dependency lines
- use the old approach for renaming
(patch attached)
Cheers,
Georg
On Thu, 17 Feb 2005 15:54:00 +0100, Daan Leijen
The original code in the makefile.lib replaced (basename input.hs) with (basename output.o) and *.hi with *.o which is a quite weird approach to the problem. I'am not sure but I think the new approach is better: let the .o files be correct through the -odir flag replace (dir input)/FILE.hi with (dir output)/$FILE.o
This seems indeed much more sensible. I'll try this out with ghc 6.2.2.
A more general question: We doesn't -ohi dir/filename.hi is not reflected in the dependencies. I tried:
ghc -M -odir out -ohi out/A.hi A.hs
but nothing changed.
Simon??
Thanks again for your bug fixing, -- Daan.
-- ---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net ---------
participants (2)
-
Daan Leijen
-
Georg Martius