Closed ych817 closed 1 year ago
The error you see related to sys/syscall.h
is expected. This file is compiled to see if you're on a system that provides this method of entropy. The test concludes that the method isn't available, which is fine. Thie is what Result of [...]: False
means.
You should never copy random files into your msys installation, since msys uses a package manager to install things.
I would recommend that you uninstall everything related to Haskell, Msys and GHC, and once you have a clean system, use GHCup to install Stack. It would be best to avoid Stack, though.
If I install GHCup, msys (using ghcup) and Stack, and I then use stack repl --package entropy
, it installs the package successfully:
As you can see, I also get these errors, but they don't abort installation. What made your installation abort was related to the calling convention, which is probably related to the GHC version. Be aware that Windows support in GHC was pretty broken before GHC 9.4.1, as you can see here: https://www.haskell.org/ghc/blog/20220807-ghc-9.4.1-released.html
Anyway, I do manage to get the package running on GHC 9.0.2, which is the version that Stack uses by default. But I'd recommend moving to GHC 9.4.1.
If you get the repl running, you can test that the library works by using e.g.
ghci> :m +System.Entropy
ghci> getEntropy 8
"l|\154>\142\192\164I"
Oh It's been long time since I post this issue ... My old computer is broken and I'm now using WSL2 on my new computer as my coding platform , and it works very well . Still appreciate your reply , which provides a huge amount of detail . Thank you .
Greetings !
I got some trouble while building entropy on windows :
It says " sys/random.h : no such file or directory " and " sys/syscall.h : no such file or directory " . So :
I tried to find some libraries on MSYS2 package website and I found nothing .......... therefore I downloaded these 2 files from the internet and move them to
.....\msys64\usr\include\sys\
, but it doesn't work . Would you mind giving me some suggestions ? Thanks .