fpco / inline-c

284 stars 51 forks source link

GHC 8.10.3, Cabal 2.2 inline-c-cpp cleanup #121

Closed roberth closed 3 years ago

roberth commented 3 years ago

New, cleaner attempt to support GHC 8.10. Previous reasoning was flawed.

~This PR cleans up a number of things around inline-c-cpp. It does not support LTS 11 (GHC 8.2). LTS 11 users can of course still use the inline-c-cpp from the snapshot. It also does not attempt to set C++ compiler options on GHCs older than 8.10. This does not affect user packages because those still use the cc-options hack. They can do the same cleanup when they see fit.~

~This also means that we don't set c++11 for inline-c-cpp itself. This should be ok, because~

GCC, LLVM, and VC++ have been designed to enable binary compatibility across different versions of the C++ standard. This is not really a requirement of the standard itself though.

-- https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects/49118876~

roberth commented 3 years ago

Previously my manual testing has been distorted by unclean builds. Cabal doesn't rebuild C/C++ files when options change. This doesn't affect builds in Nix or on CI, but it has made the hacking on this PR needlessly puzzling and frustrating.

roberth commented 3 years ago

This is now blocked on a Cabal update to fix https://github.com/haskell/cabal/issues/6421. This is available in Cabal 3.2.1.0. Stackage Nightly currently comes with Cabal 3.2.0.0.

bitonic commented 3 years ago

Thanks so much for all the work / research -- let's merge when things are in working order.

roberth commented 3 years ago

This is ready for review.

As a bonus, instead of only a minimal stack.yaml, macOS now also runs for GHC 8.6 - 8.10. It now also builds the C++ example instead of none.

bitonic commented 3 years ago

@roberth thanks!

bitonic commented 3 years ago

Released as 0.9.1.4.

roberth commented 3 years ago

@bitonic Most of these changes are in inline-c-cpp rather than inline-c. Could you release inline-c-cpp as well?

bitonic commented 3 years ago

@roberth just did so, sorry about the oversight.