Commit Graph

7 Commits

Author SHA1 Message Date
Edoardo Vacchi
97d0d70b73 wasi: add support for sockets (#1493)
Some checks failed
Release CLI / Pre-release build (push) Has been cancelled
Release CLI / Pre-release test (macos-12) (push) Has been cancelled
Release CLI / Pre-release test (ubuntu-22.04) (push) Has been cancelled
Release CLI / Pre-release test (windows-2022) (push) Has been cancelled
Release CLI / Release (push) Has been cancelled
Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Crypt Keeper <64215+codefromthecrypt@users.noreply.github.com>
Co-authored-by: Achille <achille.roussel@gmail.com>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2023-06-02 20:45:42 +08:00
Crypt Keeper
6243091dc2 renames exit log scope to proc and resolves gojs files to cwd (#1223)
Many tests failed in gojs due to needing to be resolved against the CWD,
which is atypically stored host side. This fixes that and renames the
"exit" scope to "proc" so we can use it for other proc concerns besides
exit.

This reduces known failures on GOOS=js from 23 to 14:
```bash
$ wazero run -mount=/usr/local/go/src/os:/:ro -mount=/tmp:/tmp -mount=/etc:/etc:ro -mount=/usr:/usr:ro -mount=/dev:/dev:ro os.wasm |grep '^--- FAIL'|wc -l
      14
```

See #1222

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-03-13 11:41:19 +08:00
Crypt Keeper
da99a7f5c0 logging: adds exit scope and fixes mtim bug (#1074)
This allows you to specify the exit scope amongst existing logging scopes, both in API and the CLI.

e.g for the CLI.
```bash
$ wazero run --hostlogging=exit,filesystem --mount=.:/:ro cat.wasm
```

e.g. for Go
```go
loggingCtx := context.WithValue(testCtx, experimental.FunctionListenerFactoryKey{},
	logging.NewHostLoggingListenerFactory(&log, logging.LogScopeExit|logging.LogScopeFilesystem))
```

This is helpful to know if the wasm called exit or if it exited
implicitly. This is one of the few host functions that exists in three
places: assemblyscript, gojs and wasi.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-01-29 08:43:14 +02:00
Crypt Keeper
9cf07b4d44 logging: adds poll scope (#1072)
This allows you to specify the poll scope amongst existing logging scopes, both in API and the CLI.

e.g for the CLI.
```bash
$ wazero run --hostlogging=poll --hostlogging=filesystem --mount=.:/:ro cat.wasm
```

e.g. for Go
```go
loggingCtx := context.WithValue(testCtx, experimental.FunctionListenerFactoryKey{},
	logging.NewHostLoggingListenerFactory(&log, logging.LogScopePoll|logging.LogScopeFilesystem))
```

This is particularly helpful to understand side-effects of GC. For
example, in `GOOS=js` GC will trigger events and these have been tricky
to troubleshoot in the past.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-01-29 06:22:49 +02:00
Crypt Keeper
d944c3c70d logging: adds clock scope (#1071)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-01-28 19:11:37 +02:00
Crypt Keeper
bd9a791c7a logging: rename crypto scope to random (#1070)
This is to avoid a collision with an emerging wasi-crypto. They will
have both wasi-random and wasi-crypto

Signed-off-by: Adrian Cole <adrian@tetrate.io>
2023-01-28 13:15:28 +02:00
Edoardo Vacchi
599c097603 Add -hostlogging=crypto (#1064)
This allows you to specify multiple logging scopes, both in API and the CLI.

e.g for the CLI.
```bash
$ wazero run --hostlogging=crypto --hostlogging=filesystem --mount=.:/:ro cat.wasm
```

e.g. for Go
```go
loggingCtx := context.WithValue(testCtx, experimental.FunctionListenerFactoryKey{},
	logging.NewHostLoggingListenerFactory(&log, logging.LogScopeCrypto|logging.LogScopeFilesystem))
```

Signed-off-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Adrian Cole <adrian@tetrate.io>
2023-01-28 12:51:44 +02:00