mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-18 19:49:04 +00:00
Now initialise all workers with module+memory separately, and then instead of using postMessage to send thread pointers, push them into a crossbeam-deque on the Rust side. Rayon already depends on crossbeam-dequeue, so we're not even adding another dependency, and this model allows us to push "tasks" (thread pointers) on the main thread and pop them on worker threads in arbitrary order without sacrificing correctness.
23 lines
734 B
Bash
23 lines
734 B
Bash
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
echo "============================================="
|
|
echo "Compiling wasm"
|
|
echo "============================================="
|
|
(
|
|
rm -rf pkg
|
|
CC=/opt/wasi-sdk/bin/clang RUSTFLAGS='-C target-feature=+atomics,+bulk-memory' rustup run nightly wasm-pack build -t web -- -Z build-std=panic_abort,std
|
|
rm pkg/.gitignore
|
|
)
|
|
echo "============================================="
|
|
echo "Compiling wasm done"
|
|
echo "============================================="
|
|
|
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
|
echo "Did you update your docker image?"
|
|
echo "Run \`docker pull ubuntu\`"
|
|
echo "Run \`docker pull rust\`"
|
|
echo "Run \`docker build -t squoosh-hqx .\`"
|
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|