Namespacing the GHC headers
Current situation:
At the moment, if someone wants to include GHC-related headers in their haskell program’s cbits, they do so in a manner that does not prevent name conflicts. For example:
#include "Rts.h"
#include "Stg.h"
#include "HsFFI.h"
Ideal situation:
We ought to start providing namespacing for the GHC headers, like this:
#include "ghc/Rts.h"
#include "ghc/Stg.h"
#include "ghc/HsFFI.h"
GHC 9.x We can start as early as the current GHC 9. Header files will be moved to their new locations, and stubs (that will include the proper headers) will be installed in the previous locations. The majority of our efforts will be turned to communicating our intent and transition plan to the wider community. Posts should be made on Reddit, Discourse, mailing-lists and of course the next release notes until the transition is complete. A wiki page will be created in the Haskell GitLab to host this proposal and associated information.
GHC 9.x+1 At GHC 9.x+1, warnings will be emitted during build if the top-level headers are used in code.
GHC 9.x+2 This will be the final step. In GHC 9.x+2, we entirely remove the top-level stubs. In addition, migration tools should be provided to help with the renaming of the includes. We have some time to figure out a good code-modding tool to do the job.