foundation icon indicating copy to clipboard operation
foundation copied to clipboard

Windows: Win32 >= 2.12.0.0 breaks foundation

Open Release-Candidate opened this issue 3 years ago • 5 comments

Win32 changed to explicit exports with version 2.12.0.0 https://github.com/haskell/win32/releases/tag/v2.12.0.0 https://github.com/haskell/win32/commit/fbc49f8bb694a276da49a70166bed1e6a85b9cf4#diff-3c294c5dd8b170586cad01c72d6ffd35225608811de64b538677cfde2c0b7d64 which breaks the usage of the C bindings.

Solution

use the exported functions without c_

Error message

> Foundation\Time\StopWatch.hs:73:9: error:
>     * Variable not in scope:
>         c_QueryPerformanceCounter :: Ptr a0 -> IO a1
>     * Perhaps you meant `queryPerformanceCounter' (imported from System.Win32.Time)
>    |
> 73 |         c_QueryPerformanceCounter (castPtr p `ptrPlus` 8)
>    |         ^^^^^^^^^^^^^^^^^^^^^^^^^
>

Release-Candidate avatar Jan 14 '22 12:01 Release-Candidate

Which versions of foundation are affected by this issue? All of them?

The affected versions should apparently be revised with an upper bound Win32 < 2.12 then.

If none of the foundation maintainers address this, you can ask the Hackage trustees to do it: https://github.com/haskell-infra/hackage-trustees/blob/master/CONTRIBUTING.md.

sjakobi avatar Jan 14 '22 12:01 sjakobi

I only tested with the last (0.0.26.1), but I guess it's all of them.

Great, thanks. I'm just working on a fix/pull request.

Release-Candidate avatar Jan 14 '22 12:01 Release-Candidate

I only tested with the last (0.0.26.1), but I guess it's all of them.

Actually I can't find c_QueryPerformanceCounter being used in foundation < 0.0.10. But v0.0.10 and up should probably get an upper bound on Win32.

sjakobi avatar Jan 14 '22 12:01 sjakobi

If none of the foundation maintainers address this, you can ask the Hackage trustees to do it: https://github.com/haskell-infra/hackage-trustees/blob/master/CONTRIBUTING.md.

See https://github.com/haskell-infra/hackage-trustees/issues/330

Release-Candidate avatar Jan 21 '22 12:01 Release-Candidate

As a Hackage trustee, I have revised foundation-0.0.10 and up as requested in https://github.com/haskell-infra/hackage-trustees/issues/330. See e.g. https://hackage.haskell.org/package/foundation-0.0.10/revisions/.

sjakobi avatar Jan 22 '22 17:01 sjakobi