Skip to content

Experiment with running wasm-vips on Cloudflare Workers.

License

Notifications You must be signed in to change notification settings

kleisauke/cf-worker-wasm-vips

Repository files navigation

cf-worker-wasm-vips

An experiment with running wasm-vips on Cloudflare Workers.

Warning

wasm-vips in its current form can never run on Cloudflare workers.
See kleisauke/wasm-vips#2 (comment) for details.

Status

This experiment currently fails with:

worker.js onmessage() captured an uncaught exception: RuntimeError: memory access out of bounds
RuntimeError: memory access out of bounds
   at g_thread_proxy (wasm://wasm/0281634a:wasm-function[6132]:0x3c2b79)
   at h.invokeEntryPoint (polyfill.js:1816:23)
   at onmessage (polyfill.js:4353:35)
   at callFun (polyfill.js:4404:9)
   at Worker2.runPostMessage (polyfill.js:4410:7)

Since the WebAssembly.Memory in the Web Worker polyfill is not shared with the worker that instantiated wasm-vips. See this FIXME:

// FIXME(kleisauke): Need to share the memory with the worker that instantiated wasm-vips.

Cloudflare only allows to pass a string or binary data via WebSocket connections, which won't work for Emscripten's pthread integration. It requires an API that allows sharing Wasm memory between workers.

About

Experiment with running wasm-vips on Cloudflare Workers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published