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

feat: Add Windows support #200

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

feat: Add Windows support #200

wants to merge 20 commits into from

Conversation

Hywan
Copy link
Contributor

@Hywan Hywan commented Feb 12, 2021

Closes #162.
Closes #69

WIP

@Hywan Hywan added 🎉 enhancement New feature or request 🤖 bot Bip bip 🧪 tests I love tests labels Feb 12, 2021
@Hywan Hywan requested a review from jubianchi February 12, 2021 10:02
@Hywan Hywan self-assigned this Feb 12, 2021
@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

bors bot added a commit that referenced this pull request Feb 12, 2021
@Hywan Hywan mentioned this pull request Feb 12, 2021
@bors
Copy link
Contributor

bors bot commented Feb 12, 2021

try

Build failed:

@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

bors bot added a commit that referenced this pull request Feb 12, 2021
While `open_memstream` is part of POSIX, it's not available on
Windows. So we need to allocate and grow the buffer manually, old
school way.
@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

bors bot added a commit that referenced this pull request Feb 12, 2021
@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

bors bot added a commit that referenced this pull request Feb 12, 2021
@bors
Copy link
Contributor

bors bot commented Feb 12, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

@bors
Copy link
Contributor

bors bot commented Feb 12, 2021

try

Configuration problem:
bors.toml: syntax error

@Hywan
Copy link
Contributor Author

Hywan commented Feb 12, 2021

bors try

@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 25, 2021

bors try

bors bot added a commit that referenced this pull request Feb 25, 2021
@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 25, 2021

bors try

bors bot added a commit that referenced this pull request Feb 25, 2021
@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 25, 2021

bors try

bors bot added a commit that referenced this pull request Feb 25, 2021
@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

@Hywan
Copy link
Contributor Author

Hywan commented Feb 25, 2021

bors try

bors bot added a commit that referenced this pull request Feb 25, 2021
@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

@mattn
Copy link

mattn commented Jul 20, 2021

Any update on this? I'm looking forward this. Thanks.

@mattn
Copy link

mattn commented Jul 20, 2021

Trying to solve my issue with small patch.

diff --git a/wasmer/wasi.go b/wasmer/wasi.go
index 4e03fcd..05aa76b 100644
--- a/wasmer/wasi.go
+++ b/wasmer/wasi.go
@@ -20,6 +20,7 @@ package wasmer
 //     FILE *memory_stream;
 //     size_t buffer_size = 0;
 //
+// #ifndef _WIN32
 //     memory_stream = open_memstream(buffer, &buffer_size);
 //
 //     if (NULL == memory_stream) {
@@ -39,6 +40,20 @@ package wasmer
 //     } while (WASI_ENV_READER_BUFFER_SIZE == data_read_size);
 //
 //     fclose(memory_stream);
+// #else
+//     char temp_buffer[WASI_ENV_READER_BUFFER_SIZE] = { 0 };
+//     size_t data_read_size = WASI_ENV_READER_BUFFER_SIZE;
+//
+//     do {
+//         data_read_size = reader(wasi_env, temp_buffer, WASI_ENV_READER_BUFFER_SIZE);
+//
+//         if (data_read_size > 0) {
+//             buffer_size += data_read_size;
+//             memcpy(*buffer, temp_buffer, data_read_size);
+//             *buffer += data_read_size;
+//         }
+//     } while (WASI_ENV_READER_BUFFER_SIZE == data_read_size);
+// #endif
 //
 //     return buffer_size;
 // }

@Hywan
Copy link
Contributor Author

Hywan commented Aug 12, 2021

The problem seems deeper than I initially though. I've bought a Windows machine and I need to finish the setup so that I can test more easily. Any help is welcomed :-).

@dosgo
Copy link

dosgo commented Sep 23, 2021

Is it available now?I failed to compile

@dosgo
Copy link

dosgo commented Sep 23, 2021

image
Need to use msvc compiler?

@nigzht
Copy link

nigzht commented Apr 15, 2022

image Need to use msvc compiler?

I get this error aswell and cannot figure out for the life of me how to get it working. Were you able to fix this?

@nigzht
Copy link

nigzht commented Apr 15, 2022

I'd like to take over this feature and get it implemented since my project really needs windows support. @Hywan can you give me a summary on what needs to happen here to get this done?

@Baiyuetribe
Copy link

Still not working properly
image

@clarkmcc
Copy link

clarkmcc commented Jun 1, 2022

Any updates on this by chance?

@zandercodes
Copy link

What´s happen?

@boli2017
Copy link

boli2017 commented Apr 3, 2023

to

I got the same err on windows, so is there any solution?

@clarkmcc
Copy link

clarkmcc commented Apr 3, 2023

@boli2017 I haven't seen any progress towards a solution so I switched to wazero which is a native Go runtime, so it works cross-platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 bot Bip bip 🎉 enhancement New feature or request 🧪 tests I love tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows support?
8 participants