fpco / inline-c

284 stars 51 forks source link

llvm 7.1 / unhack cc-options #120

Closed roberth closed 3 years ago

roberth commented 3 years ago

LLVM 7.1 refuses to build master because of the hacky way we were invoking the "c++ compiler". That wasn't sustainable. Luckily Cabal >= 2.2 allows us to solve it properly.

The commits for the redundant include and the -D sanity check aren't strictly necessary but good to have.

Update, instead a change to LLVM 7.1, the error was triggered by Block.h in GHC 8.10.2. Newer releases have a correction for this specific file, but are still prone to this mistake.

roberth commented 3 years ago

CI is using an old cabal. This change requires Cabal 2.2 which is over 2.5 years old (March 2018)

bitonic commented 3 years ago

Thanks a lot, finally we can get rid of these warnings even in compilers that did support C++ flags in that context.

However, the Travis file installs slack using the way recommended on the website: https://docs.haskellstack.org/en/stable/travis_ci/ . Does this mean that anybody trying to install inline-c using stock stack will be unable to, if we merge this change?

If that is the case, we should maybe make these new flags conditional on the cabal version, if possible.

roberth commented 3 years ago

Seems like I had two wrong assumptions. An LLVM update probably wasn't the cause, but rather a change in a GHC 8.10(.2?) header. I'll close this PR to fix the branch name. The other assumption was that Stack would use a fixed Cabal version, which is not the case. I'll open a new PR that drops LTS 11 support.