haskell-github-trust/thyme

Build fails with clang 7.1.0 on macOS

Closed this issue · 2 comments

Building library for thyme-0.3.5.5..
[ 1 of 20] Compiling Control.Lens     ( lens/Control/Lens.hs, dist/build/Control/Lens.o, dist/build/Control/Lens.dyn_o )
[ 2 of 20] Compiling Data.Thyme.Format.Internal ( src/Data/Thyme/Format/Internal.hs, dist/build/Data/Thyme/Format/Internal.o, dist/build/Data/Thyme/Format/Internal.dyn_o )
[ 3 of 20] Compiling Data.Thyme.Calendar.Internal ( src/Data/Thyme/Calendar/Internal.hs, dist/build/Data/Thyme/Calendar/Internal.o, dist/build/Data/Thyme/Calendar/Internal.dyn_o )

src/Data/Thyme/Calendar/Internal.hs:21:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
   |
21 | import Control.Applicative
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 4 of 20] Compiling Data.Thyme.Calendar.MonthDay ( src/Data/Thyme/Calendar/MonthDay.hs, dist/build/Data/Thyme/Calendar/MonthDay.o, dist/build/Data/Thyme/Calendar/MonthDay.dyn_o )
[ 5 of 20] Compiling Data.Thyme.Internal.Micro ( src/Data/Thyme/Internal/Micro.hs, dist/build/Data/Thyme/Internal/Micro.o, dist/build/Data/Thyme/Internal/Micro.dyn_o )
[ 6 of 20] Compiling Data.Thyme.Clock.Internal ( src/Data/Thyme/Clock/Internal.hs, dist/build/Data/Thyme/Clock/Internal.o, dist/build/Data/Thyme/Clock/Internal.dyn_o )
[ 7 of 20] Compiling Data.Thyme.Format.Human ( src/Data/Thyme/Format/Human.hs, dist/build/Data/Thyme/Format/Human.o, dist/build/Data/Thyme/Format/Human.dyn_o )

src/Data/Thyme/Format/Human.hs:15:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
   |
15 | import Control.Applicative
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 8 of 20] Compiling Data.Thyme.Clock.POSIX ( dist/build/Data/Thyme/Clock/POSIX.hs, dist/build/Data/Thyme/Clock/POSIX.o, dist/build/Data/Thyme/Clock/POSIX.dyn_o )
error: unknown argument: '--cpp'
`cc' failed in phase `C Compiler'. (Exit code: 1)

I'm guessing GHC passes the -optc and the -optP flags to the C compiler when building hsc files?

Have a look at my fix liyang@ff7b5d9 for GHC 8.10.7 / cabal 3.6. I've not tested on older versions of either but the handling of ghc-options and cpphs seems to have changed.

https://hackage.haskell.org/package/thyme-0.4 was released with the above fix.
We have CI for macOS-latest configured on the repo https://github.com/haskell-github-trust/thyme/actions/runs/5096592452/jobs/9162800443 to give some basic testing on macOS.