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

Build fails on Windows. #289

Open
jeffdav opened this issue Oct 2, 2024 · 3 comments
Open

Build fails on Windows. #289

jeffdav opened this issue Oct 2, 2024 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@jeffdav
Copy link

jeffdav commented Oct 2, 2024

Describe the bug

Building on Windows using swift build fails with errors.

Expected Behavior

swift build should build the project on Windows.

Current Behavior

PS C:\Users\jeffd\src\aws-crt-swift> git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean
PS C:\Users\jeffd\src\aws-crt-swift> git pull
Already up to date.
PS C:\Users\jeffd\src\aws-crt-swift> swift build
warning: 'aws-crt-swift': Invalid Exclude 'C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-checksums\source\intel\visualc': File not found.
Building for debugging...
...snip warnings about format specifiers...
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:293:27: error: field has incomplete type 'struct aws_overlapped'
  293 |     struct aws_overlapped signal;
      |                           ^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:293:12: note: forward declaration of 'struct aws_overlapped'
  293 |     struct aws_overlapped signal;
      |            ^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:844:57: error: incomplete definition of type 'struct aws_overlapped'
  844 |     struct socket_connect_args *socket_args = overlapped->user_data;
      |                                               ~~~~~~~~~~^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:293:12: note: forward declaration of 'struct aws_overlapped'
  293 |     struct aws_overlapped signal;
      |            ^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:974:5: error: call to undeclared function 'aws_overlapped_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  974 |     aws_overlapped_init(&socket_impl->read_io_data->signal, s_socket_connection_completion, connect_args);
      |     ^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:990:9: error: call to undeclared function 'aws_overlapped_to_windows_overlapped'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  990 |         aws_overlapped_to_windows_overlapped(&socket_impl->read_io_data->signal));
      |         ^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:1626:43: error: incomplete definition of type 'struct aws_overlapped'
 1626 |     struct aws_socket *socket = overlapped->user_data;
      |                                 ~~~~~~~~~~^
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\windows\iocp\socket.c:293:12: note: forward declaration of 'struct aws_overlapped'
  293 |     struct aws_overlapped signal;
      |            ^
...snip more errors saying basically the same thing...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
[20/227] Compiling AwsCIo source\windows\iocp\socket.c
PS C:\Users\jeffd\src\aws-crt-swift>

Reproduction Steps

  1. Clone the repo.
  2. Run swift build from the repo root.
  3. Observe.

Possible Solution

My initial investigation indicated defining AWS_USE_IO_COMPLETION_PORTS might solve the issue. Indeed, that does allow things to progress further:

PS C:\Users\jeffd\src\aws-crt-swift> swift build -Xcc -DAWS_USE_IO_COMPLETION_PORTS
warning: 'aws-crt-swift': Invalid Exclude 'C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-checksums\source\intel\visualc': File not found.
Building for debugging...
...snip format specifier warnings...
C:\Users\jeffd\src\aws-crt-swift\aws-common-runtime\aws-c-io\source\bsd\kqueue_event_loop.c:22:10: fatal error: 'sys/event.h' file not found
   22 | #include <sys/event.h>
      |          ^~~~~~~~~~~~~
1 error generated.
[40/224] Compiling AwsCIo source\bsd\kqueue_event_loop.c
PS C:\Users\jeffd\src\aws-crt-swift>

This seems like a different problem. Perhaps this shouldn't be built at all on Windows?

Additional Information/Context

No response

aws-crt-swift version used

commit 7b42e03 (HEAD -> main, tag: v0.36.0, origin/main, origin/HEAD)

Compiler and Version used

compnerd.org Swift version 6.0-dev (LLVM a527f49f462b0d7, Swift eef85a7be270421) Target: x86_64-unknown-windows-msvc

Operating System and version

Windows 11 Version 23H2 OS Build 22631.4249

@jeffdav jeffdav added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2024
@jeffdav jeffdav changed the title (short issue description) Build fails on Windows. Oct 2, 2024
@DmitriyMusatkin
Copy link
Contributor

Dont think we currently support windows at all, so this would be a feature request

@jeffdav
Copy link
Author

jeffdav commented Oct 3, 2024

My real goal is to make aws-sdk-swift build on Windows, but I need this to build first.

I spent some time looking at it and put together a draft change that mostly makes it build: #290

See comments in the PR, and let me know what you think.

@waahm7 waahm7 added feature-request A feature should be added or improved. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 3, 2024
@waahm7
Copy link
Contributor

waahm7 commented Oct 3, 2024

Currently, both Aws-crt-swift and Aws-sdk-swift don't support Windows. This is a feature request, and I think we will probably hit more issues than just #290 to properly support Windows and also add CI for it. Swift SDK might have to do some work as well on their side. We have added this to our backlog and will update here as soon as we have any updates.

Please 👍 the original issue and that will help us prioritize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants