2021-10-14 21:17:30 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-12-02 15:02:17 -05:00
|
|
|
|
2019-03-02 16:46:04 -05:00
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-25 17:39:30 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-11 10:16:13 -04:00
|
|
|
|
2022-03-13 17:03:04 +01:00
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
2019-10-23 01:06:35 +03:00
|
|
|
|
2021-10-11 18:10:12 -04:00
|
|
|
|
2019-03-02 16:46:04 -05:00
|
|
|
|
2019-04-13 15:15:39 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2022-03-14 20:41:28 +01:00
|
|
|
|
2018-12-23 22:44:02 -05:00
|
|
|
|
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
`@import("std").builtin`. The target-related types are moved
to `std.Target`. This allows the data types to have methods, such as
`std.Target.current.isDarwin()`.
* `std.os.windows.subsystem` is moved to
`std.Target.current.subsystem`.
* Remove the concept of the panic package from the compiler
implementation. Instead, `std.builtin.panic` is always the panic
function. It checks for `@hasDecl(@import("root"), "panic")`,
or else provides a default implementation.
This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 18:43:24 -04:00
|
|
|
|
2021-06-14 11:33:27 -07:00
|
|
|
|
2019-10-24 00:30:17 -04:00
|
|
|
|
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
`@import("std").builtin`. The target-related types are moved
to `std.Target`. This allows the data types to have methods, such as
`std.Target.current.isDarwin()`.
* `std.os.windows.subsystem` is moved to
`std.Target.current.subsystem`.
* Remove the concept of the panic package from the compiler
implementation. Instead, `std.builtin.panic` is always the panic
function. It checks for `@hasDecl(@import("root"), "panic")`,
or else provides a default implementation.
This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 18:43:24 -04:00
|
|
|
|
2021-01-22 15:45:28 +01:00
|
|
|
|
2022-03-13 17:03:04 +01:00
|
|
|
|
2019-10-24 00:30:17 -04:00
|
|
|
|
2022-10-30 19:08:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-24 00:30:17 -04:00
|
|
|
|
|
|
|
|
|
2022-03-14 20:41:28 +01:00
|
|
|
|
2019-10-24 00:30:17 -04:00
|
|
|
|
|
|
|
|
|
move types from builtin to std
* All the data types from `@import("builtin")` are moved to
`@import("std").builtin`. The target-related types are moved
to `std.Target`. This allows the data types to have methods, such as
`std.Target.current.isDarwin()`.
* `std.os.windows.subsystem` is moved to
`std.Target.current.subsystem`.
* Remove the concept of the panic package from the compiler
implementation. Instead, `std.builtin.panic` is always the panic
function. It checks for `@hasDecl(@import("root"), "panic")`,
or else provides a default implementation.
This is an important step for multibuilds (#3028). Without this change,
the types inside the builtin namespace look like different types, when
trying to merge builds with different target settings. With this change,
Zig can figure out that, e.g., `std.builtin.Os` (the enum type) from one
compilation and `std.builtin.Os` from another compilation are the same
type, even if the target OS value differs.
2019-10-23 18:43:24 -04:00
|
|
|
|
|
|
|
|
|
2019-12-02 15:02:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 17:39:30 -07:00
|
|
|
|
2019-12-02 15:02:17 -05:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-19 00:53:24 -04:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2019-05-20 01:15:23 -04:00
|
|
|
|
2016-09-12 01:01:06 -03:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-31 18:24:59 -07:00
|
|
|
|
2021-08-31 17:02:35 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-31 18:24:59 -07:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2022-02-11 15:28:36 +01:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2022-05-14 14:16:19 +02:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:05:29 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:05:29 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-09-11 19:03:14 +09:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-23 11:04:13 +01:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2021-08-30 22:02:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 19:36:09 -04:00
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
|
|
|
|
|
2019-11-24 21:12:01 -05:00
|
|
|
|
2017-04-02 19:14:23 -04:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2022-01-30 13:22:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-03 04:58:19 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
2019-05-27 14:41:13 -04: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-27 14:41:13 -04:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2019-05-27 14:41:13 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-27 14:41:13 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-15 21:20:41 -04:00
|
|
|
|
2021-11-05 15:19:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-15 13:05:16 +03:00
|
|
|
|
2021-11-05 15:19:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-15 13:05:16 +03:00
|
|
|
|
2021-11-05 15:19:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-27 22:25:48 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 13:37:34 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2019-08-05 17:21:12 +01:00
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-05 19:39:04 +01:00
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-05 19:39:04 +01:00
|
|
|
|
|
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
2019-08-05 17:21:12 +01:00
|
|
|
|
|
|
|
|
|
2019-08-20 15:25:30 -04:00
|
|
|
|
2019-08-05 17:21:12 +01:00
|
|
|
|
2020-10-18 16:28:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-10-18 16:28:11 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-08-02 13:19:49 +01:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-08-03 07:50:30 +01:00
|
|
|
|
2019-08-02 13:19:49 +01:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
2020-05-01 23:17:15 -04:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-01-05 20:57:18 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-07-05 12:53:36 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
|
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2019-12-12 01:31:32 +00:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2019-12-12 01:31:32 +00:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
|
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-08-11 10:56:21 +02:00
|
|
|
|
2022-08-11 11:04:26 +02:00
|
|
|
|
|
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
|
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2019-07-05 12:53:36 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-07-28 23:51:51 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-12-12 01:31:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-07 14:31:15 +02:00
|
|
|
|
2022-10-15 10:50:02 -07:00
|
|
|
|
2022-10-07 14:31:15 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-12-12 01:31:32 +00:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2022-10-07 14:31:15 +02:00
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2021-08-24 17:21:53 -07:00
|
|
|
|
2019-12-22 12:09:21 +11:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2019-12-22 12:09:21 +11:00
|
|
|
|
2019-12-22 12:23:28 +11:00
|
|
|
|
|
|
|
|
|
2019-12-22 12:09:21 +11:00
|
|
|
|
|
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
2019-12-22 12:09:21 +11:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-07-28 23:51:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-10 00:56:47 +01:00
|
|
|
|
2019-07-28 23:51:51 +02:00
|
|
|
|
|
|
|
|
|
2020-03-10 00:56:47 +01:00
|
|
|
|
2019-07-28 23:51:51 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-04 14:39:59 -05:00
|
|
|
|
2020-05-04 00:42:12 -06:00
|
|
|
|
2020-06-28 17:38:24 -03:00
|
|
|
|
2019-09-10 00:25:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 00:13:13 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-13 09:42:00 +02:00
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-05-01 23:17:15 -04:00
|
|
|
|
2017-04-17 19:08:41 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-10 20:55:13 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-10 20:55:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2019-09-10 00:25:37 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-02 14:08:59 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-05-01 23:17:15 -04:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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-02-06 17:56:40 -05:00
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
2020-03-12 19:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
|
|
|
|
|
2020-03-12 19:40:42 +01:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-12 22:46:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
2020-03-12 22:46:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
2020-03-12 22:46:12 +01:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-03-12 22:46:12 +01:00
|
|
|
|
|
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
2021-10-04 23:47:27 -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
|
|
|
|
2021-08-23 17:06:56 -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-03-11 20:56:43 +01:00
|
|
|
|
|
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
2020-03-12 19:40:42 +01:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-11 20:56:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-12-28 23:00:31 -06:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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-02-06 17:56:40 -05:00
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 15:24:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-05-07 15:24:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-28 17:38:24 -03:00
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
2022-08-10 23:02:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-12 17:26:28 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-13 09:42:00 +02:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-05-01 23:17:15 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05: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-26 13:17:34 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2017-04-21 01:56:12 -04:00
|
|
|
|
|
|
|
|
|
2017-04-19 01:13:15 -04:00
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
2022-02-07 13:11:25 +05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 05:22:53 +10:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-02 14:08:59 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 05:22:53 +10:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-13 09:42:00 +02:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-01 23:17:15 -04:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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-02-06 17:56:40 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 05:22:53 +10:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-12-25 07:48:04 -06:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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-02-06 17:56:40 -05:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 05:22:53 +10:00
|
|
|
|
2021-05-07 15:24:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-05-07 15:24:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-19 00:53:24 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
|
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2019-10-10 20:32:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-04-02 23:39:25 -06:00
|
|
|
|
2020-04-02 22:12:45 -06:00
|
|
|
|
2020-04-02 22:57:02 -06:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-22 23:28:40 +01:00
|
|
|
|
2021-12-03 22:47:50 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-22 23:28:40 +01:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-04-30 21:31:01 +02:00
|
|
|
|
2020-05-02 19:14:46 +01:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 19:14:46 +01:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-02 23:21:55 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-04-05 17:08:33 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-04-05 17:08:33 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
|
|
|
|
|
2021-04-30 21:31:01 +02:00
|
|
|
|
2020-02-06 17:56:40 -05:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
|
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -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-07-19 23:18:20 +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
|
|
|
|
|
|
|
|
|
2020-07-19 23:18:20 +02:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-03 22:47:50 -07:00
|
|
|
|
2019-08-16 21:29:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-07-31 00:54:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-07 22:06:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-07 22:06:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-15 04:19:12 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-22 13:43:48 -05:00
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2020-03-27 14:28:48 -05:00
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
2021-08-06 02:01:47 -07:00
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
2022-09-15 16:00:52 -05:00
|
|
|
|
2020-02-22 13:43:48 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
2022-06-21 03:21:45 -06:00
|
|
|
|
|
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-18 16:43:56 -05:00
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
2019-10-16 15:10:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
|
|
|
|
|
2020-12-26 13:50:26 -07:00
|
|
|
|
2020-02-17 00:58:30 -05:00
|
|
|
|
|
|
|
|
|
2020-12-26 13:50:26 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 17:22:16 +03:00
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
2020-02-22 15:59:13 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
2022-01-15 04:56:32 -08:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-20 01:43:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-15 04:56:32 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-02 15:04:42 -04:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-15 04:56:32 -08:00
|
|
|
|
2020-02-22 17:35:36 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
2022-03-02 23:21:55 -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
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-26 13:17:34 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-19 11:47:00 +02:00
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-07-19 11:47:00 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
|
|
|
|
|
2020-07-19 11:47:00 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-19 11:47:00 +02:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-07-19 11:47:00 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
2020-07-21 20:40:34 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
2020-07-21 20:40:34 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-06-22 09:14:51 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-25 07:23:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-08 02:08:45 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-08-21 16:07:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2018-08-21 16:07:28 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-04-30 21:31:01 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2021-08-25 17:39:30 -07:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-30 15:14:04 -05:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
|
|
|
|
|
2020-06-23 09:59:05 +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
|
|
|
|
2021-08-25 17:39:30 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-10-20 21:48:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
2021-08-25 17:39:30 -07:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
|
|
|
|
|
2020-09-16 20:59:45 -07:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 02:00:39 -04:00
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-03-05 00:57:02 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-03-05 00:57:02 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2018-03-05 00:57:02 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-03-05 00:57:02 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-03-05 00:57:02 -05:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
2019-11-25 00:30:28 -05:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2019-05-27 01:35:58 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
|
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 00:41:19 -04:00
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2022-08-17 13:30:23 +02:00
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
|
|
|
|
|
2020-04-08 08:37:17 -06:00
|
|
|
|
2020-04-08 00:39:17 -06:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
|
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
2020-05-01 19:02:16 -04:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-15 14:46:09 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-17 15:47:09 -07:00
|
|
|
|
zig build system: correctly handle multiple output artifacts
Previously the zig build system incorrectly assumed that the only build
artifact was a binary. Now, when you enable the cache, only the output
dir is printed to stdout, and the zig build system iterates over the
files in that directory, copying them to the output directory.
To support this change:
* Add `std.os.renameat`, `std.os.renameatZ`, and `std.os.renameatW`.
* Fix `std.os.linux.renameat` not compiling due to typos.
* Deprecate `std.fs.updateFile` and `std.fs.updateFileMode`.
* Add `std.fs.Dir.updateFile`, which supports using open directory
handles for both the source and destination paths, as well as an
options parameter which allows overriding the mode.
* Update `std.fs.AtomicFile` to support operating based on an open
directory handle. Instead of `std.fs.AtomicFile.init`, use
`std.fs.Dir.atomicFile`.
* `std.fs.AtomicFile` deinit() better handles the situation when the
rename fails but the temporary file still exists, by still
attempting to remove the temporary file.
* `std.fs.Dir.openFileWindows` is moved to `std.os.windows.OpenFileW`.
* `std.os.RenameError` gains the error codes `NoDevice`,
`SharingViolation`, and `PipeBusy` which have been observed from
Windows.
Closes #4733
2020-03-13 21:06:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-01-15 18:07:08 +10:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -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-01-15 18:07:08 +10:00
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-01-15 18:07:08 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2021-06-19 21:10:22 -04: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-23 17:06:56 -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-06-30 18:18:25 +02:00
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-01-15 18:07:08 +10:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-01-15 18:07:08 +10:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-15 18:07:08 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-20 02:26:36 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-10-17 22:21:48 +03:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2018-10-17 22:21:48 +03:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-02 19:36:49 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-28 03:40:50 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-02 19:36:49 +02:00
|
|
|
|
2020-07-30 22:47:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-08 18:06:45 +00:00
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-11-07 11:55:55 +00:00
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2020-11-08 18:06:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-18 15:28:25 +01:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-11-18 15:28:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-18 15:28:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-03 12:25:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-15 18:11:54 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-13 08:01:01 +02:00
|
|
|
|
|
|
|
|
|
2020-07-15 18:55:07 +02:00
|
|
|
|
|
|
|
|
|
2020-07-14 23:30:05 +02:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2017-04-30 18:56:24 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2022-01-31 16:12:50 +01:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
|
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-31 04:47:55 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-02 19:36:49 +02:00
|
|
|
|
2020-07-12 23:03:09 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
|
|
|
|
|
2020-07-14 23:06:55 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-07-15 18:15:20 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-08 00:14:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
|
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
|
|
|
|
|
2020-06-22 09:40:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-10-21 14:18:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-02-08 00:14:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:22:43 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-09 20:36:06 +02:00
|
|
|
|
2018-04-14 02:12:19 -04:00
|
|
|
|
2020-09-09 20:36:06 +02:00
|
|
|
|
2018-04-14 02:12:19 -04:00
|
|
|
|
2020-09-03 15:08:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-04-14 02:12:19 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:22:43 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:22:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:08:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:08:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:22:43 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:22:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 15:08:37 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 15:54:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
|
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-10-17 21:13:10 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-06-09 19:24:24 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-06 23:25:57 -05:00
|
|
|
|
2020-02-21 19:46:53 +01:00
|
|
|
|
2019-11-29 21:55:27 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-07 01:23:18 -04:00
|
|
|
|
2018-08-21 16:07:28 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-03 10:40:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2018-07-07 01:23:18 -04:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-05-20 12:24:58 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2021-05-20 12:24:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-31 10:07:51 -06:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-04-20 16:34:37 -03:00
|
|
|
|
2020-05-31 10:07:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
2020-05-31 10:07:51 -06:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
|
|
|
|
|
2020-05-03 10:40:07 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2020-05-05 12:50:50 -04:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2018-07-07 01:23:18 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-11-28 00:42:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-05 23:46:08 -03:00
|
|
|
|
2020-11-28 00:42:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-09 14:44:02 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-28 00:42:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-28 00:42:17 -07:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-28 00:42:17 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-01 22:13:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-09-08 12:16:03 +02:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-01 22:13:07 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-08 12:16:03 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-03-16 17:14:00 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-04 02:57:08 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-26 22:00:50 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-03 10:40:07 +02:00
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
|
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 15:14:28 +02:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2019-10-21 23:23:11 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-08 12:15:44 +02:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-28 10:03:23 +01:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std/os, x/os/socket: windows support, socket helpers, getpeername()
Socket I/O methods such as read, readv, write, writev, send, recv,
sendmsg, recvmsg have been generalized to read(buf, flags), write(buf,
flags), readVectorized(vectors, flags), and writeVectorized(vectors,
flags). There is still some work left to be done abstracting both
readVectorized and writeVectorized properly across platforms, which is
work to be done in a future PR.
Support for setting the linger timeout of a socket, querying the remote
address of a socket, setting whether or not keep-alive messages are to
be sent through a connection-oriented socket periodically depending on
host operating system settings has been added.
`std.io.Reader` and `std.io.Writer` wrappers around `Socket` has been
implemented, which wrap around Socket.read(buf, flags) and
Socket.write(buf, flags). Both wrappers may be provided flags which are
passed to Socket.read / Socket.write accordingly.
Cross-platform support for `getpeername()` has been implemented.
Windows support for the new `std.x.os.Socket` has been implemented. To
accomplish this, a full refactor of `std.os.windows.ws2_32` has been
done to supply any missing definitions and constants based on
auto-generated Windows syscall bindings by @marler8997.
`std.x.net.TCP.Listener.setQuickACK` has been moved to
`std.x.net.TCP.Client.setQuickACK`.
Windows support for resolving the scope ID of an interface name
specified in an IPv6 address has been provided.
`sockaddr_storage` definitions have been provided for Windows, Linux,
and Darwin. `sockaddr_storage` is used to allocate space before any
socket addresses are queried via. calls such as accept(), getsockname(),
and getpeername().
Zig-friendly wrappers for GetQueuedCompletionStatusEx(), getpeername(),
SetConsoleCtrlHandler(), SetFileCompletionNotificationModes() syscalls
on Windows have been provided.
Socket.setOption() was provided to set the value of a socket option in
place of os.setsockopt. Socket.getOption() will be provided in a future
PR.
There is still further work to be done regarding querying socket option
values on Windows, which is to be done in a subsequent PR.
2021-05-08 22:44:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
std/os, x/os/socket: windows support, socket helpers, getpeername()
Socket I/O methods such as read, readv, write, writev, send, recv,
sendmsg, recvmsg have been generalized to read(buf, flags), write(buf,
flags), readVectorized(vectors, flags), and writeVectorized(vectors,
flags). There is still some work left to be done abstracting both
readVectorized and writeVectorized properly across platforms, which is
work to be done in a future PR.
Support for setting the linger timeout of a socket, querying the remote
address of a socket, setting whether or not keep-alive messages are to
be sent through a connection-oriented socket periodically depending on
host operating system settings has been added.
`std.io.Reader` and `std.io.Writer` wrappers around `Socket` has been
implemented, which wrap around Socket.read(buf, flags) and
Socket.write(buf, flags). Both wrappers may be provided flags which are
passed to Socket.read / Socket.write accordingly.
Cross-platform support for `getpeername()` has been implemented.
Windows support for the new `std.x.os.Socket` has been implemented. To
accomplish this, a full refactor of `std.os.windows.ws2_32` has been
done to supply any missing definitions and constants based on
auto-generated Windows syscall bindings by @marler8997.
`std.x.net.TCP.Listener.setQuickACK` has been moved to
`std.x.net.TCP.Client.setQuickACK`.
Windows support for resolving the scope ID of an interface name
specified in an IPv6 address has been provided.
`sockaddr_storage` definitions have been provided for Windows, Linux,
and Darwin. `sockaddr_storage` is used to allocate space before any
socket addresses are queried via. calls such as accept(), getsockname(),
and getpeername().
Zig-friendly wrappers for GetQueuedCompletionStatusEx(), getpeername(),
SetConsoleCtrlHandler(), SetFileCompletionNotificationModes() syscalls
on Windows have been provided.
Socket.setOption() was provided to set the value of a socket option in
place of os.setsockopt. Socket.getOption() will be provided in a future
PR.
There is still further work to be done regarding querying socket option
values on Windows, which is to be done in a subsequent PR.
2021-05-08 22:44:39 +09:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std/os, x/os/socket: windows support, socket helpers, getpeername()
Socket I/O methods such as read, readv, write, writev, send, recv,
sendmsg, recvmsg have been generalized to read(buf, flags), write(buf,
flags), readVectorized(vectors, flags), and writeVectorized(vectors,
flags). There is still some work left to be done abstracting both
readVectorized and writeVectorized properly across platforms, which is
work to be done in a future PR.
Support for setting the linger timeout of a socket, querying the remote
address of a socket, setting whether or not keep-alive messages are to
be sent through a connection-oriented socket periodically depending on
host operating system settings has been added.
`std.io.Reader` and `std.io.Writer` wrappers around `Socket` has been
implemented, which wrap around Socket.read(buf, flags) and
Socket.write(buf, flags). Both wrappers may be provided flags which are
passed to Socket.read / Socket.write accordingly.
Cross-platform support for `getpeername()` has been implemented.
Windows support for the new `std.x.os.Socket` has been implemented. To
accomplish this, a full refactor of `std.os.windows.ws2_32` has been
done to supply any missing definitions and constants based on
auto-generated Windows syscall bindings by @marler8997.
`std.x.net.TCP.Listener.setQuickACK` has been moved to
`std.x.net.TCP.Client.setQuickACK`.
Windows support for resolving the scope ID of an interface name
specified in an IPv6 address has been provided.
`sockaddr_storage` definitions have been provided for Windows, Linux,
and Darwin. `sockaddr_storage` is used to allocate space before any
socket addresses are queried via. calls such as accept(), getsockname(),
and getpeername().
Zig-friendly wrappers for GetQueuedCompletionStatusEx(), getpeername(),
SetConsoleCtrlHandler(), SetFileCompletionNotificationModes() syscalls
on Windows have been provided.
Socket.setOption() was provided to set the value of a socket option in
place of os.setsockopt. Socket.getOption() will be provided in a future
PR.
There is still further work to be done regarding querying socket option
values on Windows, which is to be done in a subsequent PR.
2021-05-08 22:44:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 22:59:30 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-02 16:46:48 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-12 14:53:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-02 05:28:25 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
2020-09-08 12:24:39 +02:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-31 00:28:48 +09:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
2021-02-24 21:29:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-31 10:07:51 -06:00
|
|
|
|
2020-05-29 22:38:48 -06:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 00:27:32 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-17 01:28:20 -06:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 00:27:32 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-16 18:14:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-07 18:51:04 +00:00
|
|
|
|
|
|
|
|
|
2022-03-14 20:41:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-16 18:14:39 -07:00
|
|
|
|
2021-05-04 09:21:23 -07:00
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-05-04 09:21:23 -07:00
|
|
|
|
2020-10-07 18:51:04 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-10-16 18:14:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-30 16:58:32 -05:00
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2019-11-30 16:58:32 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
2020-05-18 17:01: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
|
|
|
|
2021-08-23 17:06:56 -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-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-09 18:17:09 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-30 11:29:37 +02:00
|
|
|
|
2020-01-15 18:15:24 +10:00
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 14:45:39 +10:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-24 08:43:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
2020-01-15 18:15:24 +10:00
|
|
|
|
|
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-23 09:59:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-09 18:17:09 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-15 18:15:24 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 14:12:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 14:12:50 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2019-05-27 14:12:50 -04:00
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2019-05-27 14:12:50 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-23 17:22:34 -07:00
|
|
|
|
2022-07-31 02:41:32 -07:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-31 02:41:32 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-28 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-28 12:46:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-26 19:56:37 -04:00
|
|
|
|
2019-05-28 18:25:48 +02:00
|
|
|
|
2019-05-26 19:56:37 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-28 18:25:48 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-02-05 15:31:09 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 19:56:37 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-25 15:57:13 -04:00
|
|
|
|
2019-05-26 19:56:37 -04:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-22 05:04:53 +01:00
|
|
|
|
2019-05-26 19:56:37 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-11 15:28:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-28 17:31:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-25 00:30:28 -05:00
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
2019-07-28 17:31:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-31 20:46:09 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-28 17:31:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-02 23:49:49 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2020-05-02 01:25:22 -04:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 17:10:43 -05:00
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
2020-02-16 17:10:43 -05:00
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
|
|
|
|
|
2020-02-16 17:10:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-02-16 17:10:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-17 14:25:52 +02:00
|
|
|
|
2020-02-16 17:10:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-16 13:25:30 -05:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2019-05-27 14:12:50 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-07 11:28:42 -05:00
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
2020-02-07 11:28:42 -05:00
|
|
|
|
|
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-18 13:24:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 17:28:59 -04:00
|
|
|
|
2020-02-29 21:46:07 +01:00
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2019-05-24 18:27:18 -04: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-02-25 16:54:32 -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
|
|
|
|
2021-01-17 13:29:00 -06:00
|
|
|
|
2021-02-25 16:54:32 -07:00
|
|
|
|
2021-01-17 13:29:00 -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
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2019-05-27 17:28:59 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-11-25 00:30:28 -05:00
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2019-05-24 18:27:18 -04: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-02-25 16:54:32 -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
|
|
|
|
2021-01-17 13:29:00 -06:00
|
|
|
|
2021-02-25 16:54:32 -07:00
|
|
|
|
2021-01-17 13:29:00 -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
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2020-06-30 18:18:25 +02:00
|
|
|
|
2020-06-29 17:10:01 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-09-25 16:38:25 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-30 22:02:34 -07:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-09-25 16:38:25 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-30 22:02:34 -07:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-09-25 16:38:25 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-30 22:02:34 -07:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 14:42:10 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-30 22:02:34 -07:00
|
|
|
|
2021-08-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-16 11:39:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-03-16 11:39:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-03-16 11:39:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-11-30 18:49:41 +01:00
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-11-30 18:49:41 +01:00
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-11-30 18:49:41 +01:00
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
2020-11-30 18:49:41 +01:00
|
|
|
|
2021-09-25 17:32:18 -04:00
|
|
|
|
|
|
|
|
|
2020-09-02 23:53:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-05-02 17:36:28 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-02 22:57:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-24 20:09:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-02 22:57:02 -06:00
|
|
|
|
|
|
|
|
|
2021-12-03 22:47:50 -07:00
|
|
|
|
|
|
|
|
|
2020-04-06 22:07:27 -06:00
|
|
|
|
2020-04-02 22:57:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-09-24 20:09:31 +02:00
|
|
|
|
2020-04-02 22:57:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-27 01:35:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-02 17:06:29 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2022-03-03 12:25:21 -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
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
2020-04-03 00:27:34 -06:00
|
|
|
|
2020-11-22 23:28:40 +01:00
|
|
|
|
2021-12-03 22:47:50 -07:00
|
|
|
|
stdlib: Add emulated CWD to std.os for WASI targets
This adds a special CWD file descriptor, AT.FDCWD (-2), to refer to the
current working directory. The `*at(...)` functions look for this and
resolve relative paths against the stored CWD. Absolute paths are
dynamically matched against the stored Preopens.
"os.initPreopensWasi()" must be called before std.os functions will
resolve relative or absolute paths correctly. This is asserted at
runtime.
Support has been added for: `open`, `rename`, `mkdir`, `rmdir`, `chdir`,
`fchdir`, `link`, `symlink`, `unlink`, `readlink`, `fstatat`, `access`,
and `faccessat`.
This also includes limited support for `getcwd()` and `realpath()`.
These return an error if the CWD does not correspond to a Preopen with
an absolute path. They also do not currently expand symlinks.
2022-03-01 10:17:05 -07:00
|
|
|
|
2020-04-03 00:27:34 -06:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-02 08:09:51 +00:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-08-02 19:36:49 +02:00
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-30 17:50:49 +02:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-31 16:35:01 -08:00
|
|
|
|
2020-07-30 17:00:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
2022-07-11 13:54:40 -06:00
|
|
|
|
|
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
2021-08-28 15:34:17 -07:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-02 19:03:14 -07:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
2020-11-25 13:23:43 -07:00
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-11-21 00:19:22 +03:30
|
|
|
|
2021-08-31 22:21:23 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-11 13:54:40 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-12 23:50:00 +02:00
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-24 01:06:03 -04:00
|
|
|
|
2020-07-11 14:09:04 +03:00
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-24 01:06:03 -04:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-19 06:24:45 +01:00
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-23 14:58:08 +01:00
|
|
|
|
2022-04-04 13:33:24 +01:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-23 14:58:08 +01:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
2020-11-23 14:58:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
2020-11-23 14:58:08 +01:00
|
|
|
|
2019-11-19 20:29:08 -05:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
2020-11-23 14:58:08 +01:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-17 15:23:59 -05:00
|
|
|
|
2019-05-29 10:30:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2020-05-24 20:06:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-08 16:04:02 +01:00
|
|
|
|
2020-04-01 10:00:37 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-11-25 18:46:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-01 10:00:37 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 22:52:07 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-25 13:07:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-26 23:35:26 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-25 13:07:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
2020-11-18 02:42:35 -05:00
|
|
|
|
2020-01-15 18:17:41 +10:00
|
|
|
|
2020-11-18 02:42:35 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2020-11-18 02:42:35 -05:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-21 18:12:13 +02:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2019-05-24 18:27:18 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-29 09:43:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-05-29 09:43:39 +02:00
|
|
|
|
|
|
|
|
|
2020-04-01 10:00:37 +00:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-05-29 09:43:39 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-02 13:27:40 -04:00
|
|
|
|
2022-01-21 10:14:44 +01:00
|
|
|
|
2019-07-02 13:27:40 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2022-01-21 10:14:44 +01:00
|
|
|
|
2019-07-02 13:27:40 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-06 15:29:34 -07:00
|
|
|
|
2022-05-02 00:27:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-14 03:06:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-07-14 03:06:20 -04:00
|
|
|
|
|
|
|
|
|
2021-07-27 08:59:34 +09: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-23 17:06:56 -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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-14 03:06:20 -04:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-14 03:06:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-08 18:09:08 -04:00
|
|
|
|
2019-09-11 21:21:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-22 15:36:11 -04:00
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-22 15:36:11 -04:00
|
|
|
|
|
|
|
|
|
2019-09-11 21:21:00 -04:00
|
|
|
|
2020-02-25 01:52:27 -05:00
|
|
|
|
2020-02-28 03:11:37 -05:00
|
|
|
|
2021-11-30 00:13:07 -07:00
|
|
|
|
2020-02-28 03:11:37 -05:00
|
|
|
|
|
|
|
|
|
2019-09-11 21:21:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-02-28 03:11:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2020-02-28 03:11:37 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-19 21:10:22 -04:00
|
|
|
|
|
|
|
|
|
2019-10-29 16:10:14 -04:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-06 23:25:57 -05:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-24 13:43:41 -07:00
|
|
|
|
2022-04-26 17:08:54 +02:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
2020-12-22 18:47:11 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-31 19:29:17 +09:00
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-01 20:19:13 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-27 14:19:38 +11:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-05 23:46:08 -03:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-22 18:47:11 -03:00
|
|
|
|
2020-12-15 16:56:42 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-01 20:19:13 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-22 18:47:11 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-04 12:20:43 +01:00
|
|
|
|
2022-10-15 00:07:40 +09:00
|
|
|
|
2020-12-22 18:47:11 -03:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-01-10 02:03:56 -08:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-10 02:03:56 -08:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-23 10:41:09 +02:00
|
|
|
|
2020-09-13 09:42:00 +02:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-17 18:04:53 -06:00
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
|
|
|
|
|
2021-10-15 14:43:57 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-06-09 21:35:42 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-05 19:53:58 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-06-09 21:35:42 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-12 14:29:43 +05:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
|
|
|
|
|
2021-10-15 11:46:47 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 03:10:56 -05:00
|
|
|
|
2020-03-05 19:53:58 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2021-06-09 21:35:42 -04:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
|
|
|
|
|
2021-10-15 11:46:47 -07:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-03-03 15:01:08 -05:00
|
|
|
|
2020-03-03 02:03:22 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-10 02:03:56 -08:00
|
|
|
|
|
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-07 11:13:26 +02:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-10-07 11:13:26 +02:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-19 09:42:42 +03:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
2021-06-18 10:27:37 +02:00
|
|
|
|
2020-10-06 11:57:23 +02:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2021-07-27 08:59:34 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-18 10:27:37 +02:00
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
2021-06-18 10:27:37 +02:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-18 10:27:37 +02:00
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-19 09:42:42 +03:00
|
|
|
|
2020-10-03 12:31:17 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-10-03 12:31:17 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2020-10-03 12:31:17 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
2021-06-18 10:27:37 +02:00
|
|
|
|
2020-10-03 12:31:17 +02:00
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2020-08-11 21:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-10 20:20:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2020-10-21 18:24:24 +02:00
|
|
|
|
2020-09-10 20:20:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-10 20:20:27 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-10 20:20:27 +02:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-22 19:36:59 +04:30
|
|
|
|
2021-11-08 07:48:07 -07:00
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-25 18:42:24 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-09 18:55:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-03 13:23:48 +02:00
|
|
|
|
|
|
|
|
|
2019-10-29 02:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-29 16:10:14 -04:00
|
|
|
|
|
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-03 20:04:30 +03:30
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-06 23:25:57 -05:00
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 15:59:46 -07:00
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 15:59:46 -07:00
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-13 15:59:46 -07:00
|
|
|
|
2019-10-29 14:03:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-07 15:32:20 -06:00
|
|
|
|
2019-12-30 19:35:05 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-27 15:37:28 +01:00
|
|
|
|
2021-01-08 01:36:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-27 15:37:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-16 20:31:07 +02:00
|
|
|
|
2019-12-30 19:35:05 -05:00
|
|
|
|
|
|
|
|
|
2019-11-29 17:17:09 -03:00
|
|
|
|
2020-10-27 15:37:28 +01:00
|
|
|
|
|
|
|
|
|
2021-05-09 17:36:35 +09:00
|
|
|
|
2020-10-27 15:37:28 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-16 20:31:07 +02:00
|
|
|
|
2020-10-27 15:37:28 +01:00
|
|
|
|
|
|
|
|
|
2019-11-29 17:17:09 -03:00
|
|
|
|
|
|
|
|
|
2019-11-13 21:25:19 -03:00
|
|
|
|
2019-12-31 16:34:14 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-31 17:57:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-31 16:34:14 -05:00
|
|
|
|
|
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2022-05-14 14:16:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-11-13 21:25:19 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-31 15:33:23 -03:00
|
|
|
|
2019-11-13 21:25:19 -03:00
|
|
|
|
2020-03-30 14:23:22 -04:00
|
|
|
|
2019-11-13 21:25:19 -03:00
|
|
|
|
2019-12-06 06:29:23 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-06 06:29:23 +05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-30 13:36:28 +07:00
|
|
|
|
2020-02-05 15:31:09 -05:00
|
|
|
|
2020-01-30 13:36:28 +07:00
|
|
|
|
|
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
2020-01-30 13:36:28 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-02-05 15:31:09 -05:00
|
|
|
|
2020-01-30 13:36:28 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-30 13:36:28 +07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-20 16:34:37 -03:00
|
|
|
|
2021-03-16 17:14:00 -04:00
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-02 15:28:46 -04:00
|
|
|
|
|
|
|
|
|
2020-04-20 16:34:37 -03:00
|
|
|
|
|
|
|
|
|
2020-07-22 18:26:27 -03:00
|
|
|
|
2020-08-17 16:19:57 -07:00
|
|
|
|
2020-08-16 14:30:09 -03:00
|
|
|
|
2020-07-22 18:26:27 -03:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-07-22 18:26:27 -03:00
|
|
|
|
|
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-04 23:47:27 -07:00
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-09-02 22:16:40 +00:00
|
|
|
|
|
|
|
|
|
2020-09-11 14:10:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-04 22:30:47 +11:00
|
|
|
|
2020-09-11 14:10:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-04 22:23:59 +11:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-11 14:10:55 +02:00
|
|
|
|
2020-11-04 22:30:47 +11:00
|
|
|
|
2020-09-11 14:10:55 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-09-11 14:10:55 +02:00
|
|
|
|
|
|
|
|
|
2020-10-02 00:20:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-04 23:55:33 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-04 23:55:33 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-10-02 00:20:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-10 20:13:43 -07:00
|
|
|
|
2020-10-02 00:20:32 +02:00
|
|
|
|
2020-10-04 23:55:33 +02:00
|
|
|
|
2021-05-07 09:41:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 20:26:04 +01:00
|
|
|
|
2020-10-02 00:20:32 +02:00
|
|
|
|
|
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
|
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-25 00:00:39 -07:00
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 17:06:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-12-18 15:38:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std: add Linux perf syscall bits
Example usage:
```zig
const std = @import("std");
const PERF = std.os.linux.PERF;
const assert = std.debug.assert;
test "perf" {
var attr: std.os.linux.perf_event_attr = .{
.type = PERF.TYPE.HARDWARE,
.config = @enumToInt(PERF.COUNT.HW.INSTRUCTIONS),
.flags = .{
.disabled = true,
.exclude_kernel = true,
.exclude_hv = true,
},
};
const fd = try std.os.perf_event_open(&attr, 0, -1, -1, PERF.FLAG.FD_CLOEXEC);
defer std.os.close(fd);
_ = std.os.linux.ioctl(fd, PERF.EVENT_IOC.RESET, 0);
_ = std.os.linux.ioctl(fd, PERF.EVENT_IOC.ENABLE, 0);
long();
_ = std.os.linux.ioctl(fd, PERF.EVENT_IOC.DISABLE, 0);
var result: usize = 0;
assert((try std.os.read(fd, std.mem.asBytes(&result))) == @sizeOf(usize));
std.debug.print("instruction count: {d}\n", .{result});
}
fn long() void {
var i: usize = 0;
while (i < 100000) : (i += 1) {}
}
```
2021-11-01 14:45:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-16 19:56:33 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|