extra icon indicating copy to clipboard operation
extra copied to clipboard

Tests fail to build with GHCJS

Open phadej opened this issue 5 years ago • 1 comments

[1 of 4] Compiling TestUtil         ( test/TestUtil.hs, /code/other-haskell/extra/dist-newstyle/build/x86_64-linux/ghcjs-8.4.0.1/extra-1.6.17/t/extra-test/build/extra-test/extra-test-tmp/TestUtil.js_o )

test/TestUtil.hs:10:6: error:
    Conflicting exports for ‘isWindows’:
       ‘module X’ exports ‘X.isWindows’
         imported from ‘System.FilePath’ at test/TestUtil.hs:33:1-27
         (and originally defined in ‘System.FilePath.Posix’)
       ‘module X’ exports ‘X.isWindows’
         imported from ‘System.Info.Extra’ at test/TestUtil.hs:34:1-29
   |
10 |     ,module X

This is no biggie, and I can workaround it easy by having an override

      extra          = dontCheckGHCJS super.extra;

but if it can be fixed, all the better!

phadej avatar Jun 28 '19 10:06 phadej

I think GHCJS adding extra functions to a standard library is not a particularly smart move... They should have added isWindows to System.Info on all versions of Haskell instead.

That said, I'd accept a patch that made ifdef GHCJS then don't define isWindows but reexport the filepath one that GHCJS defines. That should give you compatibility and also work with everything that depends on extra. PR welcome (since I have no way of testing it), but happy to sketch out a roughly working patch if that helps.

ndmitchell avatar Jun 29 '19 10:06 ndmitchell