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

Ambiguous occurrence `c_WaitForSingleObject' for win32 > 2.10 && <= 2.12 #159

Open
yokodake opened this issue Apr 29, 2021 · 4 comments · May be fixed by #166
Open

Ambiguous occurrence `c_WaitForSingleObject' for win32 > 2.10 && <= 2.12 #159

yokodake opened this issue Apr 29, 2021 · 4 comments · May be fixed by #166

Comments

@yokodake
Copy link

When building haskeline-0.8.1.2 (as a dependency) it fails with the following error:

dist\build\System\Console\Haskeline\Backend\Win32.hs:69:12: error:
    Ambiguous occurrence `c_WaitForSingleObject'
    It could refer to
       either `System.Win32.c_WaitForSingleObject',
              imported from `System.Win32' at System\Console\Haskeline\Backend\Win32.hsc:14:1-80
              (and originally defined in `System.Win32.Event')
           or `System.Console.Haskeline.Backend.Win32.c_WaitForSingleObject',
              defined at dist\build\System\Console\Haskeline\Backend\Win32.hs:51:1
   |
69 |     ret <- c_WaitForSingleObject h waitTime
   |            ^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build haskeline-0.8.1.2 (which is required by

Though I noticed this has already been fixed in win32-2.12.

Since I don't have much experience with maintaining libraries, I'm not sure if simply updating the win32 version bounds to >= 2.0 && < 2.10.1 && >= 2.12 is enough. I would have made a PR otherwise.

@andreasabel
Copy link
Member

Here are some build failures with GHC 9.2:

$ cabal build --constraint='Win32 < 2.12' --constraint='time<1.10'
Resolving dependencies...
Build profile: -w ghc-9.2.1 -O1
In order, the following will be built (use -v for more details):
 - process-1.6.13.2 (lib:process) (requires build)
 - haskeline-0.8.2 (lib) (first run)
 - haskeline-0.8.2 (exe:haskeline-examples-Test) (first run)
(ERROR as in OP)

...
My experiments confirm the ones of @yokodake. Build fails with Win32-2.10/11.

@andreasabel
Copy link
Member

andreasabel commented Nov 13, 2021

c_WaitForSingleObject was introduced in b2b86de (@RyanGlScott 's Christmas present to haskeline of 2015) which has been released in 0.7.2.3 (see 0.7.2.2...0.7.2.3). Thus, I speculate that all versions >= 0.7.2.3 do not work with Win32 2.10/11.
I will make the respective revisions on hackage. E.g.: https://hackage.haskell.org/package/haskeline-0.8.2/revisions/

andreasabel added a commit to andreasabel/haskeline that referenced this issue Nov 13, 2021
haskeline >= 0.7.2.3 fails to build with Win32-2.10/11 because of duplicate definitions:
```
    Ambiguous occurrence `c_WaitForSingleObject'
    It could refer to
       either `System.Win32.c_WaitForSingleObject',
              imported from `System.Win32' at System\Console\Haskeline\Backend\Win32.hsc:14:1-80
              (and originally defined in `System.Win32.Event')
           or `System.Console.Haskeline.Backend.Win32.c_WaitForSingleObject',
              defined at dist\build\System\Console\Haskeline\Backend\Win32.hs:51:1
```
@andreasabel andreasabel linked a pull request Nov 13, 2021 that will close this issue
@andreasabel
Copy link
Member

@bgamari: I have fixed this in a PR that has been sitting around for over a year here now, please consider merging.

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