corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

Error loading clock object in Windows 10 x86 #54

Closed mcandre closed 6 years ago

mcandre commented 6 years ago

Hello, I am able to use clock v0.7.2 with QuickCheck in Windows 10 x86_64, however, when I try to do this in Windows 10 x86, then GHC complains of an unknown symbol error.

Trace

PS C:\> shake
ghc.exe:  | C:\Users\vagrant\AppData\Roaming\cabal\i386-windows-ghc-8.4.2\clock-0.7.2-ErKmPTjVISxJnEb
9XKUAOs\HSclock-0.7.2-ErKmPTjVISxJnEb9XKUAOs.o: unknown symbol `___divmoddi4'                        
Shakefile.hs: Shakefile.hs: unable to load package `clock-0.7.2'

Source

import Development.Shake
import Development.Shake.FilePath
import System.Directory as Dir
import System.Info as Info

main :: IO ()
main = do
  let tarball = "dist/mo-0.0.1.tar.gz"
  homeDir <- Dir.getHomeDirectory

  shakeArgs shakeOptions{ shakeFiles="dist" } $ do
    want ["dist/bin/mo" <.> exe]

    "dist/bin/mo" <.> exe %> \out ->
      cmd_ "cabal" "install" "--bindir" "dist/bin"

    phony "hlint" $
      cmd_ "hlint" "."

    phony "lint" $
      need $ case (Info.os, Info.arch) of
        ("mingw32", "i386") -> []
        _ -> ["hlint"]

    phony "unitTest" $
      cmd_ "cabal" "test"

    phony "integrationTest" $ do
      need ["dist/bin/mo" <.> exe]
      cmd_ ("dist/bin/mo" <.> exe) "-t"

    phony "test" $
      need ["unitTest", "integrationTest"]

    phony "install" $
      cmd_ "cabal" "install"

    phony "uninstall" $ do
      cmd_ "ghc-pkg" "unregister" "--force" "mo"
      removeFilesAfter homeDir ["/.cabal/bin/mo" <.> exe]

    phony "build" $
      cmd_ "cabal" "build"

    phony "haddock" $
      cmd_ "cabal" "haddock"

    tarball %> \_ -> do
      need ["build", "haddock"]
      cmd_ "cabal" "sdist"

    phony "sdist" $
      need [tarball]

    phony "publish" $ do
      need ["sdist"]
      cmd_ "cabal" "upload" tarball

    phony "clean" $
      cmd_ "cabal" "clean"
mcandre commented 6 years ago

Closing as duplicate of https://github.com/corsis/clock/issues/50