Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b786ffb
Add thirdparty jemalloc
BossZou Sep 17, 2025
8aa1893
Build jemalloc
BossZou Sep 17, 2025
d72ccae
Fix build_deps.sh build jemalloc err
BossZou Sep 17, 2025
b0875ec
Fix
BossZou Sep 17, 2025
8f7fa3f
Try fix build jemalloc error
BossZou Sep 18, 2025
dbef79f
Build deps with parallel
BossZou Sep 18, 2025
c6dd789
Set build deps error exit
BossZou Sep 18, 2025
362fde9
Fix build_deps.sh error
BossZou Sep 18, 2025
67c8f8b
windows install autoconf
BossZou Sep 18, 2025
f6c46d2
Try fix windows autoconf
BossZou Sep 19, 2025
264237b
Try fix
BossZou Sep 19, 2025
3677d8d
Addd install msys2
BossZou Sep 19, 2025
f0d7614
Use cygwin to build jemalloc
BossZou Sep 19, 2025
eb72b2a
Fix windows run
BossZou Sep 19, 2025
80a675a
Keeping fix
BossZou Sep 19, 2025
af654d8
Try debug
BossZou Sep 19, 2025
9b0ef86
try fix windows
BossZou Sep 19, 2025
9abadea
Keeping fix
BossZou Sep 19, 2025
ad6e811
Print env
BossZou Sep 19, 2025
fdeb20d
Use cygwin bash
BossZou Sep 19, 2025
66b2516
export cygwin to path
BossZou Sep 19, 2025
581367e
export cygwin to path
BossZou Sep 19, 2025
638bce6
Fix
BossZou Sep 19, 2025
9de6b4e
Windows build
BossZou Sep 20, 2025
1bad972
Continue fix
BossZou Sep 20, 2025
05fd071
Debug more log
BossZou Sep 21, 2025
bbd85f4
Fix
BossZou Sep 21, 2025
79058ae
Sed -i
BossZou Sep 21, 2025
8ab840c
Windows install use msys2
BossZou Sep 21, 2025
3750968
use default bash
BossZou Sep 21, 2025
f086f98
Not supported on windows 11 arm
BossZou Nov 22, 2025
8bdb757
Try fix
BossZou Nov 22, 2025
077bca9
Fix
BossZou Nov 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
build:
runs-on: ubuntu-24.04
runs-on: windows-2025
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 autoconf
- name: Build Dependencies
shell: bash
run: |
Expand Down
37 changes: 35 additions & 2 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand All @@ -32,14 +33,46 @@ jobs:
# Details see: https://github.com/actions/checkout
with:
submodules: true
- name: Install required packages
uses: msys2/setup-msys2@v2
# Install essential tools/libs
# - autoconf used to build jemalloc
with:
update: true
install: >-
base-devel
autoconf
automake
libtool
make
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'
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: |
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.
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | | ✘ |
Expand Down
28 changes: 24 additions & 4 deletions bin/build_deps.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env bash

# exit shell if cmd fail
set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"

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"
Expand All @@ -16,11 +19,10 @@
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 \
Expand All @@ -32,3 +34,21 @@

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 ..."
JEMALLOC_ROOT_DIR="$THIRD_ROOT_DIR/jemalloc"
pushd "${JEMALLOC_ROOT_DIR}" >/dev/null || exit

## Build jemalloc
sh autogen.sh --prefix=${THIRD_DIST_DIR}

Check warning on line 49 in bin/build_deps.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

bin/build_deps.sh#L49

Double quote to prevent globbing and word splitting.
make
make install

popd >/dev/null || exit
fi
1 change: 1 addition & 0 deletions thirdparty/jemalloc
Submodule jemalloc added at 54eaed
Loading