Stream: git-wasmtime

Topic: wasmtime / PR #2046 Begin porting yanix to WASI


view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 14:51):

sunfishcode opened PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 14:51):

sunfishcode requested kubkon for a review on PR #2046.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 15:22):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 16:45):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 17:13):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 20 2020 at 17:15):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 20:51):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 21:07):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 21:15):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 21:33):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 22:03):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 22:14):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 24 2020 at 22:34):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Jul 28 2020 at 20:11):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 04 2020 at 23:43):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Hmm, why is this cast suddenly needed here?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Ditto.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Out of curiosity, what is l4re?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Do we need to as cast here at all?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Have you verified this is the case on different BSD flavours perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 19:03):

kubkon created PR Review Comment:

Is this loop necessary for actual OSes? I thought that libc::PATH_MAX existed for a reason and the OS would never return a path that is actually longer, or am I missing something here?

On WASI, it makes sense to loop since we AFAIK we don't have the concept of a PATH_MAX since it's so platform-dependent and could actually leak what host we're running on, but I'm not sure this loop is at all necessary on actual OSes. Plus, doesn't it lead to unnecessary allocs which could have been easily handled using static buffers instead like it was prior to this change?

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:48):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:48):

sunfishcode created PR Review Comment:

WASI's RawFd is u32. libc::fdopendir takes a c_int, which is signed i32.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:50):

sunfishcode created PR Review Comment:

As above, RawFd is a u32 on WASI.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:50):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:53):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:53):

sunfishcode created PR Review Comment:

It's a microkernel with L4 ancestry. It's just here because I looked that Rust's libc crate to see which platforms needed this, and it was one of them.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:59):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 21:59):

sunfishcode created PR Review Comment:

Ah, yes. FreeBSD's readdir says:

The function returns NULL upon
reaching the end of the directory or on error. In the event of an error,
errno may be set to any of the values documented for the getdirentries(2)
system call.

The Unix convention for situatuations like this is to set errno to 0 before the call, and check if it's non-zero after the call. POSIX's description of readdir makes this explicit:

Applications wishing to check for error situations should set errno to 0 before calling readdir(). If errno is set to non-zero on return, an error occurred.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 23:06):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 23:07):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 23:07):

sunfishcode created PR Review Comment:

For WASI, I want to avoid PATH_MAX because the actual value of PATH_MAX depends on the underlying host OS, so it's better for WASI code to avoid making size assumptions. But you're right that other platforms don't need this. I've now made this code conditional to restore stack allocation.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2020 at 23:12):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 17 2020 at 14:13):

sunfishcode updated PR #2046 from yanix-wasi to main:

This is a series of patches which begin porting yanix to WASI, and which contain various other fixes needed for using yanix outside of Wasmtime in general.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 30 2020 at 13:30):

sunfishcode closed without merge PR #2046.


Last updated: Nov 22 2024 at 17:03 UTC