Closed johannesgerer closed 11 months ago
There are a couple of things happening here. The first is that reflex-platform overrides double-conversion for ghcjs by default: https://github.com/reflex-frp/reflex-platform/blob/develop/haskell-overlays/text-jsstring/default.nix#L47-L54
This override uses a fork of double-conversion that avoids the C FFI: https://github.com/obsidiansystems/double-conversion/commit/0f9ddde468687d25fa6c4c9accb02a034bc2f9c3
To build and test locally:
git clone git@github.com:obsidiansystems/double-conversion
cd double-conversion
nix-shell /path/to/reflex-platform -A ghcjs.double-conversion.env
cabal configure --ghcjs
cabal build
cabal test
Alternatively, you can do:
git clone @git@github.com:obsidiansystems/double-conversion
cd double-conversion
/path/to/reflex-platform/scripts/work-on ghcjs ./.
cabal configure --ghcjs
cabal build
cabal test
Thanks.
I ran the tests using your snippet and got the same failure as in my post above.
I had a look at the package and it seems the C functions are not all replaced. The test fails when it tries to find h$_hs_ToShortestLength
which is called here.
So this is an issue with double-conversion.
And the second issue also remains: the test is hanging instead of failing when built with nix within the reflex-platform.
double-conversion tests do fail, but they do not hang now. tested on 1.2.0.0 by running nix-build . -A ghcjs.double-conversion
Running this command in a fresh checkout of reflex-platform (37b7bdd):
will build fine but then hang on:
and this process will be running with 0% CPU:
Two issues: 1) It is expected behavior that the test hangs instead of failing?
Reason: When I build and run the test I got the error
which is expected given that these C functions (or JS equivalent) are not availble.
2) Given that the package cannot actually be used as is in GHCJS due to the missing C functions, why did it say it built correctly?