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

preopen current dir #5150

Open
giteewif opened this issue Oct 17, 2024 · 1 comment
Open

preopen current dir #5150

giteewif opened this issue Oct 17, 2024 · 1 comment
Assignees
Labels
priority-medium Medium priority issue ❓ question I've a question!
Milestone

Comments

@giteewif
Copy link

giteewif commented Oct 17, 2024

Summary

could not preopen dir in host

Additional details

Code using wasmer 4.4.0

    let mut wasienv = WasiEnv::builder("hello")
        .stdout(Box::new(stdout_tx))
        .map_dir(".", current_dir)?;
    wasienv.run_with_store(module, &mut store)?;

when execute, there is a error like this

error: Init(WasiFsCreationError("Could not get metadata for file \" file_name\"": entry not found  

I guess that the problem is related to the host_fs,so i add hostfs in code, and it work, it seems that default hostfs of wasmer-wasix not work?

    let runtime = tokio::runtime::Runtime::new().unwrap();
    let guard =runtime.enter();

    let wasienv = WasiEnv::builder("hello")
        .fs( Box::new(virtual_fs::host_fs::FileSystem::new(Handle::current(), "/").unwrap()))
        .stdout(Box::new(stdout_tx))
        .map_dir(".", current_dir)?;
@giteewif giteewif added the ❓ question I've a question! label Oct 17, 2024
@giteewif giteewif changed the title preopen current file preopen current dir Oct 17, 2024
@syrusakbary
Copy link
Member

Thanks for reporting, we'll investigate

@syrusakbary syrusakbary added the priority-medium Medium priority issue label Oct 24, 2024
@syrusakbary syrusakbary added this to the v5.0 milestone Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-medium Medium priority issue ❓ question I've a question!
Projects
None yet
Development

No branches or pull requests

3 participants