Skip to content
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

0.2.4 fails to build with GHC 8.6.5 on Windows #9

Closed
Minoru opened this issue Apr 26, 2023 · 5 comments · Fixed by #10
Closed

0.2.4 fails to build with GHC 8.6.5 on Windows #9

Minoru opened this issue Apr 26, 2023 · 5 comments · Fixed by #10

Comments

@Minoru
Copy link
Contributor

Minoru commented Apr 26, 2023

Hello! The latest release fails to build with the following error:

 System\EasyFile\Missing.hs:180:10: error:
Error:     Variable not in scope:
      setFilePointerEx :: HANDLE -> Integer -> FilePtrDirection -> IO a0
    |
180 |     _ <- setFilePointerEx hdl (fromIntegral siz) fILE_CURRENT
    |          ^^^^^^^^^^^^^^^^
Error: Process completed with exit code 1.

This is because setFilePointerEx was added in Win32 2.6.2.0 (https://hackage.haskell.org/package/Win32-2.13.2.1/changelog), and GHC versions up to and including 8.10.5 bundle Win32 2.6.1.0. So the latest release can't be built with anything older than 8.10.6, which is quite unfortunate.

Is there any chance this could be fixed?

@kazu-yamamoto
Copy link
Owner

Sorry for your inconvenience.
I admit that I have poor knowledge for Win32 API.
May I ask you to add #ifdef to make setFileSize undefined for GHC 8.10 or earlier on Windows?

@kazu-yamamoto
Copy link
Owner

GHC 8.10.7 is used on CI.
It's unlucky.
Should I add GHC 8.8 to CI?

@kazu-yamamoto
Copy link
Owner

This catches the reported bug nicely.
https://github.com/kazu-yamamoto/easy-file/tree/ci

@Minoru
Copy link
Contributor Author

Minoru commented Apr 27, 2023

I admit that I have poor knowledge for Win32 API.

Same here. I just have Windows in my CI and noticed the breakage.

May I ask you to add #ifdef to make setFileSize undefined for GHC 8.10 or earlier on Windows?

I don't mind sending a PR once your ci branch is merged. You can probably do it yourself just as easily: just wrap the function in #if MIN_VERSION_Win32(2, 6, 2, 0) ... #endif or something like that.

@kazu-yamamoto
Copy link
Owner

The CI work has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants