From 5e3b052fb6cdfc1a04d4e791f7bd56935fd00565 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 18 Aug 2022 14:56:24 +0200 Subject: [PATCH] Update dependencies and patches --- build.sh | 18 +++++++++-------- .../patches/emscripten-auto-deletelater.patch | 6 +++--- .../emscripten-vector-as-js-array.patch | 20 +++++++++---------- ...mscripten-wasmfs-implement-fs-unlink.patch | 2 +- .../emscripten-wasmfs-implement-munmap.patch | 2 +- .../emscripten-wasmfs-mmap-shared.patch | 2 +- playground/package.json | 4 ++-- 7 files changed, 28 insertions(+), 26 deletions(-) diff --git a/build.sh b/build.sh index cc5efab18..f5e70a827 100755 --- a/build.sh +++ b/build.sh @@ -163,7 +163,7 @@ echo "Compiling zlib-ng" echo "=============================================" test -f "$TARGET/lib/pkgconfig/zlib.pc" || ( mkdir $DEPS/zlib-ng - curl -Ls https://github.com/zlib-ng/zlib-ng/archive/$VERSION_ZLIBNG.tar.gz | tar xzC $DEPS/zlib-ng --strip-components=1 + curl -Ls https://github.com/zlib-ng/zlib-ng/archive/refs/tags/$VERSION_ZLIBNG.tar.gz | tar xzC $DEPS/zlib-ng --strip-components=1 cd $DEPS/zlib-ng # SSE intrinsics needs to be checked for wasm32 sed -i 's/|\s*x86_64/& | wasm32/g' configure @@ -255,11 +255,13 @@ echo "Compiling jpeg" echo "=============================================" test -f "$TARGET/lib/pkgconfig/libjpeg.pc" || ( mkdir $DEPS/jpeg - curl -Ls https://github.com/mozilla/mozjpeg/archive/v$VERSION_JPEG.tar.gz | tar xzC $DEPS/jpeg --strip-components=1 + curl -Ls https://github.com/mozilla/mozjpeg/archive/refs/tags/v$VERSION_JPEG.tar.gz | tar xzC $DEPS/jpeg --strip-components=1 cd $DEPS/jpeg - # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/250#issuecomment-407615180 + # Compile without SIMD support, see: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/250 + # Disable environment variables usage, see: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/600 emcmake cmake -B_build -H. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$TARGET -DENABLE_STATIC=TRUE \ - -DENABLE_SHARED=FALSE -DWITH_JPEG8=TRUE -DWITH_SIMD=FALSE -DWITH_TURBOJPEG=FALSE -DPNG_SUPPORTED=FALSE + -DENABLE_SHARED=FALSE -DWITH_JPEG8=TRUE -DWITH_SIMD=FALSE -DWITH_TURBOJPEG=FALSE -DPNG_SUPPORTED=FALSE \ + -DCMAKE_C_FLAGS="$CFLAGS -DNO_GETENV -DNO_PUTENV" make -C _build install ) @@ -268,7 +270,7 @@ echo "Compiling spng" echo "=============================================" test -f "$TARGET/lib/pkgconfig/spng.pc" || ( mkdir $DEPS/spng - curl -Ls https://github.com/randy408/libspng/archive/v$VERSION_SPNG.tar.gz | tar xzC $DEPS/spng --strip-components=1 + curl -Ls https://github.com/randy408/libspng/archive/refs/tags/v$VERSION_SPNG.tar.gz | tar xzC $DEPS/spng --strip-components=1 cd $DEPS/spng # TODO(kleisauke): Discuss this patch upstream patch -p1 <$SOURCE_DIR/build/patches/libspng-emscripten.patch @@ -284,7 +286,7 @@ echo "Compiling imagequant" echo "=============================================" test -f "$TARGET/lib/pkgconfig/imagequant.pc" || ( mkdir $DEPS/imagequant - curl -Ls https://github.com/lovell/libimagequant/archive/v$VERSION_IMAGEQUANT.tar.gz | tar xzC $DEPS/imagequant --strip-components=1 + curl -Ls https://github.com/lovell/libimagequant/archive/refs/tags/v$VERSION_IMAGEQUANT.tar.gz | tar xzC $DEPS/imagequant --strip-components=1 cd $DEPS/imagequant # TODO(kleisauke): Discuss this patch upstream patch -p1 <$SOURCE_DIR/build/patches/imagequant-emscripten.patch @@ -298,10 +300,10 @@ echo "Compiling cgif" echo "=============================================" test -f "$TARGET/lib/pkgconfig/cgif.pc" || ( mkdir $DEPS/cgif - curl -Ls https://github.com/dloebl/cgif/archive/V$VERSION_CGIF.tar.gz | tar xzC $DEPS/cgif --strip-components=1 + curl -Ls https://github.com/dloebl/cgif/archive/refs/tags/V$VERSION_CGIF.tar.gz | tar xzC $DEPS/cgif --strip-components=1 cd $DEPS/cgif meson setup _build --prefix=$TARGET --cross-file=$MESON_CROSS --default-library=static --buildtype=release \ - -Dtests=false + -Dtests=false ninja -C _build install ) diff --git a/build/patches/emscripten-auto-deletelater.patch b/build/patches/emscripten-auto-deletelater.patch index f37ec05bf..137648b8e 100644 --- a/build/patches/emscripten-auto-deletelater.patch +++ b/build/patches/emscripten-auto-deletelater.patch @@ -10,7 +10,7 @@ diff --git a/src/embind/embind.js b/src/embind/embind.js index 1111111..2222222 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js -@@ -14,7 +14,7 @@ +@@ -13,7 +13,7 @@ /*jslint sub:true*/ /* The symbols 'fromWireType' and 'toWireType' must be accessed via array notation to be closure-safe since craftInvokerFunction crafts functions as strings that can't be closured. */ // -- jshint doesn't understand library syntax, so we need to specifically tell it about the symbols we define @@ -19,7 +19,7 @@ index 1111111..2222222 100644 /*global ensureOverloadTable, embind__requireFunction, awaitingDependencies, makeLegalFunctionName, embind_charCodes:true, registerType, createNamedFunction, RegisteredPointer, throwInternalError*/ /*global simpleReadValueFromPointer, floatReadValueFromPointer, integerReadValueFromPointer, enumReadValueFromPointer, replacePublicSymbol, craftInvokerFunction, tupleRegistrations*/ /*global finalizationRegistry, attachFinalizer, detachFinalizer, releaseClassHandle, runDestructor*/ -@@ -42,11 +42,12 @@ var LibraryEmbind = { +@@ -41,11 +41,12 @@ var LibraryEmbind = { $init_embind__deps: [ '$getInheritedInstanceCount', '$getLiveInheritedInstances', @@ -33,7 +33,7 @@ index 1111111..2222222 100644 Module['flushPendingDeletes'] = flushPendingDeletes; Module['setDelayFunction'] = setDelayFunction; #if IN_TEST_HARNESS -@@ -1758,15 +1759,25 @@ var LibraryEmbind = { +@@ -1757,15 +1758,25 @@ var LibraryEmbind = { } }, diff --git a/build/patches/emscripten-vector-as-js-array.patch b/build/patches/emscripten-vector-as-js-array.patch index ee4c60e61..75f2841bc 100644 --- a/build/patches/emscripten-vector-as-js-array.patch +++ b/build/patches/emscripten-vector-as-js-array.patch @@ -11,7 +11,7 @@ diff --git a/src/embind/embind.js b/src/embind/embind.js index 1111111..2222222 100644 --- a/src/embind/embind.js +++ b/src/embind/embind.js -@@ -413,6 +413,36 @@ var LibraryEmbind = { +@@ -412,6 +412,36 @@ var LibraryEmbind = { return array; }, @@ -48,7 +48,7 @@ index 1111111..2222222 100644 $requireRegisteredType__deps: [ '$registeredTypes', '$getTypeName', '$throwBindingError'], $requireRegisteredType: function(rawType, humanName) { -@@ -443,7 +473,7 @@ var LibraryEmbind = { +@@ -442,7 +472,7 @@ var LibraryEmbind = { _embind_register_bool__sig: 'vpppii', _embind_register_bool__deps: [ @@ -57,7 +57,7 @@ index 1111111..2222222 100644 _embind_register_bool: function(rawType, name, size, trueValue, falseValue) { var shift = getShiftFromSize(size); -@@ -461,16 +491,7 @@ var LibraryEmbind = { +@@ -460,16 +490,7 @@ var LibraryEmbind = { 'argPackAdvance': 8, 'readValueFromPointer': function(pointer) { // TODO: if heap is fixed (like in asm.js) this could be executed outside @@ -75,7 +75,7 @@ index 1111111..2222222 100644 return this['fromWireType'](heap[pointer >> shift]); }, destructorFunction: null, // This type does not need a destructor -@@ -489,60 +510,57 @@ var LibraryEmbind = { +@@ -488,60 +509,57 @@ var LibraryEmbind = { } }, @@ -159,7 +159,7 @@ index 1111111..2222222 100644 } }, -@@ -569,7 +587,7 @@ var LibraryEmbind = { +@@ -568,7 +586,7 @@ var LibraryEmbind = { fromWireType = (value) => (value << bitshift) >>> bitshift; } @@ -168,7 +168,7 @@ index 1111111..2222222 100644 var checkAssertions = (value, toTypeName) => { #if ASSERTIONS if (typeof value != "number" && typeof value != "boolean") { -@@ -613,7 +631,7 @@ var LibraryEmbind = { +@@ -612,7 +630,7 @@ var LibraryEmbind = { var shift = getShiftFromSize(size); @@ -177,7 +177,7 @@ index 1111111..2222222 100644 // maxRange comes through as -1 for uint64_t (see issue 13902). Work around that temporarily if (isUnsignedType) { -@@ -785,6 +803,7 @@ var LibraryEmbind = { +@@ -784,6 +802,7 @@ var LibraryEmbind = { _embind_register_std_wstring__sig: 'vppp', _embind_register_std_wstring__deps: [ '$readLatin1String', '$registerType', '$simpleReadValueFromPointer', @@ -185,7 +185,7 @@ index 1111111..2222222 100644 '$UTF16ToString', '$stringToUTF16', '$lengthBytesUTF16', '$UTF32ToString', '$stringToUTF32', '$lengthBytesUTF32', ], -@@ -790,18 +809,16 @@ var LibraryEmbind = { +@@ -789,18 +808,16 @@ var LibraryEmbind = { ], _embind_register_std_wstring: function(rawType, charSize, name) { name = readLatin1String(name); @@ -205,7 +205,7 @@ index 1111111..2222222 100644 shift = 2; } registerType(rawType, { -@@ -809,7 +826,7 @@ var LibraryEmbind = { +@@ -808,7 +825,7 @@ var LibraryEmbind = { 'fromWireType': function(value) { // Code mostly taken from _embind_register_std_string fromWireType var length = HEAPU32[value >> 2]; @@ -214,7 +214,7 @@ index 1111111..2222222 100644 var str; var decodeStartPtr = value + 4; -@@ -884,6 +901,71 @@ var LibraryEmbind = { +@@ -883,6 +900,71 @@ var LibraryEmbind = { }); }, diff --git a/build/patches/emscripten-wasmfs-implement-fs-unlink.patch b/build/patches/emscripten-wasmfs-implement-fs-unlink.patch index 6f17d26d9..b2d0764ec 100644 --- a/build/patches/emscripten-wasmfs-implement-fs-unlink.patch +++ b/build/patches/emscripten-wasmfs-implement-fs-unlink.patch @@ -9,7 +9,7 @@ diff --git a/emcc.py b/emcc.py index 1111111..2222222 100644 --- a/emcc.py +++ b/emcc.py -@@ -2091,6 +2091,7 @@ def phase_linker_setup(options, state, newargs, user_settings): +@@ -2093,6 +2093,7 @@ def phase_linker_setup(options, state, newargs, user_settings): settings.REQUIRED_EXPORTS += [ '_wasmfs_write_file', '_wasmfs_mkdir', diff --git a/build/patches/emscripten-wasmfs-implement-munmap.patch b/build/patches/emscripten-wasmfs-implement-munmap.patch index 35a254052..58978e990 100644 --- a/build/patches/emscripten-wasmfs-implement-munmap.patch +++ b/build/patches/emscripten-wasmfs-implement-munmap.patch @@ -30,7 +30,7 @@ diff --git a/system/lib/wasmfs/syscalls.cpp b/system/lib/wasmfs/syscalls.cpp index 1111111..2222222 100644 --- a/system/lib/wasmfs/syscalls.cpp +++ b/system/lib/wasmfs/syscalls.cpp -@@ -1545,6 +1545,13 @@ intptr_t _mmap_js( +@@ -1558,6 +1558,13 @@ intptr_t _mmap_js( return (intptr_t)ptr; } diff --git a/build/patches/emscripten-wasmfs-mmap-shared.patch b/build/patches/emscripten-wasmfs-mmap-shared.patch index 8cd3ca92f..bb300bbb5 100644 --- a/build/patches/emscripten-wasmfs-mmap-shared.patch +++ b/build/patches/emscripten-wasmfs-mmap-shared.patch @@ -9,7 +9,7 @@ diff --git a/system/lib/wasmfs/syscalls.cpp b/system/lib/wasmfs/syscalls.cpp index 1111111..2222222 100644 --- a/system/lib/wasmfs/syscalls.cpp +++ b/system/lib/wasmfs/syscalls.cpp -@@ -1511,12 +1511,6 @@ intptr_t _mmap_js( +@@ -1524,12 +1524,6 @@ intptr_t _mmap_js( return -ENODEV; } diff --git a/playground/package.json b/playground/package.json index 5ae74aee9..2f4ca6e7a 100644 --- a/playground/package.json +++ b/playground/package.json @@ -28,9 +28,9 @@ "mini-css-extract-plugin": "^2.6.1", "monaco-editor": "^0.34.0", "monaco-editor-webpack-plugin": "^7.0.1", - "terser-webpack-plugin": "^5.3.3", + "terser-webpack-plugin": "^5.3.5", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", - "webpack-dev-server": "^4.9.3" + "webpack-dev-server": "^4.10.0" } }