snapframework/snap

-fportable not working on Solaris 11 with GHC 7.10.1

kgardas opened this issue · 7 comments

Hello,
an attempt to cabal install -fportable snap -- on Solaris 11 with GHC 7.10.1 fails with:

Preprocessing library snap-core-0.9.7.0...
[ 1 of 22] Compiling Snap.Util.Readable ( src/Snap/Util/Readable.hs, dist/dist-sandbox-d2d4689b/build/Snap/Util/Readable.o )
[ 2 of 22] Compiling Snap.Internal.Iteratee.BoyerMooreHorspool ( src/Snap/Internal/Iteratee/BoyerMooreHorspool.hs, dist/dist-sandbox-d2d4689b/build/Snap/Internal/Iteratee/BoyerMooreHorspool.o )
[ 3 of 22] Compiling Snap.Internal.Parsing.FastSet ( src/Snap/Internal/Parsing/FastSet.hs, dist/dist-sandbox-d2d4689b/build/Snap/Internal/Parsing/FastSet.o )
[ 4 of 22] Compiling Snap.Internal.Debug ( src/Snap/Internal/Debug.hs, dist/dist-sandbox-d2d4689b/build/Snap/Internal/Debug.o )
[ 5 of 22] Compiling Snap.Types.Headers ( src/Snap/Types/Headers.hs, dist/dist-sandbox-d2d4689b/build/Snap/Types/Headers.o )
[ 6 of 22] Compiling Snap.Iteratee    ( src/Snap/Iteratee.hs, dist/dist-sandbox-d2d4689b/build/Snap/Iteratee.o )

/tmp/ghc14589_0/ghc14589_3.hscpp:189:1: Warning:
    The import of ‘SomeException’
    from module ‘Control.Exception’ is redundant

/tmp/ghc14589_0/ghc14589_3.hscpp:203:1: Warning:
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
[ 7 of 22] Compiling Snap.Internal.Iteratee.Debug ( src/Snap/Internal/Iteratee/Debug.hs, dist/dist-sandbox-d2d4689b/build/Snap/Internal/Iteratee/Debug.o )
[ 8 of 22] Compiling Snap.Internal.Http.Types ( src/Snap/Internal/Http/Types.hs, dist/dist-sandbox-d2d4689b/build/Snap/Internal/Http/Types.o )

/tmp/ghc14589_0/ghc14589_6.hscpp:765:35:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at /tmp/ghc14589_0/ghc14589_6.hscpp:121:1-33
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at /tmp/ghc14589_0/ghc14589_6.hscpp:124:33-49

/tmp/ghc14589_0/ghc14589_6.hscpp:778:35:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at /tmp/ghc14589_0/ghc14589_6.hscpp:121:1-33
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at /tmp/ghc14589_0/ghc14589_6.hscpp:124:33-49

/tmp/ghc14589_0/ghc14589_6.hscpp:788:21:
    Ambiguous occurrence ‘defaultTimeLocale’
    It could refer to either ‘Data.Time.Format.defaultTimeLocale’,
                             imported from ‘Data.Time.Format’ at /tmp/ghc14589_0/ghc14589_6.hscpp:121:1-33
                             (and originally defined in ‘time-1.5.0.1:Data.Time.Format.Locale’)
                          or ‘System.Locale.defaultTimeLocale’,
                             imported from ‘System.Locale’ at /tmp/ghc14589_0/ghc14589_6.hscpp:124:33-49
Failed to install snap-core-0.9.7.0
cabal: Error: some packages failed to install:
snap-0.14.0.4 depends on snap-core-0.9.7.0 which failed to install.
snap-core-0.9.7.0 failed during the building phase. The exception was:
ExitFailure 1
snap-server-0.9.5.1 depends on snap-core-0.9.7.0 which failed to install.

Thanks! Karel

I think I fixed this with commit snapframework/snap-core@1105904. Can you try it and see if it's fixed for you before I upload to hackage?

This works for me. Thanks for the patch. Now, on Solaris 11 we still do have issue with undefined timegm function, but that's another story:

[2 of 2] Compiling Main             ( src/Snap/Starter.hs, dist/dist-sandbox-8d2340e/build/snap/snap-tmp/Main.o )
Linking dist/dist-sandbox-8d2340e/build/snap/snap ...
Undefined           first referenced
 symbol                 in file
timegm                              /export/home/karel/git/snap-core-test/snap-core/.cabal-sandbox/lib/i386-solaris-ghc-7.10.1/snapc_HI0RgBFAcuM7tWnqWe3yQO/libHSsnap-core-0.9.7.1-HI0RgBFAcuM7tWnqWe3yQO.a(timefuncs.o)
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
Failed to install snap-0.14.0.4
cabal: Error: some packages failed to install:
snap-0.14.0.4 failed during the building phase. The exception was:
ExitFailure 1

timegm is used in snap-core. Why don't you open another issue on the snap-core package with more details?

I think I was wrong and this fix is not the correct one. You have basically removed -DPORTABLE for GHC 7.10.1 and this causes timegm linking issue. The problem is that -fportable was working fine on Solaris 11 in the past, see #136

I've found that similar issue is already reported and hopefully fixed in HEAD, it's snap-core#228 snapframework/snap-core#228

I've tested HEAD (1.0.0.0 version) and this is working fine on Solaris 11 with -fportable.

Thanks for following up with this. I reverted my commit and applied the patch from the master branch.