Ticket #852 (assigned enhancement)

Opened 2 years ago

Last modified 2 years ago

Not possible to #include "*_stub.h" from C code

Reported by: dankna Owned by: dankna
Priority: normal Milestone:
Component: Cabal library Version: 1.8.0.6
Severity: normal Keywords:
Cc: Difficulty: unknown
GHC Version: Platform:

Description

Cabal doesn't make it possible to #include "*_stub.h" files from C code, because those files have not yet been generated at the time that it wants to check for their existence, which is during "cabal configure".

At first I was going to ask for advice because I didn't really see a solution, but now that I think about it, I think correct behavior is to omit the check for whether stub files exist and compile, but to check for the existence of files which /could/ generate them, which is to say, are Haskell files and match the module portion of the name. So I'll implement that.

Change History

Changed 2 years ago by dankna

Okay, so yeah, upon doing more work I found that this is a regression I caused myself, with my patch for #850. I still think I can fix it. Still working...

Changed 2 years ago by dankna

  • type changed from defect to enhancement

Okay so I fixed the regression (patch sent) but it's still not possible, for the deeper reason that C sources are all compiled before any Haskell sources. To fix this I think I should wait for feedback, because it would involve computing the full dependency graph and ordering it. I'm going to change this from "defect" to "enhancement".

Changed 2 years ago by dankna

Implemented this per our discussion: C source is now built after Haskell source but before final linking, so that the C sources can find the *_stub.h files generated by the Haskell compilations. Patch sent with darcs send.

Changed 2 years ago by dankna

  • owner set to dankna
  • status changed from new to assigned
Note: See TracTickets for help on using tickets.