GHC 6.6 using stale stub.c files

I tried recompiling a little (big?) Win32 binding library I had made, when the official one wasn't working for me. It had a bunch of generated stubs files in it (I'm not 100% sure what they are for). The problem is that, not even with -fforce-recomp (much better name, thanx!) will GHC regenerate those files (I think that's normal), but still it tries to use them if they are there. I get errors like these: Win32Test_stub.c: In function `Main_d4n0': Win32Test_stub.c:14:0: error: too few arguments to function `rts_mkPtr' Win32Test_stub.c:14:0: warning: passing arg 1 of `rts_apply' from incompatible pointer type Win32Test_stub.c:14:0: error: too few arguments to function `rts_apply' Win32Test_stub.c:14:0: warning: passing arg 1 of `rts_mkWord32' makes pointer from integer without a cast (etc, etc... lots of them). The stub file is old: C:\Documents and Settings\JCAB\My Documents\Haskell>dir Win32Test_stub.c Volume in drive C has no label. Volume Serial Number is A0CD-B8F4 Directory of C:\Documents and Settings\JCAB\My Documents\Haskell 08/18/2005 12:15 AM 637 Win32Test_stub.c 1 File(s) 637 bytes 0 Dir(s) 151,815,680,000 bytes free And yes, I'm on Windows. There are some stubs files that were regenerated: C:\Documents and Settings\JCAB\My Documents\Haskell>dir Win32\Window\Types_stub.c Volume in drive C has no label. Volume Serial Number is A0CD-B8F4 Directory of C:\Documents and Settings\JCAB\My Documents\Haskell\Win32\Window 10/22/2006 05:05 PM 717 Types_stub.c 1 File(s) 717 bytes 0 Dir(s) 151,803,375,616 bytes free So I suppose the no-longer-needed stubs files were related to the modules that made use of this Win32.Window.Types module I had here. I guess GHC doesn't need those any more, but it just tries to use any stub files it finds. It probably shouldn't use them, and it should probably even delete them, unless it generated them, at least when -fforce-recomp is specified. I'm moving on. I made a copy of all the files, so let me know if you need a repro. Deleting the stubs files fixes the problem. I haven't seen anything about this in the documentation, but maybe I just didn't look in the right places. Thanx! JCAB

Juan Carlos Arevalo Baeza wrote:
I tried recompiling a little (big?) Win32 binding library I had made, when the official one wasn't working for me. It had a bunch of generated stubs files in it (I'm not 100% sure what they are for). The problem is that, not even with -fforce-recomp (much better name, thanx!) will GHC regenerate those files (I think that's normal), but still it tries to use them if they are there. I get errors like these:
Win32Test_stub.c: In function `Main_d4n0':
Win32Test_stub.c:14:0: error: too few arguments to function `rts_mkPtr'
Win32Test_stub.c:14:0: warning: passing arg 1 of `rts_apply' from incompatible pointer type
Win32Test_stub.c:14:0: error: too few arguments to function `rts_apply'
Win32Test_stub.c:14:0: warning: passing arg 1 of `rts_mkWord32' makes pointer from integer without a cast
(etc, etc... lots of them).
The stub file is old:
C:\Documents and Settings\JCAB\My Documents\Haskell>dir Win32Test_stub.c Volume in drive C has no label. Volume Serial Number is A0CD-B8F4
I think you are encountering this bug: http://hackage.haskell.org/trac/ghc/ticket/706 workaround: delete the old stub files. Cheers, Simon

Simon Marlow wrote:
Juan Carlos Arevalo Baeza wrote:
I tried recompiling a little (big?) Win32 binding library I had made, when the official one wasn't working for me. It had a bunch of generated stubs files in it (I'm not 100% sure what they are for). The problem is that, not even with -fforce-recomp (much better name, thanx!) will GHC regenerate those files (I think that's normal), but still it tries to use them if they are there. I get errors like these: I think you are encountering this bug:
http://hackage.haskell.org/trac/ghc/ticket/706
workaround: delete the old stub files.
Yes, as I said, that workaround works. However, the description of the bug is incorrect. It picks up the _stub.c files, not the _stub.o files, and it picks them up even if the file is recompiled (and didn't re-generate the _stub.c file). Bug updated. Thanx! JCAB

Juan Carlos Arevalo Baeza wrote:
Simon Marlow wrote:
Juan Carlos Arevalo Baeza wrote:
I tried recompiling a little (big?) Win32 binding library I had made, when the official one wasn't working for me. It had a bunch of generated stubs files in it (I'm not 100% sure what they are for). The problem is that, not even with -fforce-recomp (much better name, thanx!) will GHC regenerate those files (I think that's normal), but still it tries to use them if they are there. I get errors like these:
I think you are encountering this bug:
http://hackage.haskell.org/trac/ghc/ticket/706
workaround: delete the old stub files.
Yes, as I said, that workaround works.
However, the description of the bug is incorrect. It picks up the _stub.c files, not the _stub.o files, and it picks them up even if the file is recompiled (and didn't re-generate the _stub.c file).
Bug updated. Thanx!
Now I'm surprised. I understood bug #706 as it was, I understand the cause and how to fix it. But I don't know how GHC could be recompiling the _stub.c files. There could be two bugs here. If you could supply us with a repro case, that would be very helpful (please attach it to the ticket). Cheers, Simon

Simon Marlow wrote:
Juan Carlos Arevalo Baeza wrote:
Simon Marlow wrote:
Juan Carlos Arevalo Baeza wrote:
I tried recompiling a little (big?) Win32 binding library I had made, when the official one wasn't working for me. It had a bunch of generated stubs files in it (I'm not 100% sure what they are for). The problem is that, not even with -fforce-recomp (much better name, thanx!) will GHC regenerate those files (I think that's normal), but still it tries to use them if they are there. I get errors like these:
I think you are encountering this bug:
http://hackage.haskell.org/trac/ghc/ticket/706
workaround: delete the old stub files.
Yes, as I said, that workaround works.
However, the description of the bug is incorrect. It picks up the _stub.c files, not the _stub.o files, and it picks them up even if the file is recompiled (and didn't re-generate the _stub.c file).
Bug updated. Thanx!
Now I'm surprised. I understood bug #706 as it was, I understand the cause and how to fix it. But I don't know how GHC could be recompiling the _stub.c files.
There could be two bugs here. If you could supply us with a repro case, that would be very helpful (please attach it to the ticket).
I attached the repro and posted instructions. Feel free to open another bug, move the file, etc. And let me know directly (I don't always monitor this list) if you need anything else. JCAB
participants (2)
-
Juan Carlos Arevalo Baeza
-
Simon Marlow