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

Fix: get wasi versions right #2424

Closed
wants to merge 5 commits into from

Conversation

uuhan
Copy link

@uuhan uuhan commented Jun 16, 2021

Description

The following sample code should have the right wasi_version.

(module
  (type (;0;) (func (param i32 i32 i32 i32) (result i32)))
  (type (;1;) (func (param i32 i32 i32 i32)))
  (import "wasi_snapshot_preview1" "fd_write" (func (;0;) (type 0)))
  (import "env" "abort" (func (;1;) (type 1)))
)

Related Issue: #2226

@uuhan uuhan requested a review from MarkMcCaskey as a code owner June 16, 2021 08:59
@uuhan
Copy link
Author

uuhan commented Jun 17, 2021

OK, I find another related pr #1028 which introduces a strict parameter.

So, what is the expected beheavior? If I have two module named wasi_snapshot_preview1 and env, wasmer complaints wasi_snapshot_preview1 not found.

Quite confusing.

I think, as the function's name shows, get_wasi_versions() should return the supported wasi-version we found in the module. There is no need to have a strict parameter to mix the logic. Give the choice to the caller to decide what to do with the found versions.

@MarkMcCaskey

@uuhan uuhan requested a review from syrusakbary as a code owner June 17, 2021 07:38
@Hywan Hywan added bug Something isn't working 📦 lib-wasi About wasmer-wasi labels Jun 17, 2021
@syrusakbary syrusakbary assigned Amanieu and unassigned MarkMcCaskey Oct 28, 2021
@syrusakbary syrusakbary added the 🕵️ needs investigation The issue/PR needs further investigation label Oct 28, 2021
@jcaesar
Copy link
Contributor

jcaesar commented Jan 12, 2022

uuhan: If you have symbols from both env. and wasi_snapshot_preview1., then that is probably code compiled by a not-that-old version of emscripten (e.g. > 1.39.20, iirc), which mixes its own custom interface with wasi_snapshot_preview1-like calls. Problem with that is: The emscripten env. stuff is not sandboxed, but wasmer implements wasi calls sandboxed.
So to support that kind of emscripten-generated binary, you'd need a non-sandboxed version of wasi, which is an entirely different problem… (right?)

@uuhan uuhan closed this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-wasi About wasmer-wasi 🕵️ needs investigation The issue/PR needs further investigation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants