Wasi_snapshot_preview1 equivalent?

Greetings folks,

Perhaps you have seen my earlier post here about getting rails running on ICP.

Well according to the output of wasi2ic, the first set of imports I need to replace all come from a single component called wasi_snapshot_preview1 which can be found here

Would I be lucky enough to learn that IC has an equivalent module (complete or under development) that also provides these target specific low-level filesystem, etc calls?

Here is a list of functions that it provides.

Module imports:
import “wasi_snapshot_preview1” “args_get”
import “wasi_snapshot_preview1” “args_sizes_get”
import “wasi_snapshot_preview1” “environ_get”
import “wasi_snapshot_preview1” “environ_sizes_get”
import “wasi_snapshot_preview1” “clock_res_get”
import “wasi_snapshot_preview1” “clock_time_get”
import “wasi_snapshot_preview1” “fd_advise”
import “wasi_snapshot_preview1” “fd_close”
import “wasi_snapshot_preview1” “fd_datasync”
import “wasi_snapshot_preview1” “fd_fdstat_get”
import “wasi_snapshot_preview1” “fd_fdstat_set_flags”
import “wasi_snapshot_preview1” “fd_filestat_get”
import “wasi_snapshot_preview1” “fd_filestat_set_size”
import “wasi_snapshot_preview1” “fd_pread”
import “wasi_snapshot_preview1” “fd_prestat_get”
import “wasi_snapshot_preview1” “fd_prestat_dir_name”
import “wasi_snapshot_preview1” “fd_pwrite”
import “wasi_snapshot_preview1” “fd_read”
import “wasi_snapshot_preview1” “fd_readdir”
import “wasi_snapshot_preview1” “fd_renumber”
import “wasi_snapshot_preview1” “fd_seek”
import “wasi_snapshot_preview1” “fd_sync”
import “wasi_snapshot_preview1” “fd_tell”
import “wasi_snapshot_preview1” “fd_write”
import “wasi_snapshot_preview1” “path_create_directory”
import “wasi_snapshot_preview1” “path_filestat_get”
import “wasi_snapshot_preview1” “path_filestat_set_times”
import “wasi_snapshot_preview1” “path_link”
import “wasi_snapshot_preview1” “path_open”
import “wasi_snapshot_preview1” “path_readlink”
import “wasi_snapshot_preview1” “path_remove_directory”
import “wasi_snapshot_preview1” “path_rename”
import “wasi_snapshot_preview1” “path_symlink”
import “wasi_snapshot_preview1” “path_unlink_file”
import “wasi_snapshot_preview1” “poll_oneoff”
import “wasi_snapshot_preview1” “proc_exit”
import “wasi_snapshot_preview1” “random_get”
Error: There are imports remaining that are not compatible with the Internet Computer.

Cheers

As I mentioned in the other thread, the IC does not natively support these system calls. However, there is a community project that translates some of these to syscalls that the IC does support:

You can see there which syscalls are supported. If your program needs to make syscalls that are unsupported (like socket stuff), it won’t run on the IC. But if you can avoid them, there is a good chance you can make this work.

You might have to compile this Rust library to an object file (.so) and link it with your binary.

Also if you keep the topic in a single thread it will be easier for me to see your questions.