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

Windows: Fix build error incompatible pointer types #81

Conversation

daipom
Copy link
Contributor

@daipom daipom commented May 13, 2024

On GitHub workflows, building the native extensions for cool.io fails as follows:

../libev/ev.c: In function 'evpipe_write':
../libev/ev.c:2484:19: error: assignment to 'char *' from incompatible pointer
type 'WSABUF *' [-Wincompatible-pointer-types]
 2484 |           buf.buf = &buf;
      |                   ^

I have tested this by enabling Windows CI on my fork.
You can see this error occurs on Windows:

In addition, I have made the test repository that depends on cool.io.
You can check this error here too:

About this fix

The type of buf member of WSABUF is char *:

On libev upstream, this was already fixed on v4.25:

http://cvs.schmorp.de/libev/ev.c?r1=1.484&r2=1.485&pathrev=rel-4_25

Maybe we should try to update the overall libev version, but that could be difficult.
This PR intends to fix this error first.

Types of Changes

  • Bug fix.

Contribution

On GitHub workflows, building the native extensions for `cool.io` fails
as follows:

    ../libev/ev.c: In function 'evpipe_write':
    ../libev/ev.c:2484:19: error: assignment to 'char *' from incompatible pointer
    type 'WSABUF *' [-Wincompatible-pointer-types]
     2484 |           buf.buf = &buf;
          |                   ^

* Runner: windows-2022 (20240421.1.0)
* Use `ruby/setup-ruby v1` to set up Ruby
  * https://github.com/actions/setup-ruby
* Dependency: `cool.io` v1.8.0

The type of `buf` member of `WSABUF` is `char *`:

* https://learn.microsoft.com/en-us/windows/win32/api/ws2def/ns-ws2def-wsabuf

On `libev` upstream, this was already fixed on v4.25:

http://cvs.schmorp.de/libev/ev.c?r1=1.484&r2=1.485&pathrev=rel-4_25

Maybe we should try to update the overall `libev` version, but that
could be difficult.
So, this commit intends to fix this error first.
In addition, add `fail-fast: false` to ensure that all jobs are executed.
@daipom
Copy link
Contributor Author

daipom commented May 17, 2024

@ioquatix Could you please see this?

@ioquatix ioquatix merged commit 3537338 into socketry:master May 17, 2024
12 checks passed
@ioquatix ioquatix added this to the v1.8.0 milestone May 17, 2024
@daipom
Copy link
Contributor Author

daipom commented May 17, 2024

Thanks for your review!

@ioquatix
Copy link
Member

I released it in version 1.8.1. Please let me know how you get on.

@daipom daipom deleted the windows-fix-build-error-incompatible-pointer-types branch May 17, 2024 04:17
@daipom
Copy link
Contributor Author

daipom commented May 17, 2024

I released it in version 1.8.1. Please let me know how you get on.

Thanks! Sure!

@ioquatix ioquatix modified the milestones: v1.8.0, v1.8.1 May 17, 2024
@daipom
Copy link
Contributor Author

daipom commented May 17, 2024

@ioquatix I have confirmed this issue is completely resolved!
Thanks so much for your quick response!

@ioquatix
Copy link
Member

Thanks for your pull request and additions to CI.

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 this pull request may close these issues.

None yet

2 participants