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

os: implement os.(*File).ReadDir for -target=wasi #3696

Merged
merged 1 commit into from
May 3, 2023

Conversation

achille-roussel
Copy link
Contributor

This PR adds support for reading directories when compiling to programs to WASI.

The implementation uses wasi-libc's DIR type and opendir/readdir/closedir functions.

Please take a look and let me know if you would like to see anything changed.

@deadprogram
Copy link
Member

@deadprogram
Copy link
Member

Paging Dr. @dkegel-fastly

@dkegel-fastly
Copy link
Contributor

Bit jammed but will look at it as soon as I get unjammed...

Copy link
Member

@deadprogram deadprogram left a comment

Choose a reason for hiding this comment

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

Looks good to me after review.

@achille-roussel did you want to squash these commits yourself?

@achille-roussel
Copy link
Contributor Author

Done!

@deadprogram
Copy link
Member

Hmm looks like something went wrong on the squash? Please check CI fails.

@deadprogram
Copy link
Member

Error: /home/runner/lib/tinygo/src/os/file_unix.go:42:11: undefined: dirInfo

@dgryski
Copy link
Member

dgryski commented May 3, 2023

Do we need to adjust the build tags for os/dir_unix.go ?

Signed-off-by: Achille Roussel <achille.roussel@gmail.com>
@achille-roussel
Copy link
Contributor Author

I forgot to add src/os/dir_wasi.go when I squashed the commits 👍

@deadprogram
Copy link
Member

Thank you for getting it all fixed up and thru CI @achille-roussel and to @dgryski for your erstwhile advice.

Now merging, thanks again!

@deadprogram deadprogram merged commit ee3af40 into tinygo-org:dev May 3, 2023
@achille-roussel achille-roussel deleted the wasi-readdir branch May 3, 2023 19:24
@codefromthecrypt
Copy link
Contributor

yay!

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