-
Notifications
You must be signed in to change notification settings - Fork 11
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
example/fd compile error on windows: std.posix.fd_t is of type windows.HANDLE *anyopaque on windows instead of i32 on linux. #16
Comments
Hi @0x546F6D, I'll take a look at this tomorrow morning but which version are you currently using? Is this on |
I am sorry, I did not pay careful attention to the installation instruction and did zig fetch #main instead of #v0.2.0. The '*anyopaque'/'comptime_int' issue for fd still remains in v0.2.0:
|
Hi!
Feel free to try out the |
Hi Mookums, thanks a lot for the fast reply. I pulled the latest commits up to 2f9808b and here are my observations:
But that's probably to be expected, so I just commented the corresponding add_example line in build.zig. |
No problem! I'm glad you submitted an issue, helps me get around to looking at different parts. I didn't know that that weird issue was still there BUT it should now be fixed! (07fbe2c). This happened because we were writing into an invalid buffer (that we cleared) instead of requesting a new write area from the zero-copy buffer. I also added a compilation flag for the Unix example so it won't get built on Windows. (64c1a90) 😃 |
Everything seems fine now with the latest version, congrats :)
|
|
Not sure what is the workaround here since fd is then compared to -1 on src\http\router.zig:70
On a side note, what is the current status of zzz for windows?
I have tried the other examples and, as reported previously, the cpu usage is indeed very high, and the example executables like benchmark, stop responding after a minute on my machine. Furthermore, except for the basic executable, none of the other executables seem to respond properly on this windows 11 machine with neither firefox nor chrome.
Taking the benchmark executable for example. After starting it, clicking on "click here to go to hi", or writing directly in the address bar 'http://localhost:9862/hi/user' does update the location in the address bar of the browser, but most of the time, it only refreshes the home page, as can be seen in the debug logs:
Switching back and forth between 'localhost' and '127.0.0.1' in the address bar can help you go to the other page. However, if you do succeed to land on 'http://localhost:9862/hi/user', then benchmark sometimes gets stuck on displaying the 'user' name even after submitting another one (like 'qwerty'), or after changing it directly in the address bar to 'http://localhost:9862/hi/qwerty'. Setting std_option.log_level to .debug shows that it always default to 'GET /hi/user' no matter what I submit or write in the address bar.
Same thing happens when clicking on 'click to go home!': the location in the address bar changes back to 'http://127.0.0.1:9862', but the browser still displays the '/hi/user' page unless you switch back to 'localhost' instead of '127.0.0.1'.
The text was updated successfully, but these errors were encountered: