Open georgewsinger opened 5 years ago
It looks like this is due to an upstream bug: malcolmwallace/cpphs#16.
As a workaround, perhaps you can force an older version of cpphs by simply using an old stackage version.
cpphs appears to be unmaintained (see linked bug). If there's no workaround, I'd suggest migrating to a different tool instead.
@frozencemetery Perhaps that's a good idea. However, I have no good overview of how this package is actually being used, and by which packages. I suspect most of the code is never used. If we can get an overview of this, then we are in a position to clean up this package a little bit. Perhaps it should be split up.
@abooij by "this package", do you mean cpphs or haskell-xkbcommon?
If the former: cpphs is directly used by haskell-xkbcommon . My understanding is a little rocky here, but I think it's used by all the .hsc files.
If the latter: haskell-xkbcommon is your package. I don't know whether there's a way to query rdeps in haskell-land, but if you're considering breaking changes, you could either make them (and be okay reverting), or just fork to a new name. Not sure how you'd get this information otherwise.
I'm just here because I'd like waymonad to build, and resolving this issue (or removing the waymonad dep on haskell-xkbcommon) is required for that as far as I can tell.
@frozencemetery, I meant how haskell-xkbcommon is used. Looking at waymonad, at first glance it looks like haskell-xkbcommon is used as intended, or at least it's not just using 3 lines of code. Importantly, it uses Text.XkbCommon.KeysymPatterns
, which is generated using cpphs. Specifically, Text.XkbCommon.ParseDefines
reads certain C header files, and picks out the #define
s using cpphs. It may be necessary to follow #include
s when parsing the given C header file (I believe there was an issue about this), which kinda complicates the parsing.
Having done all this parsing, it simply reads a bunch of #define
s, filters out a bunch, and outputs corresponding Haskell values for them.
It should certainly be possible to do this without using cpphs, either by some raw String manipulation, or using a parser library such as Megaparsec. PRs are welcome.
After constructing a
stack.yaml
and runningstack build
: