Stream: wasi

Topic: Path format?


view this post on Zulip Bastian Müller (Dec 30 2022 at 19:59):

This might be documented somewhere, but I just cannot find anything related to this:
Are paths in WASI Unix-style paths (/ separator) per spec, or does the spec make no statement about the format? Do WASI binaries usually just assume Unix-style paths?
I'm currently adding support for Windows to a runtime and am wondering if the WASI implementation needs path translation between module and host.

view this post on Zulip Dan Gohman (Dec 30 2022 at 20:15):

The path separator should be / and there should be no drive letters etc visible. WASI programs aren't supposed to make assumptions about the existence of any files and directories other than what's passed to them as command-line arguments or env vars (though in practice many people don't care about windows and do it anyway).

view this post on Zulip Dan Gohman (Dec 30 2022 at 20:19):

I am working to make WASI programs more portable, but it remains to be seen how much I'll be able to achieve vs all the people who don't care about anything other than "faster docker".

view this post on Zulip Bastian Müller (Dec 30 2022 at 20:22):

Same here, I'm mostly interested in the portability aspect of WebAssembly/WASI.

In case it might not have been yet, it would be good to document the path separator assumption, because it is needed when implementing some of the WASI functions which resolve paths given the preopen.

view this post on Zulip Dan Gohman (Dec 30 2022 at 20:26):

Yeah. I looked into it a while ago but got bogged down by thinking about case sensitivity and Unicode normalization and ill-formed Unicode and Windows prohibited paths and special whitespace rules and wow. But you're right, it'd be good to document the things we can control better.

view this post on Zulip Dan Gohman (Dec 30 2022 at 20:27):

The wasi-testsuite repo can be a good place for developing these ideas too.

view this post on Zulip Bastian Müller (Dec 30 2022 at 20:40):

Right, there are more details to specify, but even just something simple as https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_266 might be sufficient to clarify what the modules and runtime should do when joining path components.

Thank you for your quick response, that unblocks me and I can spend the rest of the holidays finishing Windows support and maybe even look into support for Mac OS (<10), which uses : as a separator, haha

view this post on Zulip Ralph (Jan 03 2023 at 13:57):

Dan Gohman said:

I am working to make WASI programs more portable, but it remains to be seen how much I'll be able to achieve vs all the people who don't care about anything other than "faster docker".

and for me, I want the most portable version of wasi we can make. I do NOT want an entire environment (unless I choose it!); future computing must be constrained to be more generally useful -- not bring along the entire pile of cruft from the past 50 years. Again, unless you ask nicely to do so. :-)

view this post on Zulip Dan Gohman (Jan 04 2023 at 12:44):

Just like how you have the choice to not use k8s, but while you don't necessarily like it, and you might not have built it that way yourself, you've got it, you use it, and so does everybody else? :smirk:

view this post on Zulip Ralph (Jan 05 2023 at 15:56):

Dan Gohman said:

Just like how you have the choice to not use k8s, but while you don't necessarily like it, and you might not have built it that way yourself, you've got it, you use it, and so does everybody else? :smirk:

sorta. Why do you ask? :-)


Last updated: Nov 22 2024 at 16:03 UTC