New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHC 8.10.3, Cabal 2.2 inline-c-cpp cleanup #121
Conversation
LTS 11 comes with Cabal < 2.2, which doesn't support cxx-options.
a123cb3
to
493a2f9
Compare
Previously my manual testing has been distorted by unclean builds. |
if os(darwin) | ||
ghc-options: -pgmc=clang++ | ||
extra-libraries: stdc++ | ||
cc-options: -Wall -Werror -optc-xc++ -std=c++11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restoring -Werror
is feasible but may require duplicating a large part of common cxx-opts
This is now blocked on a Cabal update to fix haskell/cabal#6421. This is available in Cabal 3.2.1.0. |
Thanks so much for all the work / research -- let's merge when things are in working order. |
-xc++ must be provided on the command line before listing the input files, which Cabal does not do. We rely on -std=c++11 (or similar) to switch to C++ on GHC < 8.10 with GCC. We also remove a redundant -std=c++11 because it is already provided in the common stanza.
The error: inline-c > configure (lib + exe + test) inline-c > Configuring inline-c-0.9.1.3... inline-c > Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4: Missing dependencies on foreign inline-c > libraries: inline-c > * Missing (or bad) C libraries: gsl, gslcblas
This is ready for review. As a bonus, instead of only a minimal |
@roberth thanks! |
Released as 0.9.1.4. |
@bitonic Most of these changes are in |
@roberth just did so, sorry about the oversight. |
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 setc++11
forinline-c-cpp
itself. This should be ok, because-- https://stackoverflow.com/questions/46746878/is-it-safe-to-link-c17-c14-and-c11-objects/49118876~