2019-05-24 22:52:07 -04:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2019-02-08 18:18:47 -05:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2019-05-27 12:16:32 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2019-05-27 01:35:58 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2019-05-04 15:16:39 -04:00
|
|
|
|
2018-10-11 19:02:59 +13:00
|
|
|
|
2020-10-11 14:18:19 -05:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2020-10-11 14:18:19 -05:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2020-10-11 14:18:19 -05:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2019-05-27 12:16:32 -04:00
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2019-05-27 12:16:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
Add/fix missing WASI functionality to pass libstd tests
This rather large commit adds/fixes missing WASI functionality
in `libstd` needed to pass the `libstd` tests. As such, now by
default tests targeting `wasm32-wasi` target are enabled in
`test/tests.zig` module. However, they can be disabled by passing
the `-Dskip-wasi=true` flag when invoking the `zig build test`
command. When the flag is set to `false`, i.e., when WASI tests are
included, `wasmtime` with `--dir=.` is used as the default testing
command.
Since the majority of `libstd` tests were relying on `fs.cwd()`
call to get current working directory handle wrapped in `Dir`
struct, in order to make the tests WASI-friendly, `fs.cwd()`
call was replaced with `testing.getTestDir()` function which
resolved to either `fs.cwd()` for non-WASI targets, or tries to
fetch the preopen list from the WASI runtime and extract a
preopen for '.' path.
The summary of changes introduced by this commit:
* implement `Dir.makeDir` and `Dir.openDir` targeting WASI
* implement `Dir.deleteFile` and `Dir.deleteDir` targeting WASI
* fix `os.close` and map errors in `unlinkat`
* move WASI-specific `mkdirat` and `unlinkat` from `std.fs.wasi`
to `std.os` module
* implement `lseek_{SET, CUR, END}` targeting WASI
* implement `futimens` targeting WASI
* implement `ftruncate` targeting WASI
* implement `readv`, `writev`, `pread{v}`, `pwrite{v}` targeting WASI
* make sure ANSI escape codes are _not_ used in stderr or stdout
in WASI, as WASI always sanitizes stderr, and sanitizes stdout if
fd is a TTY
* fix specifying WASI rights when opening/creating files/dirs
* tweak `AtomicFile` to be WASI-compatible
* implement `os.renameatWasi` for WASI-compliant `os.renameat` function
* implement sleep() targeting WASI
* fix `process.getEnvMap` targeting WASI
2020-05-05 17:23:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
Add/fix missing WASI functionality to pass libstd tests
This rather large commit adds/fixes missing WASI functionality
in `libstd` needed to pass the `libstd` tests. As such, now by
default tests targeting `wasm32-wasi` target are enabled in
`test/tests.zig` module. However, they can be disabled by passing
the `-Dskip-wasi=true` flag when invoking the `zig build test`
command. When the flag is set to `false`, i.e., when WASI tests are
included, `wasmtime` with `--dir=.` is used as the default testing
command.
Since the majority of `libstd` tests were relying on `fs.cwd()`
call to get current working directory handle wrapped in `Dir`
struct, in order to make the tests WASI-friendly, `fs.cwd()`
call was replaced with `testing.getTestDir()` function which
resolved to either `fs.cwd()` for non-WASI targets, or tries to
fetch the preopen list from the WASI runtime and extract a
preopen for '.' path.
The summary of changes introduced by this commit:
* implement `Dir.makeDir` and `Dir.openDir` targeting WASI
* implement `Dir.deleteFile` and `Dir.deleteDir` targeting WASI
* fix `os.close` and map errors in `unlinkat`
* move WASI-specific `mkdirat` and `unlinkat` from `std.fs.wasi`
to `std.os` module
* implement `lseek_{SET, CUR, END}` targeting WASI
* implement `futimens` targeting WASI
* implement `ftruncate` targeting WASI
* implement `readv`, `writev`, `pread{v}`, `pwrite{v}` targeting WASI
* make sure ANSI escape codes are _not_ used in stderr or stdout
in WASI, as WASI always sanitizes stderr, and sanitizes stdout if
fd is a TTY
* fix specifying WASI rights when opening/creating files/dirs
* tweak `AtomicFile` to be WASI-compatible
* implement `os.renameatWasi` for WASI-compliant `os.renameat` function
* implement sleep() targeting WASI
* fix `process.getEnvMap` targeting WASI
2020-05-05 17:23:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-18 17:06:02 +02:00
|
|
|
|
|
|
|
|
|
Add/fix missing WASI functionality to pass libstd tests
This rather large commit adds/fixes missing WASI functionality
in `libstd` needed to pass the `libstd` tests. As such, now by
default tests targeting `wasm32-wasi` target are enabled in
`test/tests.zig` module. However, they can be disabled by passing
the `-Dskip-wasi=true` flag when invoking the `zig build test`
command. When the flag is set to `false`, i.e., when WASI tests are
included, `wasmtime` with `--dir=.` is used as the default testing
command.
Since the majority of `libstd` tests were relying on `fs.cwd()`
call to get current working directory handle wrapped in `Dir`
struct, in order to make the tests WASI-friendly, `fs.cwd()`
call was replaced with `testing.getTestDir()` function which
resolved to either `fs.cwd()` for non-WASI targets, or tries to
fetch the preopen list from the WASI runtime and extract a
preopen for '.' path.
The summary of changes introduced by this commit:
* implement `Dir.makeDir` and `Dir.openDir` targeting WASI
* implement `Dir.deleteFile` and `Dir.deleteDir` targeting WASI
* fix `os.close` and map errors in `unlinkat`
* move WASI-specific `mkdirat` and `unlinkat` from `std.fs.wasi`
to `std.os` module
* implement `lseek_{SET, CUR, END}` targeting WASI
* implement `futimens` targeting WASI
* implement `ftruncate` targeting WASI
* implement `readv`, `writev`, `pread{v}`, `pwrite{v}` targeting WASI
* make sure ANSI escape codes are _not_ used in stderr or stdout
in WASI, as WASI always sanitizes stderr, and sanitizes stdout if
fd is a TTY
* fix specifying WASI rights when opening/creating files/dirs
* tweak `AtomicFile` to be WASI-compatible
* implement `os.renameatWasi` for WASI-compliant `os.renameat` function
* implement sleep() targeting WASI
* fix `process.getEnvMap` targeting WASI
2020-05-05 17:23:49 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-01 19:42:17 +01:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
|
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-30 20:44:22 -06:00
|
|
|
|
|
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
2019-11-06 23:25:57 -05:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-04-30 20:44:22 -06:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-11 19:02:59 +13:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2022-04-05 17:08:33 +02:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-05-31 10:56:59 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2018-05-31 10:56:59 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2022-04-05 17:08:33 +02:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2020-02-24 00:25:52 +01:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
|
|
|
|
|
2022-02-24 17:51:44 -06:00
|
|
|
|
2018-05-30 13:38:41 -05:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2018-10-11 19:02:59 +13:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2021-05-04 20:47:26 +03:00
|
|
|
|
2021-04-07 05:25:59 -04:00
|
|
|
|
|
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2021-05-04 20:47:26 +03:00
|
|
|
|
2018-05-28 20:23:55 -04:00
|
|
|
|
2018-04-18 13:52:25 -05:00
|
|
|
|
2021-05-04 20:47:26 +03:00
|
|
|
|
2018-04-22 18:11:50 -04:00
|
|
|
|
2021-09-14 10:02:23 -06:00
|
|
|
|
|
|
|
|
|
2022-01-07 00:06:06 -05:00
|
|
|
|
2021-09-14 10:02:23 -06:00
|
|
|
|