haskell-hvr / rss

A library for generating RSS 2.0 feeds.
http://hackage.haskell.org/package/rss
18 stars 7 forks source link

rss-3000.2.0.6 breaks in some configurations due to SafeHaskell #7

Open hvr opened 7 years ago

hvr commented 7 years ago

I've noticed this with the default install-plans of GHC 7.4/7.6 (but not with GHC < 7.4 or GHC >= 7.8) and it looks like:

Preprocessing library rss-3000.2.0.6...
[1 of 1] Compiling Text.RSS         ( Text/RSS.hs, /tmp/rss-3000.2.0.6/dist-newstyle/build/x86_64-linux/ghc-7.4.2/rss-3000.2.0.6/build/Text/RSS.o )

Text/RSS.hs:67:1:
    Data.Time.Clock: Can't be safely imported!
    The module itself isn't safe.

Text/RSS.hs:68:1:
    Data.Time.Format: Can't be safely imported!
    The module itself isn't safe.

After a bit more investigation, this appears to be a problem with the time < 1.4.2 range (and only for GHC >= 7.4); but I'm still investigating (this commit here for which time-1.4.2 was the first release to contain it seems relevant: https://github.com/haskell/time/commit/7cc0d011e7a956c62d1c6a5d83b302cb938693e4)

hvr commented 6 years ago

Things got worse it seems (this is now affecting also GHC 8.2.2):

Configuring rss-3000.2.0.6...
Preprocessing library for rss-3000.2.0.6..
Building library for rss-3000.2.0.6..
[1 of 1] Compiling Text.RSS         ( Text/RSS.hs, dist/build/Text/RSS.o )

Text/RSS.hs:59:1: error:
    Network.URI: Can't be safely imported!
    The module itself isn't safe.
   |
59 | import Network.URI (URI)
   | ^^^^^^^^^^^^^^^^^^^^^^^^

IMO, the easiest way would be to revert back to {-# LANGUAGE Trustworthy #-} (i.e. what rss-3000.2.0.5 did) and silence the resulting SafeHaskell compile warnings...