From b786ffbced4d6aca1e21564cdff4b863659e91d1 Mon Sep 17 00:00:00 2001 From: BossZou Date: Wed, 17 Sep 2025 23:31:51 +0800 Subject: [PATCH 01/33] Add thirdparty jemalloc --- .gitmodules | 3 +++ thirdparty/jemalloc | 1 + 2 files changed, 4 insertions(+) create mode 160000 thirdparty/jemalloc diff --git a/.gitmodules b/.gitmodules index 950ee59..d351e8f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "thirdparty/regex"] path = thirdparty/regex url = https://github.com/boostorg/regex.git +[submodule "thirdparty/jemalloc"] + path = thirdparty/jemalloc + url = https://github.com/jemalloc/jemalloc.git diff --git a/thirdparty/jemalloc b/thirdparty/jemalloc new file mode 160000 index 0000000..54eaed1 --- /dev/null +++ b/thirdparty/jemalloc @@ -0,0 +1 @@ +Subproject commit 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c From 8aa18934e6c0f27df01030004dd5ddcd436f65a1 Mon Sep 17 00:00:00 2001 From: BossZou Date: Thu, 18 Sep 2025 00:27:27 +0800 Subject: [PATCH 02/33] Build jemalloc --- bin/build_deps.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bin/build_deps.sh b/bin/build_deps.sh index a6e5c40..808a129 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -32,3 +32,20 @@ else popd >/dev/null || exit fi + +if pkg-config --exists jemalloc; then + echo "jemalloc installed" + echo "version: $(pkg-config --modversion jemalloc)" + echo "cflags: $(pkg-config --cflags jemalloc)" + echo "libs: $(pkg-config --libs jemalloc)" +else + echo "jemalloc not installed, build and install now ..." + pushd "${PROJECT_ROOT_DIR}" >/dev/null || exit + + ## Build googletest + sh autogen.sh --prefix=${THIRD_DIST_DIR} + make + make install + + popd >/dev/null || exit +fi From d72ccae67f62ac2466f8ec8588a5cdc7acd0d381 Mon Sep 17 00:00:00 2001 From: BossZou Date: Thu, 18 Sep 2025 00:41:58 +0800 Subject: [PATCH 03/33] Fix build_deps.sh build jemalloc err --- bin/build_deps.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/build_deps.sh b/bin/build_deps.sh index 808a129..27a1b37 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -16,11 +16,10 @@ if pkg-config --exists gtest; then echo "libs: $(pkg-config --libs gtest)" else echo "googletest not installed, build and install now ..." - pushd "${PROJECT_ROOT_DIR}" >/dev/null || exit - - ## Build googletest GOOGLETEST_ROOT_DIR="$THIRD_ROOT_DIR/googletest" + pushd "${GOOGLETEST_ROOT_DIR}" >/dev/null || exit + ## Build googletest cmake -B "${GOOGLETEST_ROOT_DIR}/build" \ -S "${GOOGLETEST_ROOT_DIR}" \ -DCMAKE_BUILD_TYPE=Release \ @@ -40,9 +39,10 @@ if pkg-config --exists jemalloc; then echo "libs: $(pkg-config --libs jemalloc)" else echo "jemalloc not installed, build and install now ..." - pushd "${PROJECT_ROOT_DIR}" >/dev/null || exit + GOOGLETEST_ROOT_DIR="$THIRD_ROOT_DIR/jemalloc" + pushd "${GOOGLETEST_ROOT_DIR}" >/dev/null || exit - ## Build googletest + ## Build jemalloc sh autogen.sh --prefix=${THIRD_DIST_DIR} make make install From b0875ecc170921c33b747762bfcb90a3a1012789 Mon Sep 17 00:00:00 2001 From: BossZou Date: Thu, 18 Sep 2025 00:47:20 +0800 Subject: [PATCH 04/33] Fix --- bin/build_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/build_deps.sh b/bin/build_deps.sh index 27a1b37..7f186df 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -39,8 +39,8 @@ if pkg-config --exists jemalloc; then echo "libs: $(pkg-config --libs jemalloc)" else echo "jemalloc not installed, build and install now ..." - GOOGLETEST_ROOT_DIR="$THIRD_ROOT_DIR/jemalloc" - pushd "${GOOGLETEST_ROOT_DIR}" >/dev/null || exit + JEMALLOC_ROOT_DIR="$THIRD_ROOT_DIR/jemalloc" + pushd "${JEMALLOC_ROOT_DIR}" >/dev/null || exit ## Build jemalloc sh autogen.sh --prefix=${THIRD_DIST_DIR} From 8f7fa3f8e41f25ee934b5fee9a6ad54c756eb5e7 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 00:00:01 +0800 Subject: [PATCH 05/33] Try fix build jemalloc error --- .github/workflows/macos-build.yml | 6 ++++++ bin/build_deps.sh | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 7ddbb27..8b9cdba 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -34,6 +34,12 @@ jobs: # Details see: https://github.com/actions/checkout with: submodules: true + - name: Install Essentials + shell: bash + # Install essential tools/libs + # - autoconf used to build jemalloc + run: | + brew install -y autoconf - name: Build Dependencies shell: bash run: | diff --git a/bin/build_deps.sh b/bin/build_deps.sh index 7f186df..8b116b6 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# exit shell if cmd fail +set -x + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" From dbef79fc6357819869d5cfe8120b861e4bd18369 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 00:06:48 +0800 Subject: [PATCH 06/33] Build deps with parallel --- .github/workflows/macos-build.yml | 2 +- bin/build_deps.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 8b9cdba..2cb440e 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -39,7 +39,7 @@ jobs: # Install essential tools/libs # - autoconf used to build jemalloc run: | - brew install -y autoconf + brew install autoconf - name: Build Dependencies shell: bash run: | diff --git a/bin/build_deps.sh b/bin/build_deps.sh index 8b116b6..1eb1916 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -30,7 +30,7 @@ else -Dgtest_force_shared_crt=ON \ -DCMAKE_INSTALL_PREFIX="${THIRD_DIST_DIR}" - cmake --build "${GOOGLETEST_ROOT_DIR}/build" --config Release --target install + cmake --build "${GOOGLETEST_ROOT_DIR}/build" --config Release --target install -j $(nproc) popd >/dev/null || exit fi @@ -47,7 +47,7 @@ else ## Build jemalloc sh autogen.sh --prefix=${THIRD_DIST_DIR} - make + make -j $(nproc) make install popd >/dev/null || exit From c6dd789dde9713984d9881577f8b40772ff2c953 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 00:29:28 +0800 Subject: [PATCH 07/33] Set build deps error exit --- .github/workflows/windows-build.yml | 6 ++++++ bin/build_deps.sh | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 27e1285..1a1a083 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,6 +32,12 @@ jobs: # Details see: https://github.com/actions/checkout with: submodules: true + - name: Install Essentials + shell: bash + # Install essential tools/libs + # - autoconf used to build jemalloc + run: | + choco install autoconf - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' diff --git a/bin/build_deps.sh b/bin/build_deps.sh index 1eb1916..b922493 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # exit shell if cmd fail -set -x +set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" From 362fde9a9df386bcf3c19339cdbb0ef901a37e27 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 00:33:08 +0800 Subject: [PATCH 08/33] Fix build_deps.sh error --- bin/build_deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build_deps.sh b/bin/build_deps.sh index b922493..e2dd5ab 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -10,7 +10,7 @@ THIRD_ROOT_DIR="$PROJECT_ROOT_DIR/thirdparty" THIRD_DIST_DIR="$PROJECT_ROOT_DIR/dist" THIRD_DIST_PKG_CONFIG_DIR="$THIRD_DIST_DIR/lib/pkgconfig" -export PKG_CONFIG_PATH="${THIRD_DIST_PKG_CONFIG_DIR}:${PKG_CONFIG_PATH}" +export PKG_CONFIG_PATH="${THIRD_DIST_PKG_CONFIG_DIR}:${PKG_CONFIG_PATH:-}" if pkg-config --exists gtest; then echo "googletest installed" From 67c8f8b9e297368054f87e73a4c084a32b65bdf1 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 00:42:18 +0800 Subject: [PATCH 09/33] windows install autoconf --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 1a1a083..2276a44 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -33,11 +33,11 @@ jobs: with: submodules: true - name: Install Essentials - shell: bash # Install essential tools/libs # - autoconf used to build jemalloc run: | - choco install autoconf + C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" + C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm autoconf" - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' From f6c46d2b17a77a097e725c1ded397ff255f8d1fd Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 09:25:39 +0800 Subject: [PATCH 10/33] Try fix windows autoconf --- .github/workflows/windows-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 2276a44..8bcce19 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -38,6 +38,8 @@ jobs: run: | C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm autoconf" + + echo "C:\msys64\usr\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' From 264237be41bf27e038ecc8581f153f7ff3c640b7 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 09:29:38 +0800 Subject: [PATCH 11/33] Try fix --- .github/workflows/windows-build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 8bcce19..5260b91 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -38,15 +38,13 @@ jobs: run: | C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm autoconf" - - echo "C:\msys64\usr\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies - shell: bash + shell: msys2 {0} # use MSYS2 as default shell run: | bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings From 3677d8de19c3886d7b83ee927796df308dcaefa3 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 21:07:03 +0800 Subject: [PATCH 12/33] Addd install msys2 --- .github/workflows/windows-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 5260b91..ab70b26 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,6 +32,10 @@ jobs: # Details see: https://github.com/actions/checkout with: submodules: true + - name: Install msys2 + if: matrix.os == 'windows-11-arm' + run: | + choco install msys2 -y --no-progress - name: Install Essentials # Install essential tools/libs # - autoconf used to build jemalloc From f0d7614d79817b70836aa488e550435b082ee78e Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 21:22:54 +0800 Subject: [PATCH 13/33] Use cygwin to build jemalloc --- .github/workflows/windows-build.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index ab70b26..f94082a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,23 +32,27 @@ jobs: # Details see: https://github.com/actions/checkout with: submodules: true - - name: Install msys2 - if: matrix.os == 'windows-11-arm' - run: | - choco install msys2 -y --no-progress - - name: Install Essentials + - name: Install Cygwin with required packages # Install essential tools/libs # - autoconf used to build jemalloc run: | - C:\msys64\usr\bin\bash -lc "pacman -Syu --noconfirm" - C:\msys64\usr\bin\bash -lc "pacman -S --noconfirm autoconf" + choco install cygwin -y --no-progress + $CYGWIN_ROOT = "C:\cygwin64" + & "$CYGWIN_ROOT\setup-x86_64.exe" ^ + --root "$CYGWIN_ROOT" ^ + --site "http://mirrors.kernel.org/sourceware/cygwin/" ^ + --packages autoconf,autogen,gawk,grep,sed ^ + --quiet-mode ^ + --no-desktop ^ + --no-startmenu ^ + --no-shortcuts + echo "C:\cygwin64\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies - shell: msys2 {0} # use MSYS2 as default shell run: | bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings From eb72b2ac32dd5414987881670ba36f48d0a4b6c8 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 21:32:54 +0800 Subject: [PATCH 14/33] Fix windows run --- .github/workflows/windows-build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index f94082a..49d9195 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -38,13 +38,13 @@ jobs: run: | choco install cygwin -y --no-progress $CYGWIN_ROOT = "C:\cygwin64" - & "$CYGWIN_ROOT\setup-x86_64.exe" ^ - --root "$CYGWIN_ROOT" ^ - --site "http://mirrors.kernel.org/sourceware/cygwin/" ^ - --packages autoconf,autogen,gawk,grep,sed ^ - --quiet-mode ^ - --no-desktop ^ - --no-startmenu ^ + & "$CYGWIN_ROOT\setup-x86_64.exe" ` + --root "$CYGWIN_ROOT" ` + --site "http://mirrors.kernel.org/sourceware/cygwin/" ` + --packages autoconf,autogen,gawk,grep,sed ` + --quiet-mode ` + --no-desktop ` + --no-startmenu ` --no-shortcuts echo "C:\cygwin64\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link From 80a675a164c20596f667c90672a3ebc661e7e7e5 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 21:47:39 +0800 Subject: [PATCH 15/33] Keeping fix --- .github/workflows/windows-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 49d9195..9c1922c 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -37,7 +37,7 @@ jobs: # - autoconf used to build jemalloc run: | choco install cygwin -y --no-progress - $CYGWIN_ROOT = "C:\cygwin64" + $CYGWIN_ROOT = "C:\tools\cygwin" & "$CYGWIN_ROOT\setup-x86_64.exe" ` --root "$CYGWIN_ROOT" ` --site "http://mirrors.kernel.org/sourceware/cygwin/" ` @@ -46,7 +46,7 @@ jobs: --no-desktop ` --no-startmenu ` --no-shortcuts - echo "C:\cygwin64\bin" >> $GITHUB_PATH + echo "C:\tools\cygwin\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' From af654d81d88ad5bb35774eecb92460e811bcabc0 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 21:59:49 +0800 Subject: [PATCH 16/33] Try debug --- .github/workflows/debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 9bbf8e7..1603e84 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: ubuntu-24.04 + runs-on: windows-2025 steps: - name: Checkout code uses: actions/checkout@v4 From 9b0ef86656ea565d77ca6f85059c0f650d48635f Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 22:08:41 +0800 Subject: [PATCH 17/33] try fix windows --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 9c1922c..3f5f7cb 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -38,7 +38,7 @@ jobs: run: | choco install cygwin -y --no-progress $CYGWIN_ROOT = "C:\tools\cygwin" - & "$CYGWIN_ROOT\setup-x86_64.exe" ` + & "$CYGWIN_ROOT\cygwinsetup.exe" ` --root "$CYGWIN_ROOT" ` --site "http://mirrors.kernel.org/sourceware/cygwin/" ` --packages autoconf,autogen,gawk,grep,sed ` From 9abadea491689f4deb73d93a9b3ae8633a356f22 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 22:24:16 +0800 Subject: [PATCH 18/33] Keeping fix --- .github/workflows/windows-build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 3f5f7cb..c2bfb5b 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -37,6 +37,7 @@ jobs: # - autoconf used to build jemalloc run: | choco install cygwin -y --no-progress + refreshenv $CYGWIN_ROOT = "C:\tools\cygwin" & "$CYGWIN_ROOT\cygwinsetup.exe" ` --root "$CYGWIN_ROOT" ` @@ -46,7 +47,7 @@ jobs: --no-desktop ` --no-startmenu ` --no-shortcuts - echo "C:\tools\cygwin\bin" >> $GITHUB_PATH + echo "$CYGWIN_ROOT\bin" >> $GITHUB_PATH - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' From ad6e81149e076634f1c6e0caa0e2d231af6efbdb Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 22:31:12 +0800 Subject: [PATCH 19/33] Print env --- .github/workflows/windows-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index c2bfb5b..9b45c2a 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -55,6 +55,8 @@ jobs: cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies run: | + echo "Current PATH:" + echo $env:PATH bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From fdeb20d6fd4ffec156f99a95afebcdebdacb1587 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 22:58:31 +0800 Subject: [PATCH 20/33] Use cygwin bash --- .github/workflows/windows-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 9b45c2a..41ffb5c 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -54,6 +54,7 @@ jobs: run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies + shell: C:\tools\cygwin\bin\bash.exe --login {0} run: | echo "Current PATH:" echo $env:PATH From 66b25168d7101dfc713029c329dc687a04d11452 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 23:03:21 +0800 Subject: [PATCH 21/33] export cygwin to path --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 41ffb5c..16fef03 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -54,8 +54,8 @@ jobs: run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies - shell: C:\tools\cygwin\bin\bash.exe --login {0} run: | + export PATH="/c/tools/cygwin/bin:$PATH" echo "Current PATH:" echo $env:PATH bash '${{ github.workspace }}/bin/build_deps.sh' From 581367ea8bf3668a851d8500012039a97bc69dd0 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 23:10:28 +0800 Subject: [PATCH 22/33] export cygwin to path --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 16fef03..9bf602b 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -55,7 +55,7 @@ jobs: cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies run: | - export PATH="/c/tools/cygwin/bin:$PATH" + $env:PATH = "C:\tools\cygwin\bin;$env:PATH" echo "Current PATH:" echo $env:PATH bash '${{ github.workspace }}/bin/build_deps.sh' From 638bce6db169cc3861cb31394c39c1d1d4a6f4b4 Mon Sep 17 00:00:00 2001 From: BossZou Date: Fri, 19 Sep 2025 23:22:22 +0800 Subject: [PATCH 23/33] Fix --- .github/workflows/windows-build.yml | 9 +++++++-- bin/build_deps.sh | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 9bf602b..b12b05b 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -56,8 +56,13 @@ jobs: - name: Build Dependencies run: | $env:PATH = "C:\tools\cygwin\bin;$env:PATH" - echo "Current PATH:" - echo $env:PATH + $scriptPath = "${{ github.workspace }}/bin/build_deps.sh" + if (Test-Path $scriptPath) { + $content = Get-Content -Raw $scriptPath + $content = $content -replace "`r`n", "`n" + Set-Content -Path $scriptPath -Value $content -NoNewline + Write-Host "Fixed line endings in build_deps.sh" + } bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. diff --git a/bin/build_deps.sh b/bin/build_deps.sh index e2dd5ab..47f39bc 100644 --- a/bin/build_deps.sh +++ b/bin/build_deps.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # exit shell if cmd fail -set -euo pipefail +set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" @@ -30,7 +30,7 @@ else -Dgtest_force_shared_crt=ON \ -DCMAKE_INSTALL_PREFIX="${THIRD_DIST_DIR}" - cmake --build "${GOOGLETEST_ROOT_DIR}/build" --config Release --target install -j $(nproc) + cmake --build "${GOOGLETEST_ROOT_DIR}/build" --config Release --target install popd >/dev/null || exit fi @@ -47,7 +47,7 @@ else ## Build jemalloc sh autogen.sh --prefix=${THIRD_DIST_DIR} - make -j $(nproc) + make make install popd >/dev/null || exit From 9de6b4e8e1c551e666f6c6e7f153320073bbb71e Mon Sep 17 00:00:00 2001 From: BossZou Date: Sat, 20 Sep 2025 22:29:23 +0800 Subject: [PATCH 24/33] Windows build --- .github/workflows/windows-build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b12b05b..ba8ebe8 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -54,15 +54,10 @@ jobs: run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies + shell: bash run: | - $env:PATH = "C:\tools\cygwin\bin;$env:PATH" + export PATH="/c/tools/cygwin/bin:$PATH" $scriptPath = "${{ github.workspace }}/bin/build_deps.sh" - if (Test-Path $scriptPath) { - $content = Get-Content -Raw $scriptPath - $content = $content -replace "`r`n", "`n" - Set-Content -Path $scriptPath -Value $content -NoNewline - Write-Host "Fixed line endings in build_deps.sh" - } bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 1bad9725662f5830f0be82708aa2cd75e3f74731 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sat, 20 Sep 2025 22:54:42 +0800 Subject: [PATCH 25/33] Continue fix --- .github/workflows/windows-build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index ba8ebe8..129f5d2 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -56,8 +56,7 @@ jobs: - name: Build Dependencies shell: bash run: | - export PATH="/c/tools/cygwin/bin:$PATH" - $scriptPath = "${{ github.workspace }}/bin/build_deps.sh" + export PATH="C:\tools\cygwin\bin:$PATH" bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 05fd071701c074aeed50b991d18923bc17c81d47 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sun, 21 Sep 2025 09:21:12 +0800 Subject: [PATCH 26/33] Debug more log --- .github/workflows/windows-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 129f5d2..d2a4896 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -57,6 +57,7 @@ jobs: shell: bash run: | export PATH="C:\tools\cygwin\bin:$PATH" + echo "$PATH" bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From bbd85f41d35ee25678e4a9f5b50039b531632327 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sun, 21 Sep 2025 09:26:02 +0800 Subject: [PATCH 27/33] Fix --- .github/workflows/windows-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index d2a4896..2201c62 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -56,7 +56,7 @@ jobs: - name: Build Dependencies shell: bash run: | - export PATH="C:\tools\cygwin\bin:$PATH" + export PATH="/c/tools/cygwin/bin:$PATH" echo "$PATH" bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings From 79058ae32b580ae586d2bf6d07d6b76f7e420700 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sun, 21 Sep 2025 09:50:22 +0800 Subject: [PATCH 28/33] Sed -i --- .github/workflows/windows-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 2201c62..3a73cb1 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -58,6 +58,7 @@ jobs: run: | export PATH="/c/tools/cygwin/bin:$PATH" echo "$PATH" + sed -i 's/\r$//' '${{ github.workspace }}/bin/build_deps.sh' bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 8ab840c0b85cf52d96cf273a099a2c097fed16e3 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sun, 21 Sep 2025 13:46:53 +0800 Subject: [PATCH 29/33] Windows install use msys2 --- .github/workflows/windows-build.yml | 30 ++++++++++++----------------- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 3a73cb1..b16417e 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -32,33 +32,27 @@ jobs: # Details see: https://github.com/actions/checkout with: submodules: true - - name: Install Cygwin with required packages + - name: Install required packages + uses: msys2/setup-msys2@v2 # Install essential tools/libs # - autoconf used to build jemalloc - run: | - choco install cygwin -y --no-progress - refreshenv - $CYGWIN_ROOT = "C:\tools\cygwin" - & "$CYGWIN_ROOT\cygwinsetup.exe" ` - --root "$CYGWIN_ROOT" ` - --site "http://mirrors.kernel.org/sourceware/cygwin/" ` - --packages autoconf,autogen,gawk,grep,sed ` - --quiet-mode ` - --no-desktop ` - --no-startmenu ` - --no-shortcuts - echo "$CYGWIN_ROOT\bin" >> $GITHUB_PATH + with: + update: true + install: >- + base-devel + autoconf + automake + libtool + make + gcc - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies - shell: bash + shell: msys2 {0} run: | - export PATH="/c/tools/cygwin/bin:$PATH" - echo "$PATH" - sed -i 's/\r$//' '${{ github.workspace }}/bin/build_deps.sh' bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 375096856335bdf525a5f8d6c7365d8f8ec47411 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sun, 21 Sep 2025 14:06:00 +0800 Subject: [PATCH 30/33] use default bash --- .github/workflows/windows-build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index b16417e..f308c67 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -51,7 +51,6 @@ jobs: run: | cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies - shell: msys2 {0} run: | bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings From f086f98c186d75165d63093680b64b4996489bdd Mon Sep 17 00:00:00 2001 From: BossZou Date: Sat, 22 Nov 2025 11:41:00 +0800 Subject: [PATCH 31/33] Not supported on windows 11 arm --- .github/workflows/windows-build.yml | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index f308c67..85149b5 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -22,7 +22,8 @@ jobs: fail-fast: false matrix: # The support os can see: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#choosing-github-hosted-runners - os: [ windows-2025, windows-11-arm ] + ## jemalloc not available windows-11-arm + os: [ windows-2025 ] build_type: [ Release ] c_compiler: [ cl] cpp_compiler: [ cl ] diff --git a/README.md b/README.md index 54c9473..045e083 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This section describes how to add `jaclks` as a dependency to your C++ project. | Ubuntu-22.04 | x64, ARM64 | [gcc, g++] | ✔ | | Ubuntu-24.04 | x64, ARM64 | [gcc, g++] | ✔ | | Windows 2025 | x64 | [cl, cl] | ✔ | -| Windows 11 | ARM64 | [cl, cl] | ✔ | +| Windows 11 | ARM64 | [cl, cl] | ✘ | | MacOS 13 | x64 | [gcc, g++] | ✔ | | MacOS 15 | ARM64 | [gcc, g++] | ✔ | | Linux - Others | Not supported | | ✘ | From 8bdb7573e135d3ce38b358bbf0a014e7e4d6dbc3 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sat, 22 Nov 2025 12:01:22 +0800 Subject: [PATCH 32/33] Try fix --- .github/workflows/windows-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 85149b5..80ee516 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -46,6 +46,8 @@ jobs: libtool make gcc + perl + perl-Pod-Usage - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm' @@ -53,6 +55,7 @@ jobs: cmd /c mklink /D "C:/Program Files/OpenSSL/lib/VC/x64" "C:/Program Files/OpenSSL/lib/VC/arm64" - name: Build Dependencies run: | + export PATH="/c/msys64/usr/bin:/c/msys64/mingw64/bin:$PATH" bash '${{ github.workspace }}/bin/build_deps.sh' - name: Set Reusable Strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. From 077bca98e8b7174c0fe5df955f19e3229f355a75 Mon Sep 17 00:00:00 2001 From: BossZou Date: Sat, 22 Nov 2025 12:07:01 +0800 Subject: [PATCH 33/33] Fix --- .github/workflows/windows-build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 80ee516..2f2e3d7 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -48,6 +48,23 @@ jobs: gcc perl perl-Pod-Usage + - name: Set up MSYS2 environment + shell: bash + # 确保MSYS2工具在PATH中 + run: | + echo "C:/msys64/usr/bin" >> $GITHUB_PATH + echo "C:/msys64/mingw64/bin" >> $GITHUB_PATH + + - name: Verify tools + shell: bash + # 验证工具是否可用 + run: | + which autoconf + autoconf --version + which perl + perl --version + which make + make --version - name: Create arm64 lib soft link # cmake not find libs in */lib/*/arm64/* folders, create soft link to fix it if: matrix.os == 'windows-11-arm'