ncruces / RethinkRAW

RethinkRAW is an unpretentious, free RAW photo editor.
https://rethinkraw.com
MIT No Attribution
89 stars 8 forks source link

Bump github.com/tetratelabs/wazero from 1.0.0-pre.8 to 1.0.0-pre.9 #44

Closed dependabot[bot] closed 1 year ago

dependabot[bot] commented 1 year ago

Bumps github.com/tetratelabs/wazero from 1.0.0-pre.8 to 1.0.0-pre.9.

Release notes

Sourced from github.com/tetratelabs/wazero's releases.

wazero v1.0.0-pre.9 integrates Go context to limit execution time running third party code. This is our last API affecting version before 1.0 in March. We'll cut at least one release candidate between now and then.

For those only interested in breaking changes, here's what you need to do:

  • Build with minimally Go 1.18
  • Rename Runtime.InstantiateModuleFromBinary to Runtime.Instantiate
mod, err := r.InstantiateModuleFromBinary(ctx, guestWasm)
mod, err := r.Instantiate(ctx, guestWasm)

Those of you attending wasmio will be able to meet many contributors and end users in person. This conference is timed almost exactly with our 1.0 release, so quite convenient for the community. If interested about in-person and virtual activities around our release, join gophers slack #wazero channel. Note: You may need an invite to join gophers. Regardless, if you like what we are doing, please star our repo as folks appreciate it. Meanwhile, let's dig into this month's changes!

Stop runaways with Go context!

@​mathetake led an exciting development, which allows more control of the third-party wasm you run with wazero. Specifically, a cancel or deadline context can now halt potentially endless loops.

Here's an example:

ctx := context.Background()

r := wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfig(). // Integrate go context with the WebAssembly runtime .WithCloseOnContextDone(true)) defer r.Close(ctx)

mod, _ := r.Instantiate(ctx, infiniteLoopWasm)

infiniteLoop := mod.ExportedFunction("infinite_loop")

// Add function-scoped timeouts however you like. ctx, cancel := context.WithTimeout(ctx, time.Second) defer cancel()

// Pass that context when calling a function to prevent it from looping. _, err = infiniteLoop.Call(ctx)

When the context is done before wasm returns, you'll get an ExitError with one of these codes: ExitCodeContextCanceled or ExitCodeDeadlineExceeded

It is understood that some would like more features, such as metering or work-based limits. However, we are excited to have the most commonly requested form of function limiting implemented prior to 1.0. Without this last minute spike from @​mathetake, it might not have happened, or ended up as an experiment.

Passing all the tests

Besides features, there has been a large amount of effort to pass all available system tests, on darwin, linux and windows. This means that not only do we pass our own integration tests, but also third party ones like so:

wasi-testsuite

wasi-testsuite is an emerging test suite by the custodians of the WASI (system calls for wasm, basically). These include tests compiled from multiple languages including AssemblyScript, C, rust. Runtimes adapt into the suite, so there's one for wazero similar to wasmtime.

... (truncated)

Commits
  • e2ebce5 sysfs: adds chmod (#1135)
  • add6458 Removes unnecessary Engine.CreateElementInstance (#1134)
  • b7a7570 ci: enables wasi-testsuite on Windows (#1133)
  • 2309db9 wasi/platform: supports inode and dev on Windows (#1132)
  • 3d72f2c wasi: implements sched_yield with sys.Osyield (#1131)
  • e54e0c7 platform: adjusts errno on dangling symlink on Windows (#1130)
  • b758344 API BREAK: renames InstantiateModuleFromBinary to Instantiate (#1129)
  • aecb8e9 Implements fd_datasync in WASI and sync in GOOS=js (#1128)
  • 350f4de cmd/wazero: fix temp dir handling in TestRun (#1125)
  • 3bb9413 wasi: fix nanotime, scale QPC value correctly on Windows (#1124)
  • Additional commits viewable in compare view


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
dependabot[bot] commented 1 year ago

Looks like github.com/tetratelabs/wazero is up-to-date now, so this is no longer needed.