Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
ce1b6df
feat: Add C ABI for embedded seekdb (multi‑language SDKs)
dengfuping Jan 28, 2026
01a9b14
refactor(seekdb): remove seekdb_row_free API and align row lifetime w…
dengfuping Jan 29, 2026
3a47572
fix(build): only create the seekdb library in BUILD_EMBED_MODE
dengfuping Jan 28, 2026
19cf0ec
improve(include): libseekdb support macos build
dengfuping Jan 28, 2026
4b8ca2f
fix(build): specify DPYTHON_VERSION to build libseekdb
dengfuping Jan 28, 2026
d80c2fc
fix(ci): make seekdb => make libseekdb
dengfuping Jan 29, 2026
bbfd6ac
fix(ci): build cache should work
dengfuping Jan 29, 2026
58be1aa
improve(include): generate macOS export list from seekdb.h and fix te…
dengfuping Jan 29, 2026
5e5ea84
fix(embed): VARBINARY_ID param binding and fix parameterized query re…
dengfuping Jan 29, 2026
74feed2
fix(embed): return VECTOR column as JSON string without rounding (e.g…
dengfuping Jan 29, 2026
ac57a17
improve(ci): use build_debug for libseekdb
dengfuping Jan 29, 2026
68f3c2f
fix(include): remove unimplemented API declarations from seekdb.h
dengfuping Jan 29, 2026
a4f8d52
fix(embed): suppress "successfully init log writer" by redirecting st…
dengfuping Jan 30, 2026
be07d23
feat(embedded): support 100KB document; LOB in-row via session var; f…
dengfuping Jan 30, 2026
2968178
c-api: improve LOB and metadata handling for embedded mode
dengfuping Jan 30, 2026
dca48a3
feat(package): add libseekdb build script and zip packaging
dengfuping Jan 30, 2026
7a53af1
feat(ci): Add build-libseekdb.yml
dengfuping Jan 30, 2026
1bd1cb2
ci(libseekdb): multi-platform build, S3 upload, CentOS 7/macOS 11+ co…
dengfuping Jan 30, 2026
fee1009
ci(libseekdb): switch macOS runner from macos-13 to macos-14, update …
dengfuping Jan 30, 2026
985a640
ci(libseekdb): add git safe.directory in Linux container to fix dubio…
dengfuping Jan 30, 2026
dae2642
ci(libseekdb): fix make receiving -D options by dropping --make, run …
dengfuping Jan 30, 2026
dc93cb6
ci(libseekdb): add ccache cache for Linux and macOS builds
dengfuping Jan 30, 2026
d4223c6
ci(libseekdb): detect runner Python first, install if not usable; set…
dengfuping Jan 30, 2026
5f42517
ci(libseekdb): fix macOS/Linux ccache and Linux wget for manylinux build
dengfuping Jan 30, 2026
2c75910
ci(libseekdb): update build-libseekdb workflow
dengfuping Jan 30, 2026
bd13837
ci(libseekdb): install pybind11 via brew for macOS embed build
dengfuping Jan 30, 2026
512b612
ci(libseekdb): checkout PR head, restore darwin-x64; Env.cmake fix ma…
dengfuping Jan 30, 2026
3be118d
ci(libseekdb): save deps/ccache cache on failure (if: always())
dengfuping Jan 30, 2026
dad7d50
fix(libseekdb): Linux pack path; disable QPL on macOS
dengfuping Jan 30, 2026
2288133
ci(libseekdb): add macOS Homebrew deps (utf8proc, thrift, re2, brotli…
dengfuping Jan 31, 2026
eaeb90e
ci(libseekdb): remove macOS x64 (darwin-x64) build and related adapt …
dengfuping Jan 31, 2026
0d1371b
ci(libseekdb): fix Linux ccache symlink same-file error, resolve ccac…
dengfuping Jan 31, 2026
f32478c
fix(buildbase): build libseekdb in build_release not build_debug for …
dengfuping Jan 31, 2026
456c89b
feat(embed): absolute path reuse and DDL visibility refresh for listC…
dengfuping Feb 2, 2026
b2e3791
ci(libseekdb): tune ccache (CCACHE_COMPILERCHECK=content, CCACHE_NOHA…
dengfuping Feb 2, 2026
3cc0442
fix(embed): align log and stdout redirect with Python embed
dengfuping Feb 3, 2026
3ee2772
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 3, 2026
a613e1d
fix(embed): align schema refresh with MySQL protocol (check-and-refre…
dengfuping Feb 3, 2026
ca0b4cd
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 3, 2026
dc7cc9a
ci(libseekdb): use merge-multiple for artifacts, upload S3 without ex…
dengfuping Feb 4, 2026
6dd301a
test(bindings): run full suite with absolute path (second run), add t…
dengfuping Feb 4, 2026
d6172a9
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
f76b250
ci(libseekdb): fix cache keys for deps/ccache so second run hits
dengfuping Feb 4, 2026
c067fdd
package(libseekdb): improve macOS dylib bundle and @loader_path restore
dengfuping Feb 4, 2026
079c2cb
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
eff01a9
ci(buildbase): use system compiler for node-gyp N-API to avoid bits/l…
dengfuping Feb 4, 2026
a503822
fix(embed): suppress LOG_STDOUT (successfully init log writer) via RA…
dengfuping Feb 4, 2026
8cb64ff
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
71aa7ed
fix(nodejs_napi): npm audit fix for brace-expansion and tar vulnerabi…
dengfuping Feb 4, 2026
e876e7f
fix(ci): use actual built commit sha for libseekdb run-name and S3 paths
dengfuping Feb 5, 2026
2e91bc6
improve(ci): libseekdb workflow manual run and trigger on workflow fi…
dengfuping Feb 11, 2026
b6d6fed
Merge branch, resolve zlib_lite deletion conflict
dengfuping Feb 11, 2026
862e027
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Feb 13, 2026
7fc68ae
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Feb 24, 2026
af84c4b
fix(storage): add explicit instantiation of build_range_array<ObStore…
dengfuping Feb 24, 2026
d6cb94b
fix(embed): recognize cleanup segfaults after close and reinstall SIG…
dengfuping Feb 25, 2026
ea10c8b
ci(libseekdb): add macOS code signing with Developer ID, entitlements…
dengfuping Feb 25, 2026
ea9e274
ci(libseekdb): run binding tests in each build job, trigger on all br…
dengfuping Feb 27, 2026
9169c43
ci(buildbase): restore debug-only build and remove ccache restore-keys
dengfuping Feb 27, 2026
da76ee8
fix(ci): avoid env context in workflow top-level to fix Unrecognized …
dengfuping Feb 27, 2026
7190df3
map ObObjType to SEEKDB_TYPE in result set field metadata for C API c…
dengfuping Feb 28, 2026
4edd75e
fix(ci): skip macOS cert import when empty, fallback to ad-hoc signing
dengfuping Feb 28, 2026
e56d81c
ci(compile): remove Node.js, Rust, Go setup and python3-pip from ubun…
dengfuping Mar 2, 2026
1b25036
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 2, 2026
2bd8454
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 5, 2026
449b889
Add Java JNI binding for libseekdb embedded mode
dengfuping Mar 5, 2026
58efc37
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 6, 2026
7f4681a
Add SIGABRT handler for graceful exit during embedded DB cleanup on m…
dengfuping Mar 9, 2026
f7004a6
Move Java setup step after Go setup in build-libseekdb workflow
dengfuping Mar 9, 2026
0b59f8f
Add SIGBUS handler for graceful exit during embedded DB cleanup on macOS
dengfuping Mar 11, 2026
c1a508a
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 11, 2026
9bfd905
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 25, 2026
f8021ec
chore(merge): Merge master branch and fix conflicts
dengfuping Mar 29, 2026
a92963f
feat(android): add libseekdb arm64-v8a CI, NDK toolchain glob, and pa…
dengfuping Mar 29, 2026
7ac6f56
fix(ci): use r27d for setup-ndk to avoid NDK download 404
dengfuping Mar 29, 2026
ab6ae23
fix(build): resolve cmake from devtools or PATH on Linux for Android CI
dengfuping Mar 29, 2026
73e1d23
fix(deps): suppress GNU tar unknown PAX header warnings when unpacking
dengfuping Mar 29, 2026
1eff8b7
fix(build): fall back to PATH for ccache when devtools has none
dengfuping Mar 30, 2026
cdf03fc
fix(android): guard TMPFS_MAGIC for NDK headers; run libseekdb CI on …
dengfuping Mar 30, 2026
f6704b1
fix(android): use NDK llvm-strip for libseekdb when host strip cannot…
dengfuping Mar 30, 2026
e47c9c1
fix(android): embed-safe CPU and signal handling, skip RS tablet repo…
dengfuping Apr 16, 2026
38e67f6
fix(android): rollback orphan inner transaction state before seekdb_b…
dengfuping Apr 16, 2026
d30feb0
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Apr 26, 2026
5bae035
feat(libseekdb): add Windows DLL link, packaging, CI jobs and PS bind…
dengfuping Apr 23, 2026
b31d5a7
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Apr 26, 2026
4c94261
test(libseekdb): clarify Windows post-Python binding steps; skip flus…
dengfuping Apr 26, 2026
e6891c3
ci(libseekdb): scope push to long-lived branches to avoid duplicate P…
dengfuping Apr 26, 2026
0d783e6
fix(libseekdb): Windows libseekdb binding — split CI & timeouts, in-p…
dengfuping Apr 30, 2026
767c79d
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 13, 2026
68c7338
修复了windows版本sstable超过2g就崩溃的问题
May 13, 2026
ed51091
修复decode_trace_id 仅解析出 IP,端口恒为 0
May 13, 2026
47f85ac
修复了epoll和waspoll导致的kill行为不同的问题
May 13, 2026
19bb7e0
use malloc v1 as the default allocator
May 13, 2026
788d344
merge some memory contexts to reduce memory usage
May 13, 2026
91f80b5
support adaptive worker pool
May 14, 2026
9fc1f08
fix: create LOB aux tables after hybrid vec index adds LOB columns
May 14, 2026
fb611ec
Implement Windows pl handler
May 14, 2026
2bd7794
reduce idle memory usage especially in embedded mode
May 14, 2026
bd7c964
refrator simple_thread_pool adaptive strategy
May 14, 2026
2a397c8
optimize memstore memory usage in idle mode
May 14, 2026
d83332d
fix mac compilation error and remove orc dependency
May 15, 2026
a83fd30
fix(libseekdb): Windows DLL discovery, embed Python without Python3::…
dengfuping May 15, 2026
23a56e4
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 15, 2026
40fcfa9
fix worker use-after-free and add missing lock in th_worker
May 18, 2026
fa1fdef
fix windows compilation error
May 18, 2026
d60d645
fix(thread,sql,objit,libseekdb): embed parquet/Win JIT stub; Android …
dengfuping May 15, 2026
4987cfb
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 18, 2026
b62eebd
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 19, 2026
301433f
fix(build): macOS GTest linking, thread destroy_stack ifdef, libseekd…
dengfuping May 19, 2026
33faaf5
fix(embed): enable async change stream indexing, vsag, and C API stri…
dengfuping May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
901 changes: 901 additions & 0 deletions .github/workflows/build-libseekdb.yml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ tools/ob-configserver/bin/*
tools/ob-configserver/tests/*.log
tools/ob-configserver/tests/*.out

############# package/libseekdb #############
package/libseekdb/libseekdb-*.zip

## .NET Configurator build output (rebuilt by dotnet publish)
tools/windows/seekdbConfigurator/bin/
tools/windows/seekdbConfigurator/obj/
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ project("OceanBase"
HOMEPAGE_URL "https://www.oceanbase.ai"
LANGUAGES CXX C ASM)

# Android NDK toolchain / defaults may pin C++17 after project(); enforce C++20 for language features (e.g. consteval).
if(ANDROID)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
endif()

if(WIN32)
find_program(LLVM_LIB_PROGRAM llvm-lib)
if(LLVM_LIB_PROGRAM)
Expand Down Expand Up @@ -130,6 +137,7 @@ endif()

add_subdirectory(deps/oblib)
add_subdirectory(src/objit)
include(${CMAKE_SOURCE_DIR}/cmake/EnsureWindowsDiaGuids.cmake)
add_subdirectory(src)
add_subdirectory(sqlite-benchmark)

Expand Down
109 changes: 95 additions & 14 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ $Action = "debug"
$Ninja = $false
$Init = $false
$Jobs = 0
$h = $false
$h = $false
$NinjaTarget = "observer"
$ExtraCmake = @()

$i = 0
while ($i -lt $args.Count) {
Expand All @@ -27,12 +29,17 @@ while ($i -lt $args.Count) {
{ $_ -in "-h", "--help", "-help" } { $h = $true }
{ $_ -in "--ninja", "-ninja" } { $Ninja = $true }
{ $_ -in "--init", "-init" } { $Init = $true }
{ $_ -in "--target" } {
$i++
if ($i -lt $args.Count) { $NinjaTarget = "$($args[$i])" }
}
{ $_ -in "-j", "--jobs" } {
$i++
if ($i -lt $args.Count) { $Jobs = [int]$args[$i] }
}
default {
if (-not $a.StartsWith("-")) { $Action = $a }
elseif ($a.StartsWith("-D")) { $ExtraCmake += $a }
else { Write-Host "[build.ps1][WARN] Unknown flag: $a" -ForegroundColor Yellow }
}
}
Expand Down Expand Up @@ -181,6 +188,7 @@ Usage:
.\build.ps1 [BuildType] --ninja Configure + compile (ninja)
.\build.ps1 [BuildType] --ninja -j 16 Compile with 16 jobs
.\build.ps1 [BuildType] --ninja --init Init deps, then build
.\build.ps1 release --ninja --target libseekdb Build embed DLL (example)
.\build.ps1 package Build release + MSI/ZIP installer

BuildType:
Expand All @@ -191,6 +199,8 @@ BuildType:
Flags:
--ninja Configure + compile with Ninja
--init Run dependency init before building (like build.sh --init)
--target NAME Ninja target (default: observer); e.g. libseekdb
-DVAR=VALUE Extra CMake cache entries (repeatable); e.g. -DBUILD_EMBED_MODE=ON

Environment variables (override dependency paths):
OB_VCPKG_DIR vcpkg install root (default: deps/3rd or C:/VcpkgInstalled)
Expand Down Expand Up @@ -286,7 +296,13 @@ function Do-Build {
[string[]]$ExtraCMakeArgs = @()
)

$buildDir = "$TOPDIR\build_$($BuildType.ToLower())"
# Align directory names with build.sh: release -> build_release, debug -> build_debug
$folderName = switch ($BuildType) {
"RelWithDebInfo" { "release" }
"Debug" { "debug" }
default { $BuildType.ToLower() }
}
$buildDir = "$TOPDIR\build_$folderName"
if (-not (Test-Path $buildDir)) {
New-Item -ItemType Directory -Path $buildDir | Out-Null
}
Expand All @@ -300,9 +316,9 @@ function Do-Build {
"-DOB_VCPKG_DIR=$DefaultVcpkgDir",
"-DOB_OPENSSL_DIR=$DefaultOpenSSLDir",
"-DOB_LLVM_DIR=$DefaultLLVMDir"
) + $ExtraCMakeArgs
) + $ExtraCMakeArgs + $ExtraCmake

Write-Log "CMake configure: build_$($BuildType.ToLower())"
Write-Log "CMake configure: build_$folderName"
Write-Log " Build type : $BuildType"
Write-Log " VcpkgDir : $DefaultVcpkgDir"
Write-Log " OpenSSLDir : $DefaultOpenSSLDir"
Expand All @@ -311,13 +327,54 @@ function Do-Build {

Push-Location $buildDir
try {
& cmake @cmakeArgs | Out-Host
if ($LASTEXITCODE -ne 0) {
Write-Err "CMake configure failed (exit code $LASTEXITCODE)"
exit $LASTEXITCODE
function Invoke-CMakeConfigure {
& cmake @cmakeArgs | Out-Host
return $LASTEXITCODE
}

$exit = Invoke-CMakeConfigure
if ($exit -ne 0) {
Write-Err "CMake configure failed (exit code $exit)"
exit $exit
}
Write-Log "CMake configure succeeded."

# Facts from CI: CMakeCache can say CMAKE_GENERATOR=Ninja while no *.ninja exists (incomplete/stale tree).
# Recover once by wiping cache + CMakeFiles and re-running cmake.
function Test-HasNinjaBuildFiles {
param([string]$Dir)
if (Test-Path (Join-Path $Dir "build.ninja")) { return $true }
try {
$nf = [System.IO.Directory]::GetFiles($Dir, "*.ninja", [System.IO.SearchOption]::TopDirectoryOnly)
return ($nf.Length -gt 0)
} catch {
return $false
}
}

if (-not (Test-HasNinjaBuildFiles -Dir $buildDir)) {
Write-Log "[build.ps1] No Ninja build files after configure; clearing CMakeCache + CMakeFiles and re-configuring once."
Remove-Item (Join-Path $buildDir "CMakeCache.txt") -Force -ErrorAction SilentlyContinue
Remove-Item (Join-Path $buildDir "CMakeFiles") -Recurse -Force -ErrorAction SilentlyContinue
$exit2 = Invoke-CMakeConfigure
if ($exit2 -ne 0) {
Write-Err "CMake re-configure failed (exit code $exit2)"
exit $exit2
}
Write-Log "CMake re-configure finished."
}

# Fail fast if Ninja was requested but the build tree still has no Ninja backend files.
if (-not (Test-HasNinjaBuildFiles -Dir $buildDir)) {
Write-Err "CMake did not create build.ninja (or any *.ninja) under $buildDir after configure/retry (expected -G Ninja)."
$cache = Join-Path $buildDir "CMakeCache.txt"
if (Test-Path $cache) {
Select-String -Path $cache -Pattern "^CMAKE_GENERATOR:" | ForEach-Object { Write-Err $_.Line }
}
Write-Err "Fix: delete $buildDir completely and re-run, or ensure Ninja is on PATH when cmake runs (e.g. deps\3rd\tools\ninja)."
exit 1
}

# Copy compile_commands.json to project root for IDE support
$ccJson = "$buildDir\compile_commands.json"
if (Test-Path $ccJson) {
Expand All @@ -334,17 +391,41 @@ function Do-Build {

# -- ninja build -----------------------------------------------------
function Do-Ninja {
param([string]$BuildDir)
param(
[string]$BuildDir,
[string]$Target = "observer"
)

Write-Log "Building with Ninja (-j $Jobs) in $BuildDir ..."
Write-Log "Building with Ninja (-j $Jobs) target=$Target in $BuildDir ..."
Push-Location $BuildDir
try {
& ninja -j $Jobs observer | Out-Host
& ninja -j $Jobs $Target | Out-Host
if ($LASTEXITCODE -ne 0) {
Write-Err "Build failed (exit code $LASTEXITCODE)"
exit $LASTEXITCODE
}
Write-Log "Build succeeded!"

# Deterministic post-condition for libseekdb: link must emit a DLL somewhere under the build dir.
if ($Target -eq "libseekdb") {
$foundDll = $false
foreach ($leaf in @("seekdb.dll", "libseekdb.dll")) {
try {
$arr = [System.IO.Directory]::GetFiles($BuildDir, $leaf, [System.IO.SearchOption]::AllDirectories)
if ($arr -and $arr.Length -gt 0) {
$foundDll = $true
Write-Log "Found ${leaf} at $($arr[0])"
break
}
} catch {
# ignore enumeration errors; treat as not found
}
}
if (-not $foundDll) {
Write-Err "ninja libseekdb succeeded but no seekdb.dll / libseekdb.dll under $BuildDir — link step did not produce a DLL (check ninja/link output above)."
exit 1
}
}
}
finally {
Pop-Location
Expand Down Expand Up @@ -404,7 +485,7 @@ function Do-Package {
}

$buildDir = Do-Build -BuildType "RelWithDebInfo" -ExtraCMakeArgs @("-DOB_BUILD_PACKAGE=ON")
Do-Ninja -BuildDir $buildDir
Do-Ninja -BuildDir $buildDir -Target observer

# Sign binaries before they are packaged into the MSI
$exesToSign = @(
Expand Down Expand Up @@ -476,12 +557,12 @@ switch ($Action.ToLower()) {
{ $_ -in "release", "relwithdebinfo" } {
if ($Init) { Do-Init }
$buildDir = Do-Build -BuildType "RelWithDebInfo"
if ($Ninja) { Do-Ninja -BuildDir $buildDir }
if ($Ninja) { Do-Ninja -BuildDir $buildDir -Target $NinjaTarget }
}
{ $_ -in "debug", "" } {
if ($Init) { Do-Init }
$buildDir = Do-Build -BuildType "Debug"
if ($Ninja) { Do-Ninja -BuildDir $buildDir }
if ($Ninja) { Do-Ninja -BuildDir $buildDir -Target $NinjaTarget }
}
"-h" {
Show-Usage
Expand Down
21 changes: 11 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ BUILD_SH=$TOPDIR/build.sh
DEP_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/deps/devel
TOOLS_DIR=${TOPDIR}/deps/3rd/usr/local/oceanbase/devtools

# Get CPU cores and CMAKE command, compatible with macOS and Linux
# Get CPU cores; cmake path is resolved in do_build() (Linux may use host cmake before deps devtools exist)
if [[ "$(uname -s)" == "Darwin" ]]; then
CMAKE_COMMAND="cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
CPU_CORES=$(sysctl -n hw.ncpu)
KERNEL_RELEASE=""
else
CMAKE_COMMAND="${TOOLS_DIR}/bin/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
CPU_CORES=$(grep -c ^processor /proc/cpuinfo)
KERNEL_RELEASE=$(grep -Po 'release [0-9]{1}' /etc/issue 2>/dev/null)
fi
Expand Down Expand Up @@ -166,22 +164,25 @@ function do_init
# make build directory && cmake && make (if need)
function do_build
{
# Check if cmake exists, compatible with macOS and Linux
# Resolve cmake: prefer OceanBase devtools on Linux; else Homebrew/common paths; else PATH (e.g. apt cmake on CI)
CMAKE_PATH=""
if [[ "$(uname -s)" == "Darwin" ]]; then
# macOS: cmake may be at /opt/homebrew/bin/cmake or /usr/local/bin/cmake
if [ -f /opt/homebrew/bin/cmake ]; then
CMAKE_PATH="/opt/homebrew/bin/cmake"
elif [ -f /usr/local/bin/cmake ]; then
CMAKE_PATH="/usr/local/bin/cmake"
fi
else
# Linux
CMAKE_PATH="${TOOLS_DIR}/bin/cmake"
if [[ -x "${TOOLS_DIR}/bin/cmake" ]]; then
CMAKE_PATH="${TOOLS_DIR}/bin/cmake"
fi
fi
if [[ -z "$CMAKE_PATH" ]] && command -v cmake >/dev/null 2>&1; then
CMAKE_PATH="$(command -v cmake)"
fi

if [ -z "$CMAKE_PATH" ]; then
echo_log "[NOTICE] Your workspace has not initialized dependencies, please append '--init' args to initialize dependencies"
echo_log "[NOTICE] cmake not found. On Linux install cmake (e.g. apt install cmake) or run --init so ${TOOLS_DIR}/bin/cmake exists"
exit 1
fi

Expand All @@ -196,11 +197,11 @@ function do_build
echo_err "Set ANDROID_NDK_HOME or install the NDK"
exit 1
fi
ANDROID_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-28"
ANDROID_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-28 -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=ON"
echo_log "Android NDK: $ANDROID_NDK_HOME"
fi

${CMAKE_COMMAND} ${TOPDIR} ${ANDROID_CMAKE_ARGS} "$@"
"${CMAKE_PATH}" -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ${TOPDIR} ${ANDROID_CMAKE_ARGS} "$@"
if [ $? -ne 0 ]; then
echo_err "Failed to generate Makefile"
exit 1
Expand Down
66 changes: 66 additions & 0 deletions cmake/EnsureWindowsDiaGuids.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# LLVM imports may reference BuildTools\DIA SDK\...\diaguids.lib; CI/home often only have Community/etc.
# Copy one existing VS 2022 diaguids.lib there before linking (must run before add_subdirectory(src)).

if(NOT WIN32)
return()
endif()

# LLVM/seekdb Windows CI is x64 -> amd64 DIA libs; ARM64 host uses arm64.
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "^(ARM64|aarch64)$")
set(_a "arm64")
else()
set(_a "amd64")
endif()

set(_dst "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/DIA SDK/lib/${_a}/diaguids.lib")
if(EXISTS "${_dst}")
return()
endif()

set(_cand "")
if(DEFINED ENV{VSINSTALLDIR})
file(TO_CMAKE_PATH "$ENV{VSINSTALLDIR}" _r)
string(REGEX REPLACE "/+$" "" _r "${_r}")
list(APPEND _cand "${_r}/DIA SDK/lib/${_a}/diaguids.lib")
endif()

set(_vw "C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe")
if(EXISTS "${_vw}")
execute_process(
COMMAND "${_vw}" -latest -products * -utf8 -property installationPath
OUTPUT_VARIABLE _vp OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET RESULT_VARIABLE _vr
)
if(_vr EQUAL 0 AND _vp)
string(STRIP "${_vp}" _vp)
list(APPEND _cand "${_vp}/DIA SDK/lib/${_a}/diaguids.lib")
endif()
endif()

foreach(_root "C:/Program Files/Microsoft Visual Studio/2022" "C:/Program Files (x86)/Microsoft Visual Studio/2022")
if(EXISTS "${_root}")
file(GLOB _g "${_root}/*/DIA SDK/lib/${_a}/diaguids.lib")
list(APPEND _cand ${_g})
endif()
endforeach()

set(_src "")
foreach(_i IN LISTS _cand)
if(EXISTS "${_i}")
set(_src "${_i}")
break()
endif()
endforeach()

if(NOT _src)
message(WARNING "EnsureWindowsDiaGuids: diaguids.lib (${_a}) not found. LLVM/lld link may fail.")
return()
endif()

get_filename_component(_dd "${_dst}" DIRECTORY)
file(MAKE_DIRECTORY "${_dd}")
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${_src}" "${_dst}" RESULT_VARIABLE _ec)
if(NOT _ec EQUAL 0)
message(WARNING "EnsureWindowsDiaGuids: copy failed (${_ec}); try elevated cmake or install DIA SDK.")
else()
message(STATUS "EnsureWindowsDiaGuids: ${_src} -> ${_dst}")
endif()
Loading
Loading