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

wasi: non-blocking i/o on files on *nix #1502

Merged
merged 1 commit into from
Jun 2, 2023
Merged

Conversation

evacchi
Copy link
Contributor

@evacchi evacchi commented Jun 2, 2023

Addresses #1500.

We enable non-blocking I/O on files (including FIFOs); this allows nonblock_test.go to run to completion. I am pushing here a simpler test in C, but I have tested the one in the Go tree separately. We can work at adding the same test if we want.

This is not supported on Windows (yet?) because

  1. no Mkfifo means we have to rethink the test ;)
  2. syscall.SetNonblock() on Windows has the following implementation :D
func SetNonblock(fd Handle, nonblocking bool) (err error) {
	return nil
}

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Copy link
Collaborator

@achille-roussel achille-roussel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

@codefromthecrypt codefromthecrypt merged commit f2d8461 into main Jun 2, 2023
@codefromthecrypt codefromthecrypt deleted the nonblockingio branch June 2, 2023 23:33
@codefromthecrypt
Copy link
Contributor

thanks @evacchi for another epic evening. When you have a chance, add to #1500 something like:

update: blah blah works
next step: copy paste notes for windows

that way it is easier to see well, what's next in the original thingy, as I'll link to it in the next release notes

@mathetake
Copy link
Member

imports/wasi_snapshot_preview1/example/testdata/zig-cc/cat.wasm why in this example only the binary has been changed while the source left intact?

@codefromthecrypt
Copy link
Contributor

good eye. I should have caught this. as I've noticed folks are sometimes building wasm manually or with different versions I would suggest us all look carefully and ask each other.

  1. if you meant to re-build, did you use the make targets like our examples workflow?
  2. if you meant to re-build, did you verify the version of the toolchain is same as our examples workflow?

@evacchi
Copy link
Contributor Author

evacchi commented Jun 3, 2023

My bad. I rebuilt using make, without checking the version was aligned and committed all by mistake 🙏

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.

5 participants