From 6c85bcdc9b667d456cb8856b3089c478f0fa0e07 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Thu, 20 Apr 2023 20:29:57 +0200 Subject: [PATCH 01/15] [ci] Do not test on node 19 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbaacfc..6a2d393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,6 @@ jobs: - 14 - 16 - 18 - - 19 os: - macos-latest - ubuntu-latest From 6d6d064e8f4cce699a1ff7d9bfc9ab83e71fa2b9 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Thu, 20 Apr 2023 20:30:44 +0200 Subject: [PATCH 02/15] [ci] Test on node 20 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a2d393..d18e8f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - 14 - 16 - 18 + - 20 os: - macos-latest - ubuntu-latest From 3628c70b53cbafcd22ae4f039f90a73ee507707c Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Tue, 12 Sep 2023 22:23:01 +0200 Subject: [PATCH 03/15] [ci] Update actions/checkout action to v4 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d18e8f4..c5cb816 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: node: 18 os: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} @@ -58,7 +58,7 @@ jobs: - arch: x86 os: ubuntu-18.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-node@v3 with: node-version: 16 @@ -83,7 +83,7 @@ jobs: contents: write # Needed for softprops/action-gh-release. runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/download-artifact@v3 with: path: prebuilds From dc7d1ddd79c35d543be4f5f21d94f6928f9f0954 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sun, 15 Oct 2023 20:56:47 +0200 Subject: [PATCH 04/15] [build] Fix build on macOS 10.15 or earlier --- binding.gyp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/binding.gyp b/binding.gyp index 603722b..f03307b 100644 --- a/binding.gyp +++ b/binding.gyp @@ -12,11 +12,22 @@ 'cflags_cc': ['-std=gnu++11'], 'conditions': [ ["OS=='mac'", { + 'variables': { + 'clang_version': + '&1 | perl -ne \'print $1 if /clang version ([0-9]+(\.[0-9]+){2,})/\')' + }, 'xcode_settings': { - 'MACOSX_DEPLOYMENT_TARGET': '10.7', - 'OTHER_CFLAGS': ['-arch x86_64', '-arch arm64'], - 'OTHER_LDFLAGS': ['-arch x86_64', '-arch arm64'] - } + 'MACOSX_DEPLOYMENT_TARGET': '10.7' + }, + 'conditions': [ + # Use Perl v-strings to compare versions. + ['clang_version and Date: Sun, 15 Oct 2023 21:00:49 +0200 Subject: [PATCH 05/15] [ci] Use Ubuntu 20.04 to build the prebuilt binary for Linux The Ubuntu 18.04 Actions runner image is no longer supported. --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5cb816..376c9e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,13 +50,13 @@ jobs: - x86 os: - macos-latest - - ubuntu-18.04 + - ubuntu-20.04 - windows-latest exclude: - arch: x86 os: macos-latest - arch: x86 - os: ubuntu-18.04 + os: ubuntu-20.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -69,7 +69,7 @@ jobs: - run: | npm run prebuild npm run prebuild-linux-musl-x64 - if: matrix.os == 'ubuntu-18.04' + if: matrix.os == 'ubuntu-20.04' - run: npm run prebuild if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v3 @@ -94,7 +94,7 @@ jobs: }}-darwin-x64+arm64.tar" -C "prebuilds/macos-latest" . - run: tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C - "prebuilds/ubuntu-18.04" linux-x64 + "prebuilds/ubuntu-20.04" linux-x64 - run: tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C "prebuilds/windows-latest" win32-ia32 From fba738aa241acdaa776b70a5c37167df08964bb4 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 4 Nov 2023 20:52:59 +0100 Subject: [PATCH 06/15] [ci] Update actions/setup-node action to v4 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 376c9e4..2879ca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: os: windows-latest steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} architecture: ${{ matrix.arch }} @@ -59,7 +59,7 @@ jobs: os: ubuntu-20.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 16 architecture: ${{ matrix.arch }} From 3a000d9110afd048588ef4f3c65b9331f93aafba Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 4 Nov 2023 20:58:56 +0100 Subject: [PATCH 07/15] [ci] Do not test on node 14 --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2879ca8..8ccd6fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,6 @@ jobs: - x64 - x86 node: - - 14 - 16 - 18 - 20 From ceb6a6fdb481fe4c5a7d910296b84aa607959591 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 4 Nov 2023 21:02:20 +0100 Subject: [PATCH 08/15] [pkg] Update node-gyp to version 10.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 615ef1c..4392fbd 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "devDependencies": { "mocha": "^10.0.0", - "node-gyp": "^9.1.0", + "node-gyp": "^10.0.1", "prebuildify": "^5.0.0", "prebuildify-cross": "^5.0.0" } From dd460efbb6af6f18264ed7d4f6c3faccb733c96e Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 30 Dec 2023 19:43:21 +0100 Subject: [PATCH 09/15] [ci] Update actions/upload-artifact action to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ccd6fa..8da3dd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: if: matrix.os == 'ubuntu-20.04' - run: npm run prebuild if: matrix.os == 'windows-latest' - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }} path: prebuilds From 6609b907e92faccd13a1b74190b319a07bbef3c2 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Sat, 30 Dec 2023 19:43:42 +0100 Subject: [PATCH 10/15] [ci] Update actions/download-artifact action to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8da3dd3..c4be086 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: path: prebuilds - run: echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT From 890c02944bd88b8ca68a2b71ed69c0f7511b9613 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 15 Jan 2024 16:18:31 +0100 Subject: [PATCH 11/15] [ci] Use unique artifact name --- .github/workflows/ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4be086..37f630f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v4 with: - name: ${{ matrix.os }} + name: ${{ matrix.os }}-${{ matrix.arch }} path: prebuilds retention-days: 1 release: @@ -90,16 +90,17 @@ jobs: id: get_version - run: tar -cvf "${{ steps.get_version.outputs.version - }}-darwin-x64+arm64.tar" -C "prebuilds/macos-latest" . + }}-darwin-x64+arm64.tar" -C "prebuilds/macos-latest-x64" + darwin-x64+arm64 - run: tar -cvf "${{ steps.get_version.outputs.version }}-linux-x64.tar" -C - "prebuilds/ubuntu-20.04" linux-x64 + "prebuilds/ubuntu-20.04-x64" linux-x64 - run: tar -cvf "${{ steps.get_version.outputs.version }}-win32-ia32.tar" -C - "prebuilds/windows-latest" win32-ia32 + "prebuilds/windows-latest-x86" win32-ia32 - run: tar -cvf "${{ steps.get_version.outputs.version }}-win32-x64.tar" -C - "prebuilds/windows-latest" win32-x64 + "prebuilds/windows-latest-x64" win32-x64 - uses: softprops/action-gh-release@v1 with: files: ${{ steps.get_version.outputs.version }}-*.tar From 225a76eecfa6435aa75552c44849d987001621dc Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Wed, 27 Mar 2024 21:46:47 +0100 Subject: [PATCH 12/15] [pkg] Update prebuildify to version 6.0.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4392fbd..6c105ed 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "devDependencies": { "mocha": "^10.0.0", "node-gyp": "^10.0.1", - "prebuildify": "^5.0.0", + "prebuildify": "^6.0.0", "prebuildify-cross": "^5.0.0" } } From 8f34cc8c787cc9770ce3bca433fce95601a083e1 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Thu, 9 May 2024 21:14:41 +0200 Subject: [PATCH 13/15] [ci] Test on node 22 --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37f630f..94b1bbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: - 16 - 18 - 20 + - 22 os: - macos-latest - ubuntu-latest From e836b85785cc1a1c95596135155bc9378454e3db Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 10 May 2024 17:58:17 +0200 Subject: [PATCH 14/15] [deps] Update is_utf8 to version 1.3.2 --- deps/is_utf8/CMakeLists.txt | 12 +++++-- deps/is_utf8/src/is_utf8.cpp | 61 +++++++++++++++++++++++------------- 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/deps/is_utf8/CMakeLists.txt b/deps/is_utf8/CMakeLists.txt index 97c20a7..ab9e040 100644 --- a/deps/is_utf8/CMakeLists.txt +++ b/deps/is_utf8/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.15) project(is_utf8 DESCRIPTION "Fast UTF-8 Validation" LANGUAGES CXX - VERSION 1.3.1 + VERSION 1.3.2 ) include(GNUInstallDirs) @@ -20,12 +20,16 @@ if (NOT CMAKE_BUILD_TYPE) endif() endif() -set(CMAKE_CXX_STANDARD 14) +# We compile tools, tests, etc. with C++ 11. Override yourself if you need on a +# target. +set(IS_UTF8_CXX_STANDARD 11 CACHE STRING "the C++ standard to use for is_utf8") + +set(CMAKE_CXX_STANDARD ${IS_UTF8_CXX_STANDARD}) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_MACOSX_RPATH OFF) -set(IS_UTF8_LIB_VERSION "1.3.1" CACHE STRING "is_utf8 library version") +set(IS_UTF8_LIB_VERSION "1.3.2" CACHE STRING "is_utf8 library version") set(IS_UTF8_LIB_SOVERSION "1" CACHE STRING "is_utf8 library soversion") set(IS_UTF8_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) @@ -40,6 +44,8 @@ endif(BUILD_TESTING) add_subdirectory(benchmarks) + +message(STATUS "Compiling using the C++ standard:" ${CMAKE_CXX_STANDARD}) # ---- Install rules ---- add_library(is_utf8::is_utf8 ALIAS is_utf8) diff --git a/deps/is_utf8/src/is_utf8.cpp b/deps/is_utf8/src/is_utf8.cpp index 2a7fe22..72ed218 100644 --- a/deps/is_utf8/src/is_utf8.cpp +++ b/deps/is_utf8/src/is_utf8.cpp @@ -872,8 +872,13 @@ template std::string toBinaryString(T b) { #ifndef IS_UTF8_IMPLEMENTATION_ARM64 #define IS_UTF8_IMPLEMENTATION_ARM64 (IS_UTF8_IS_ARM64) #endif -#define IS_UTF8_CAN_ALWAYS_RUN_ARM64 \ - IS_UTF8_IMPLEMENTATION_ARM64 &&IS_UTF8_IS_ARM64 + +#if IS_UTF8_IMPLEMENTATION_ARM64 &&IS_UTF8_IS_ARM64 +#define IS_UTF8_CAN_ALWAYS_RUN_ARM64 1 +#else +#define IS_UTF8_CAN_ALWAYS_RUN_ARM64 0 +#endif + #if IS_UTF8_IMPLEMENTATION_ARM64 @@ -1116,8 +1121,9 @@ template > struct base_u8 { return *this_cast; } - is_utf8_really_inline Mask operator==(const simd8 other) const { - return vceqq_u8(*this, other); + friend is_utf8_really_inline Mask operator==(const simd8 lhs, + const simd8 rhs) { + return vceqq_u8(lhs, rhs); } template @@ -2172,7 +2178,7 @@ namespace icelake {} // namespace icelake // We should not get warnings while including yet we do // under some versions of GCC. // If the x86intrin.h header has uninitialized values that are problematic, -// it is a GCC issue, we want to ignore these warnigns. +// it is a GCC issue, we want to ignore these warnings. IS_UTF8_DISABLE_GCC_WARNING(-Wuninitialized) #endif @@ -2342,8 +2348,11 @@ IS_UTF8_POP_DISABLE_WARNINGS #endif // To see why (__BMI__) && (__PCLMUL__) && (__LZCNT__) are not part of this // next line, see https://github.com/simdutf/simdutf/issues/1247 -#define IS_UTF8_CAN_ALWAYS_RUN_HASWELL \ - ((IS_UTF8_IMPLEMENTATION_HASWELL) && (IS_UTF8_IS_X86_64) && (__AVX2__)) +#if ((IS_UTF8_IMPLEMENTATION_HASWELL) && (IS_UTF8_IS_X86_64) && (__AVX2__)) +#define IS_UTF8_CAN_ALWAYS_RUN_HASWELL 1 +#else +#define IS_UTF8_CAN_ALWAYS_RUN_HASWELL 0 +#endif #if IS_UTF8_IMPLEMENTATION_HASWELL @@ -2398,7 +2407,7 @@ class implementation final : public is_utf8_internals::implementation { // We should not get warnings while including yet we do // under some versions of GCC. // If the x86intrin.h header has uninitialized values that are problematic, -// it is a GCC issue, we want to ignore these warnigns. +// it is a GCC issue, we want to ignore these warnings. IS_UTF8_DISABLE_GCC_WARNING(-Wuninitialized) #endif @@ -2539,8 +2548,9 @@ struct base8 : base> { is_utf8_really_inline T last() const { return _mm256_extract_epi8(*this, 31); } - is_utf8_really_inline Mask operator==(const simd8 other) const { - return _mm256_cmpeq_epi8(*this, other); + friend is_utf8_really_inline Mask operator==(const simd8 lhs, + const simd8 rhs) { + return _mm256_cmpeq_epi8(lhs, rhs); } static const int SIZE = sizeof(base::value); @@ -2965,8 +2975,9 @@ struct base16 : base> { is_utf8_really_inline base16(const Pointer *ptr) : base16(_mm256_loadu_si256(reinterpret_cast(ptr))) {} - is_utf8_really_inline Mask operator==(const simd16 other) const { - return _mm256_cmpeq_epi16(*this, other); + friend is_utf8_really_inline Mask operator==(const simd16 lhs, + const simd16 rhs) { + return _mm256_cmpeq_epi16(lhs, rhs); } /// the size of vector in bytes @@ -3340,9 +3351,11 @@ IS_UTF8_UNTARGET_REGION #endif -#define IS_UTF8_CAN_ALWAYS_RUN_WESTMERE \ - (IS_UTF8_IMPLEMENTATION_WESTMERE && IS_UTF8_IS_X86_64 && __SSE4_2__ && \ - __PCLMUL__) +#if IS_UTF8_IMPLEMENTATION_WESTMERE && IS_UTF8_IS_X86_64 && __SSE4_2__ && __PCLMUL__ +#define IS_UTF8_CAN_ALWAYS_RUN_WESTMERE 1 +#else +#define IS_UTF8_CAN_ALWAYS_RUN_WESTMERE 0 +#endif #if IS_UTF8_IMPLEMENTATION_WESTMERE @@ -3395,7 +3408,7 @@ class implementation final : public is_utf8_internals::implementation { // We should not get warnings while including yet we do // under some versions of GCC. // If the x86intrin.h header has uninitialized values that are problematic, -// it is a GCC issue, we want to ignore these warnigns. +// it is a GCC issue, we want to ignore these warnings. IS_UTF8_DISABLE_GCC_WARNING(-Wuninitialized) #endif @@ -3517,8 +3530,9 @@ struct base8 : base> { is_utf8_really_inline base8() : base>() {} is_utf8_really_inline base8(const __m128i _value) : base>(_value) {} - is_utf8_really_inline Mask operator==(const simd8 other) const { - return _mm_cmpeq_epi8(*this, other); + friend is_utf8_really_inline Mask operator==(const simd8 lhs, + const simd8 rhs) { + return _mm_cmpeq_epi8(lhs, rhs); } static const int SIZE = sizeof(base>::value); @@ -4032,8 +4046,9 @@ struct base16 : base> { is_utf8_really_inline base16(const Pointer *ptr) : base16(_mm_loadu_si128(reinterpret_cast(ptr))) {} - is_utf8_really_inline Mask operator==(const simd16 other) const { - return _mm_cmpeq_epi16(*this, other); + friend is_utf8_really_inline Mask operator==(const simd16 lhs, + const simd16 rhs) { + return _mm_cmpeq_epi16(lhs, rhs); } static const int SIZE = sizeof(base>::value); @@ -4407,7 +4422,11 @@ IS_UTF8_UNTARGET_REGION #endif #endif -#define IS_UTF8_CAN_ALWAYS_RUN_FALLBACK (IS_UTF8_IMPLEMENTATION_FALLBACK) +#if IS_UTF8_IMPLEMENTATION_FALLBACK +#define IS_UTF8_CAN_ALWAYS_RUN_FALLBACK 1 +#else +#define IS_UTF8_CAN_ALWAYS_RUN_FALLBACK 0 +#endif #if IS_UTF8_IMPLEMENTATION_FALLBACK From 8d159b34a470e2a2e31e9b4cfbdeb683912e2f69 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Fri, 10 May 2024 18:16:16 +0200 Subject: [PATCH 15/15] [dist] 6.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6c105ed..3546be1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "utf-8-validate", - "version": "6.0.3", + "version": "6.0.4", "description": "Check if a buffer contains valid UTF-8", "main": "index.js", "engines": {