-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix windows build. #739
base: main
Are you sure you want to change the base?
Fix windows build. #739
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! Hopefully the error is something that can be figured out. If I google for it plus GHC, I find a number of results, including an open bug in GHC's issue tracker (23194) -- I don't know if maybe an older GHC version would avoid the error?
#endif | ||
#include <cstdint> | ||
#include <realtimeapiset.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import breaks the Ubuntu builds:
time_mem.h:37:10: fatal error: realtimeapiset.h: No such file or directory
Hopefully it's a simple fix, like just moving it into the Windows arm of the if-defs.
The STP code in this repo is an old snapshot. STP is now available on GitHub and a new release was recently tagged; so we could delete the snapshot and instead checkout the STP repo as a submodule. If the newer STP builds for Windows, then that might be a better approach than trying to patch the old snapshot. However, that effort doesn't need to hold up this PR -- note that the BSC build has an option STP_STUB
which can used to avoid building STP, if necessary.
getEnvDefault :: String -> String -> IO String | ||
getEnvDefault var def = do | ||
value <- lookupEnv var | ||
return $ maybe def id value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI has a code-cleanliness check that is failing, because this line has trailing whitespace that should be removed
I found a fix to that issue, but it requires the language extension CApiFFI and ConstPtr, which requires GHC 9.8.* / base-4.18: I replaced ccall with capi and the error is gone. It seems that the usage of ccall is discouraged anyway. |
I finally managed to compile bsv.exe on Windows via MSYS2-ucrt64 (Mingw).
Most changes are related to the make system:
rm -f
does not work for folders the-r
(recursive option must be added)/tmp
dir does not exist on Windows, instead, a local temp folder is created*.a
(static) and*.dll.a
(dyn symbols) +*.dll
(dyn impl) files, but.dll
(both) and.lib
(static) are also supported and are more common..so
files aren't created.:
(e.g.C:\
), therefore a regex just for:
will split those pathsChanges to the Haskell code:
DISCLAIMER: I have zero knowledge about Haskell and utilized ChatGPT. Therefore, please briefly review or rewrite this part for me.
Changes to C++:
Now I am stuck with some errors running ghc in the build process:
Sometimes on a clean build I get this: