Skip to content

Commit 94cc605

Browse files
committed
Test for microsoft/mimalloc@e14cfd2 (v3.0.1)
2 parents 28b407a + f3255fb commit 94cc605

File tree

8 files changed

+41
-37
lines changed

8 files changed

+41
-37
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [v0.0.12] - TBD
88

9-
Uses libvips v8.16.0, compiled with Emscripten v3.1.73.
9+
Uses libvips v8.16.0, compiled with Emscripten v4.0.2.
1010

1111
### Fixed
1212

Dockerfile

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# https://github.com/emscripten-core/emsdk
2-
FROM docker.io/emscripten/emsdk:3.1.73
2+
FROM docker.io/emscripten/emsdk:4.0.2
33

44
# Path settings
55
ENV \
@@ -13,7 +13,6 @@ RUN \
1313
build-essential \
1414
ccache \
1515
libglib2.0-dev \
16-
patchutils \
1716
pkgconf \
1817
# needed for Meson
1918
ninja-build \
@@ -25,8 +24,8 @@ RUN \
2524

2625
# Emscripten patches
2726
RUN \
28-
curl -Ls https://github.com/emscripten-core/emscripten/compare/3.1.73...kleisauke:wasm-vips-3.1.73.patch | patch -p1 -d $EMSDK/upstream/emscripten && \
29-
curl -Ls https://github.com/emscripten-core/emscripten/compare/06cebfc...kleisauke:mimalloc-update-577246d.patch | filterdiff -p1 -x ChangeLog.md | patch -p1 -d $EMSDK/upstream/emscripten && \
27+
curl -Ls https://github.com/emscripten-core/emscripten/compare/4.0.2...kleisauke:wasm-vips-4.0.2.patch | patch -p1 -d $EMSDK/upstream/emscripten && \
28+
curl -Ls https://github.com/emscripten-core/emscripten/compare/a9651ff...kleisauke:mimalloc-update-3.0.1.patch | patch -p1 -d $EMSDK/upstream/emscripten && \
3029
emcc --clear-cache && embuilder build sysroot --force
3130

3231
# Rust
@@ -35,7 +34,7 @@ RUN \
3534
--no-modify-path \
3635
--profile minimal \
3736
--target wasm32-unknown-emscripten \
38-
--default-toolchain nightly-2024-11-19 \
37+
--default-toolchain nightly-2025-01-30 \
3938
--component rust-src
4039

4140
# Cache settings

THIRD-PARTY-NOTICES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ used under the terms of the following licences:
2424
| libvips | LGPLv3 |
2525
| libwebp | New BSD License |
2626
| mozjpeg | [zlib License, IJG License, BSD-3-Clause](https://github.com/mozilla/mozjpeg/blob/master/LICENSE.md) |
27-
| resvg | MPL-2.0 License |
27+
| resvg | MIT Licence |
2828
| zlib-ng | [zlib Licence](https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md) |
2929

3030
Use of libraries under the terms of the LGPLv3 is via the

build.sh

+21-19
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ WASM_FS=false
3939
# https://github.com/WebAssembly/exception-handling
4040
WASM_EH=false
4141

42-
# Emit instructions for the new Wasm EH proposal with exnref
42+
# Emit instructions for the standardized Wasm EH proposal with exnref
4343
# (adopted on Oct 2023), disabled by default
4444
# https://github.com/WebAssembly/exception-handling/issues/280
4545
WASM_EXNREF=false
@@ -118,6 +118,8 @@ done
118118
#export LDFLAGS+=" --source-map-base http://localhost:3000/lib/"
119119

120120
# Rust flags
121+
# TODO(kleisauke): Remove +bulk-memory,+nontrapping-fptoint once Rust updates LLVM to 20, see:
122+
# https://github.com/llvm/llvm-project/commit/1bc2cd98c58a1059170dc38697c7a29a8e21160b
121123
export RUSTFLAGS="-Ctarget-feature=+atomics,+bulk-memory,+nontrapping-fptoint -Zdefault-visibility=hidden"
122124

123125
# Common compiler flags
@@ -128,13 +130,19 @@ if [ "$LTO" = "true" ]; then
128130
fi
129131
if [ "$WASM_EH" = "true" ]; then
130132
COMMON_FLAGS+=" -fwasm-exceptions -sSUPPORT_LONGJMP=wasm"
131-
# https://github.com/rust-lang/rust/issues/112195
132-
export RUSTFLAGS+=" -Cllvm-args=-enable-emscripten-cxx-exceptions=0 -Cllvm-args=-wasm-enable-sjlj"
133+
# https://github.com/rust-lang/rust/pull/131830
134+
export RUSTFLAGS+=" -Zemscripten-wasm-eh"
135+
if [ "$WASM_EXNREF" = "true" ]; then
136+
COMMON_FLAGS+=" -sWASM_LEGACY_EXCEPTIONS=0"
137+
# TODO(kleisauke): Switch to -wasm-use-legacy-eh=0 once Rust updates LLVM to 20, see:
138+
# https://github.com/llvm/llvm-project/commit/a8e1135baa9074f7c088c8e1999561f88699b56e
139+
export RUSTFLAGS+=" -Cllvm-args=-wasm-enable-exnref"
140+
fi
133141
else
134142
COMMON_FLAGS+=" -fexceptions"
135143
fi
136144

137-
export CFLAGS="$COMMON_FLAGS -mnontrapping-fptoint -fvisibility=hidden"
145+
export CFLAGS="$COMMON_FLAGS -fvisibility=hidden"
138146
if [ "$SIMD" = "true" ]; then
139147
export CFLAGS+=" -msimd128 -DWASM_SIMD_COMPAT_SLOW"
140148
export RUSTFLAGS+=" -Ctarget-feature=+simd128"
@@ -144,8 +152,7 @@ if [ "$PIC" = "true" ]; then export CFLAGS+=" -fPIC"; fi
144152
export CXXFLAGS="$CFLAGS"
145153

146154
export LDFLAGS="$COMMON_FLAGS -L$TARGET/lib -sAUTO_JS_LIBRARIES=0 -sAUTO_NATIVE_LIBRARIES=0"
147-
if [ "$WASM_BIGINT" = "true" ]; then export LDFLAGS+=" -sWASM_BIGINT"; fi
148-
if [ "$WASM_EXNREF" = "true" ]; then export LDFLAGS+=" -sWASM_EXNREF"; fi
155+
if [ "$WASM_BIGINT" = "false" ]; then export LDFLAGS+=" -sWASM_BIGINT=0"; fi
149156

150157
# Build paths
151158
export CPATH="$TARGET/include"
@@ -177,24 +184,24 @@ export RUSTFLAGS+=" --remap-path-prefix=$CARGO_HOME/registry/src/="
177184
export RUSTFLAGS+=" --remap-path-prefix=$DEPS/="
178185

179186
# Dependency version numbers
180-
VERSION_ZLIB_NG=2.2.2 # https://github.com/zlib-ng/zlib-ng
187+
VERSION_ZLIB_NG=2.2.3 # https://github.com/zlib-ng/zlib-ng
181188
VERSION_FFI=3.4.6 # https://github.com/libffi/libffi
182-
VERSION_GLIB=2.83.0 # https://gitlab.gnome.org/GNOME/glib
189+
VERSION_GLIB=2.83.3 # https://gitlab.gnome.org/GNOME/glib
183190
VERSION_EXPAT=2.6.4 # https://github.com/libexpat/libexpat
184-
VERSION_EXIF=0.6.24 # https://github.com/libexif/libexif
191+
VERSION_EXIF=0.6.25 # https://github.com/libexif/libexif
185192
VERSION_LCMS2=2.16 # https://github.com/mm2/Little-CMS
186193
VERSION_HWY=1.2.0 # https://github.com/google/highway
187194
VERSION_BROTLI=1.1.0 # https://github.com/google/brotli
188195
VERSION_MOZJPEG=4.1.5 # https://github.com/mozilla/mozjpeg
189-
VERSION_JXL=0.11.0 # https://github.com/libjxl/libjxl
196+
VERSION_JXL=0.11.1 # https://github.com/libjxl/libjxl
190197
VERSION_SPNG=0.7.4 # https://github.com/randy408/libspng
191198
VERSION_IMAGEQUANT=2.4.1 # https://github.com/lovell/libimagequant
192199
VERSION_CGIF=0.4.1 # https://github.com/dloebl/cgif
193-
VERSION_WEBP=1.4.0 # https://chromium.googlesource.com/webm/libwebp
200+
VERSION_WEBP=1.5.0 # https://chromium.googlesource.com/webm/libwebp
194201
VERSION_TIFF=4.7.0 # https://gitlab.com/libtiff/libtiff
195202
VERSION_RESVG=0.44.0 # https://github.com/linebender/resvg
196203
VERSION_AOM=3.11.0 # https://aomedia.googlesource.com/aom
197-
VERSION_HEIF=1.19.3 # https://github.com/strukturag/libheif
204+
VERSION_HEIF=1.19.5 # https://github.com/strukturag/libheif
198205
VERSION_VIPS=8.16.0 # https://github.com/libvips/libvips
199206

200207
VERSION_EMSCRIPTEN="$(emcc -dumpversion)"
@@ -302,7 +309,7 @@ node --version
302309
[ -f "$TARGET/lib/pkgconfig/libexif.pc" ] || (
303310
stage "Compiling exif"
304311
mkdir $DEPS/exif
305-
curl -Ls https://github.com/libexif/libexif/releases/download/v$VERSION_EXIF/libexif-$VERSION_EXIF.tar.bz2 | tar xjC $DEPS/exif --strip-components=1
312+
curl -Ls https://github.com/libexif/libexif/releases/download/v$VERSION_EXIF/libexif-$VERSION_EXIF.tar.xz | tar xJC $DEPS/exif --strip-components=1
306313
cd $DEPS/exif
307314
emconfigure ./configure --host=$CHOST --prefix=$TARGET --enable-static --disable-shared --disable-dependency-tracking \
308315
--disable-docs --disable-nls --without-libiconv-prefix --without-libintl-prefix CPPFLAGS="-DNO_VERBOSE_TAG_DATA"
@@ -447,13 +454,8 @@ node --version
447454
# Vendor dir doesn't work with -Zbuild-std due to https://github.com/rust-lang/wg-cargo-std-aware/issues/23
448455
# Just delete the config so that all deps are downloaded from the internet
449456
rm .cargo/config
457+
# Update and regenerate the lockfile for zune-jpeg
450458
# https://github.com/etemesi254/zune-image/pull/242
451-
# https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section
452-
cat >> Cargo.toml <<EOL
453-
[patch.crates-io]
454-
zune-jpeg = { git = "https://github.com/etemesi254/zune-image.git", rev = "80e1957" }
455-
EOL
456-
# Regenerate the lockfile for zune-jpeg
457459
cargo update zune-jpeg
458460
# We don't want to build the shared library
459461
sed -i '/^crate-type =/s/"cdylib", //' crates/c-api/Cargo.toml

playground/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
"fflate": "^0.8.2",
2727
"html-webpack-plugin": "^5.6.3",
2828
"mini-css-extract-plugin": "^2.9.2",
29-
"monaco-editor": "^0.52.0",
29+
"monaco-editor": "^0.52.2",
3030
"monaco-editor-webpack-plugin": "^7.1.0",
31-
"terser-webpack-plugin": "^5.3.10",
32-
"webpack": "^5.96.1",
33-
"webpack-cli": "^5.1.4",
34-
"webpack-dev-server": "^5.1.0"
31+
"terser-webpack-plugin": "^5.3.11",
32+
"webpack": "^5.97.1",
33+
"webpack-cli": "^6.0.1",
34+
"webpack-dev-server": "^5.2.0"
3535
}
3636
}

src/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ if ("web" IN_LIST ENVIRONMENT)
169169
--pre-js=${CMAKE_CURRENT_SOURCE_DIR}/workaround-cors-pre.js
170170
)
171171
set(WEB_MIN_TARGETS
172-
-sMIN_FIREFOX_VERSION=89
173172
-sMIN_CHROME_VERSION=91
173+
-sMIN_FIREFOX_VERSION=89
174+
-sMIN_SAFARI_VERSION=160400
174175
)
175176

176177
# libvips requires spawning at least VIPS_CONCURRENCY threads synchronously, with a minimum of 3 threads per

test/unit/index.html

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>wasm-vips testsuite</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<!-- FIXME(kleisauke): https://github.com/cdnjs/tools/issues/285 -->
8-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.8.2/mocha.css" crossorigin="anonymous">
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/11.1.0/mocha.css" crossorigin="anonymous">
99
<style>
1010
html,
1111
body {
@@ -14,6 +14,10 @@
1414
margin: 0;
1515
}
1616

17+
:root {
18+
--mocha-test-pass-color: forestgreen;
19+
}
20+
1721
#mocha-stats {
1822
font-size: initial;
1923
}
@@ -44,13 +48,11 @@
4448
#mocha .test.pass::before {
4549
content: '\2714';
4650
font-size: initial;
47-
color: forestgreen;
4851
}
4952

5053
#mocha .test.pending::before {
5154
content: '\25CF';
5255
font-size: initial;
53-
color: var(--mocha-test-pending-color);
5456
}
5557

5658
#mocha .test.pending:hover h2::after {
@@ -64,7 +66,7 @@
6466
</head>
6567
<body>
6668
<div id="mocha"></div>
67-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/10.7.3/mocha.min.js" crossorigin="anonymous"></script>
69+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mocha/11.1.0/mocha.min.js" crossorigin="anonymous"></script>
6870
<script class="mocha-init">
6971
mocha.setup({
7072
ui: 'bdd',

test/unit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"chai": "^5.1.2",
23-
"mocha": "^10.8.2"
23+
"mocha": "^11.1.0"
2424
},
2525
"engines": {
2626
"node": ">=16.4.0"

0 commit comments

Comments
 (0)