swaywm / hsroots

A Haskell wrapper/binding to wlroots
GNU Lesser General Public License v2.1
39 stars 10 forks source link

Unable to get hsroots to build with stack #3

Open georgewsinger opened 5 years ago

georgewsinger commented 5 years ago

I'm trying to get hsroots to build with stack. To get around

$ stack init
# ...
Selected resolver: lts-13.3
Resolver 'lts-13.3' does not have all the packages to match your requirements.
    data-flags not found
        - hayland requires <0.1
        - xkbcommon requires -any

This may be resolved by:
    - Using '--solver' to ask cabal-install to generate extra-deps, atop the chosen snapshot.
    - Using '--omit-packages' to exclude mismatching package(s).
    - Using '--resolver' to specify a matching snapshot/resolver

I tried

  stack install cabal-install
  stack init --solver --force

but this just yields

# …
CallStack (from HasCallStack):
  error, called at src/Stack/Solver.hs:164:16 in stack-1.10.0-EBfIplDZnWH5c6Nkfwa7eL:Stack.Solver
georgewsinger commented 5 years ago

After adjusting the stack.yaml file (in particular adding data-flags-0.0.3.4 to extra-deps and using lts-12.2.6) I'm now getting the following when running stack build:

    /home/george/hsroots/haskell-xkbcommon/Text/XkbCommon/KeycodeList.hs:1:1: error:
        Exception when trying to run compile-time code:
          /home/george/hsroots/haskell-xkbcommon/Language/Preprocessor/Cpphs/MacroPass.hs:(96,9)-(97,68): Irrefutable pattern failed for pattern Cmd (Just hd) : _

        Code: runIO genKeycodes >>= return
      |
    1 | {-# LANGUAGE TemplateHaskell #-}
      | ^
Ongy commented 5 years ago

sorry for not responding for nearly a month, I had been kinda away from most projects for a while.

I don't care much about stack. I said that somewhere before (either here or the main waymonad project), I'll keep a stack.yaml around if someone sets it up and cares for it, but I don't use it and cannot take care of it myself.

Ahh, you are running into a bug in ccphs and gcc7 iirc. The new standard headers use a feature cpphs parser doesn't support. I have a more or less useable patch and contacted haskell-caffee about taking over cpphs before, but then disappeared for a while, so it never made it upstream. See https://github.com/malcolmwallace/cpphs/issues/16