uutilsをWASI preview 1で試す
code:kore
$ cargo build --release --package uu_rm
これだけでOK
code:rm1
$ target/release/rm --help
Remove (unlink) the FILE(s)
Arguments:
Options:
-f, --force ignore nonexistent files and arguments, never prompt
-i prompt before every removal
-I prompt once before removing more than three files, or when removing recursively.
Less intrusive than -i, while still giving some protection against most mistakes
--interactive=<WHEN> prompt according to WHEN: never, once (-I), or always (-i). Without WHEN, --one-file-system when removing a hierarchy recursively, skip any directory that is on a file
system different from that of the corresponding command line argument (NOT
IMPLEMENTED)
--no-preserve-root do not treat '/' specially
--preserve-root do not remove '/' (default)
-r, --recursive remove directories and their contents recursively aliases: -R -d, --dir remove empty directories
-v, --verbose explain what is being done
-h, --help Print help
-V, --version Print version
動作はした
wasi行けるか〜?
code:error1
errorE0433: failed to resolve: could not find unix in os --> src/uucore/src/lib/features/fs.rs:744:18
|
744 | use std::os::unix::fs::MetadataExt;
| ^^^^ could not find unix in os
|
う〜ん...???
features/fs.rs でいくつかミスってるのでこれは、feature flagを変えたらビルドできるかな?
なんかやってはいるらしい
まだ微妙って言ってる
起こってること
WASI版のFileInformationが実装されてない
いい感じで既存のcrate(nixとか)を使えないっぽい...
the trait bound Stdio: From<OwnedFd> is not satisfied って言われる
理屈の上ではwasiでもできそうだが...