mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 00:37:19 +00:00
Fixup HQX build
Porting over few more improvements from #777 that can be applied to HQX despite the older Rust version: - Removed Cargo.lock from .gitignore (the file itself was added in the original PR, but is still ignored and wouldn't get committed on changes). - Removed couple of stray .DS_Store accidentally added in that PR. - Added a `--locked` to `wasm-pack` build to make sure we rebuild HQX with the same versions from Cargo.lock. - Removed separate `wasm-strip` and `wasm-opt -Os` steps from build.sh in HQX because they're already included in wasm-pack, and running twice only makes build slower.
This commit is contained in:
BIN
codecs/.DS_Store
vendored
BIN
codecs/.DS_Store
vendored
Binary file not shown.
6
codecs/hqx/.gitignore
vendored
6
codecs/hqx/.gitignore
vendored
@@ -1,5 +1 @@
|
|||||||
**/*.rs.bk
|
/target
|
||||||
target
|
|
||||||
Cargo.lock
|
|
||||||
bin/
|
|
||||||
pkg/README.md
|
|
||||||
|
|||||||
@@ -7,8 +7,5 @@ RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|||||||
RUN mkdir /opt/binaryen && \
|
RUN mkdir /opt/binaryen && \
|
||||||
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.38.32/binaryen-1.38.32-x86-linux.tar.gz | tar -xzf - -C /opt/binaryen --strip 1
|
curl -L https://github.com/WebAssembly/binaryen/releases/download/1.38.32/binaryen-1.38.32-x86-linux.tar.gz | tar -xzf - -C /opt/binaryen --strip 1
|
||||||
|
|
||||||
RUN mkdir /opt/wabt && \
|
ENV PATH="/opt/binaryen:${PATH}"
|
||||||
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.11/wabt-1.0.11-linux.tar.gz | tar -xzf - -C /opt/wabt --strip 1
|
|
||||||
|
|
||||||
ENV PATH="/opt/binaryen:/opt/wabt:${PATH}"
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|||||||
@@ -6,12 +6,8 @@ echo "============================================="
|
|||||||
echo "Compiling wasm"
|
echo "Compiling wasm"
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
(
|
(
|
||||||
wasm-pack build
|
wasm-pack build -- --verbose --locked
|
||||||
wasm-strip pkg/squooshhqx_bg.wasm
|
|
||||||
echo "Optimising Wasm so it doesn't break Chrome (this takes like 10-15mins. get a cup of tea)"
|
|
||||||
echo "Once https://crbug.com/974804 is fixed, we can remove this step"
|
|
||||||
rm pkg/.gitignore
|
rm pkg/.gitignore
|
||||||
wasm-opt -Os --no-validation -o pkg/squooshhqx_bg.wasm pkg/squooshhqx_bg.wasm
|
|
||||||
)
|
)
|
||||||
echo "============================================="
|
echo "============================================="
|
||||||
echo "Compiling wasm done"
|
echo "Compiling wasm done"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hqx",
|
"name": "hqx",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build:image": "docker build -t squoosh-hqx .",
|
"build:image": "docker build -t squoosh-hqx - < Dockerfile",
|
||||||
"build": "docker run --rm -v $(pwd):/src squoosh-hqx ./build.sh"
|
"build": "docker run --rm -v $(pwd):/src squoosh-hqx ./build.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
BIN
codecs/oxipng/.DS_Store
vendored
BIN
codecs/oxipng/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user