From 059307d549ff395a4a985a41c5c8148cf0161f5f Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 11:23:29 +0800 Subject: [PATCH 01/40] Use seekdb-deps gtest package on Linux x86_64 --- MODULE.bazel | 11 +++++ bazel/seekdb_deps/BUILD.bazel | 19 ++++++++ bazel/seekdb_deps/repositories.bzl | 64 +++++++++++++++++++++++++++ deps.lock.json | 13 ++++++ unittest/oblib/BUILD.bazel | 2 +- unittest/storage/memtable/BUILD.bazel | 2 +- unittest/storage/tx/BUILD.bazel | 2 +- 7 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 bazel/seekdb_deps/BUILD.bazel create mode 100644 bazel/seekdb_deps/repositories.bzl create mode 100644 deps.lock.json diff --git a/MODULE.bazel b/MODULE.bazel index 745f459bc8..27ce1dc5a7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -173,6 +173,17 @@ third_party_headers_repository(name = "third_party_ios", platform = "iphoneos") third_party_headers_repository(name = "third_party_ios_simulator", platform = "iphonesimulator") third_party_headers_repository(name = "third_party_wasm", platform = "wasm") +seekdb_deps_repository = use_repo_rule( + "//bazel/seekdb_deps:repositories.bzl", + "seekdb_deps_repository", +) +seekdb_deps_repository( + name = "seekdb_deps_gtest", + lock_file = "//:deps.lock.json", + package_name = "gtest", + target = "linux-x86_64-glibc217", +) + linux_cc_toolchain_repository = use_repo_rule( "//bazel/toolchains/cc:linux_cc_toolchain_repo.bzl", "linux_cc_toolchain_repository", diff --git a/bazel/seekdb_deps/BUILD.bazel b/bazel/seekdb_deps/BUILD.bazel new file mode 100644 index 0000000000..937dfa13fe --- /dev/null +++ b/bazel/seekdb_deps/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +package(default_visibility = ["//visibility:public"], default_testonly = True) + +config_setting( + name = "linux_x86_64", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], +) + +cc_library( + name = "gtest", + deps = select({ + ":linux_x86_64": ["@seekdb_deps_gtest//:gtest"], + "//conditions:default": ["//bazel/third_party:gtest"], + }), +) diff --git a/bazel/seekdb_deps/repositories.bzl b/bazel/seekdb_deps/repositories.bzl new file mode 100644 index 0000000000..a41c1e163e --- /dev/null +++ b/bazel/seekdb_deps/repositories.bzl @@ -0,0 +1,64 @@ +"""Bazel repositories backed by packages published from seekdb-deps.""" + +def _seekdb_deps_repository_impl(repository_ctx): + lock = json.decode(repository_ctx.read(repository_ctx.attr.lock_file)) + if lock.get("schema_version") != 1: + fail("unsupported deps.lock.json schema") + + matches = [package for package in lock.get("packages", []) + if package.get("name") == repository_ctx.attr.package_name and + package.get("target") == repository_ctx.attr.target and + package.get("artifact_type") == "binary"] + if len(matches) != 1: + fail("deps.lock.json must contain exactly one binary package for %s (%s)" % + (repository_ctx.attr.package_name, repository_ctx.attr.target)) + + package = matches[0] + version = package.get("version") + url = package.get("url") + sha256 = package.get("sha256") + if not version or not url or not sha256: + fail("incomplete deps.lock.json entry for %s" % repository_ctx.attr.package_name) + + archive = repository_ctx.path("package.tar.gz") + repository_ctx.download( + url = url, + output = archive, + sha256 = sha256, + ) + repository_ctx.extract( + archive = archive, + stripPrefix = "%s-%s" % (repository_ctx.attr.package_name, version), + ) + repository_ctx.file("BUILD.bazel", """ +load("@rules_cc//cc:cc_import.bzl", "cc_import") +load("@rules_cc//cc:cc_library.bzl", "cc_library") + +package(default_visibility = ["//visibility:public"]) + +cc_import( + name = "gtest_archive", + static_library = "lib/libgtest.a", +) + +cc_library( + name = "gtest", + hdrs = glob(["include/gtest/**/*.h"]), + includes = ["include"], + defines = ["_GLIBCXX_USE_CXX11_ABI=1"], + linkopts = select({ + "@platforms//os:linux": ["-pthread"], + "//conditions:default": [], + }), + deps = [":gtest_archive"], +) +""") + +seekdb_deps_repository = repository_rule( + implementation = _seekdb_deps_repository_impl, + attrs = { + "lock_file": attr.label(mandatory = True, allow_single_file = True), + "package_name": attr.string(mandatory = True), + "target": attr.string(mandatory = True), + }, +) diff --git a/deps.lock.json b/deps.lock.json new file mode 100644 index 0000000000..5e3ba6afc0 --- /dev/null +++ b/deps.lock.json @@ -0,0 +1,13 @@ +{ + "schema_version": 1, + "packages": [ + { + "name": "gtest", + "version": "1.14.0", + "artifact_type": "binary", + "target": "linux-x86_64-glibc217", + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-75e97b8357c0.tar.gz", + "sha256": "10aa4c2226cbbf48bd68eefbc50963c1aebede4c07bcefb867c5b8fb7329e783" + } + ] +} diff --git a/unittest/oblib/BUILD.bazel b/unittest/oblib/BUILD.bazel index 6c797a23a2..be1d27a39d 100644 --- a/unittest/oblib/BUILD.bazel +++ b/unittest/oblib/BUILD.bazel @@ -9,7 +9,7 @@ cc_library( alwayslink = True, deps = [ "//src/oblib:oblib_unit_test_internal_headers", - "//bazel/third_party:gtest", + "//bazel/seekdb_deps:gtest", ], target_compatible_with = select({ "//bazel:sanity_enabled": [], diff --git a/unittest/storage/memtable/BUILD.bazel b/unittest/storage/memtable/BUILD.bazel index 30bf45d26d..f4730c458a 100644 --- a/unittest/storage/memtable/BUILD.bazel +++ b/unittest/storage/memtable/BUILD.bazel @@ -8,7 +8,7 @@ cc_library( srcs = ["test_memtable_mutator.cpp"], alwayslink = True, deps = [ - "//bazel/third_party:gtest", + "//bazel/seekdb_deps:gtest", "//src/storage:memtable_mutator_test_headers", ], ) diff --git a/unittest/storage/tx/BUILD.bazel b/unittest/storage/tx/BUILD.bazel index dfe53cc8cb..c88459111f 100644 --- a/unittest/storage/tx/BUILD.bazel +++ b/unittest/storage/tx/BUILD.bazel @@ -8,7 +8,7 @@ cc_library( srcs = ["test_tx_replay_executor.cpp"], alwayslink = True, deps = [ - "//bazel/third_party:gtest", + "//bazel/seekdb_deps:gtest", "//src/storage:tx_replay_test_headers", ], ) From 3fab779cf5496f60cc5268af1c7786ddea247ac8 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 11:55:01 +0800 Subject: [PATCH 02/40] Remove migrated Linux x86_64 gtest RPM entries --- deps/init/oceanbase.al8.x86_64.deps | 1 - deps/init/oceanbase.el7.x86_64.deps | 1 - deps/init/oceanbase.el8.x86_64.deps | 1 - deps/init/oceanbase.el9.x86_64.deps | 1 - 4 files changed, 4 deletions(-) diff --git a/deps/init/oceanbase.al8.x86_64.deps b/deps/init/oceanbase.al8.x86_64.deps index fbc8425f44..754614b4a6 100644 --- a/deps/init/oceanbase.al8.x86_64.deps +++ b/deps/init/oceanbase.al8.x86_64.deps @@ -9,7 +9,6 @@ arch=x86_64 repo=http://mirrors.oceanbase.com/oceanbase/community/stable/al/8/x86_64/ [deps] -devdeps-gtest-1.8.0-242026020914.al8.x86_64.rpm devdeps-libcurl-static-8.12.1-132025040210.al8.x86_64.rpm devdeps-libaio-0.3.112-42024092715.al8.x86_64.rpm devdeps-relaxed-rapidjson-1.0.0-132024092715.al8.x86_64.rpm diff --git a/deps/init/oceanbase.el7.x86_64.deps b/deps/init/oceanbase.el7.x86_64.deps index fc264d3f17..86a94cb1a7 100644 --- a/deps/init/oceanbase.el7.x86_64.deps +++ b/deps/init/oceanbase.el7.x86_64.deps @@ -11,7 +11,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/community/stable/el/7/x86_64/ [deps] -devdeps-gtest-1.8.0-312026021311.el7.x86_64.rpm devdeps-libcurl-static-8.12.1-132025040210.el7.x86_64.rpm devdeps-libaio-0.3.112-12022092915.el7.x86_64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el7.x86_64.rpm diff --git a/deps/init/oceanbase.el8.x86_64.deps b/deps/init/oceanbase.el8.x86_64.deps index a50415a5ed..d53447f745 100644 --- a/deps/init/oceanbase.el8.x86_64.deps +++ b/deps/init/oceanbase.el8.x86_64.deps @@ -10,7 +10,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/community/stable/el/8/x86_64/ [deps] -devdeps-gtest-1.8.0-312026021311.el8.x86_64.rpm devdeps-libcurl-static-8.12.1-132025040210.el8.x86_64.rpm devdeps-libaio-0.3.112-12022092915.el8.x86_64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el8.x86_64.rpm diff --git a/deps/init/oceanbase.el9.x86_64.deps b/deps/init/oceanbase.el9.x86_64.deps index 835fe9e6ad..f66bab2dd1 100644 --- a/deps/init/oceanbase.el9.x86_64.deps +++ b/deps/init/oceanbase.el9.x86_64.deps @@ -15,7 +15,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/development-kit/el/9/x86_64/ [deps] -devdeps-gtest-1.8.0-242026020914.el8.x86_64.rpm devdeps-libcurl-static-8.12.1-132025040210.el8.x86_64.rpm devdeps-libaio-0.3.112-12022092915.el8.x86_64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el8.x86_64.rpm From 3ab9d132a0ad0a17bb3d1c950aadb8116511a569 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 11:59:50 +0800 Subject: [PATCH 03/40] Prepare locked dependency packages with legacy profiles --- MODULE.bazel | 11 ---- bazel/seekdb_deps/BUILD.bazel | 19 ------- bazel/seekdb_deps/repositories.bzl | 64 ---------------------- deps/init/prepare.py | 79 ++++++++++++++++++++++++--- unittest/oblib/BUILD.bazel | 2 +- unittest/storage/memtable/BUILD.bazel | 2 +- unittest/storage/tx/BUILD.bazel | 2 +- 7 files changed, 74 insertions(+), 105 deletions(-) delete mode 100644 bazel/seekdb_deps/BUILD.bazel delete mode 100644 bazel/seekdb_deps/repositories.bzl diff --git a/MODULE.bazel b/MODULE.bazel index 27ce1dc5a7..745f459bc8 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -173,17 +173,6 @@ third_party_headers_repository(name = "third_party_ios", platform = "iphoneos") third_party_headers_repository(name = "third_party_ios_simulator", platform = "iphonesimulator") third_party_headers_repository(name = "third_party_wasm", platform = "wasm") -seekdb_deps_repository = use_repo_rule( - "//bazel/seekdb_deps:repositories.bzl", - "seekdb_deps_repository", -) -seekdb_deps_repository( - name = "seekdb_deps_gtest", - lock_file = "//:deps.lock.json", - package_name = "gtest", - target = "linux-x86_64-glibc217", -) - linux_cc_toolchain_repository = use_repo_rule( "//bazel/toolchains/cc:linux_cc_toolchain_repo.bzl", "linux_cc_toolchain_repository", diff --git a/bazel/seekdb_deps/BUILD.bazel b/bazel/seekdb_deps/BUILD.bazel deleted file mode 100644 index 937dfa13fe..0000000000 --- a/bazel/seekdb_deps/BUILD.bazel +++ /dev/null @@ -1,19 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"], default_testonly = True) - -config_setting( - name = "linux_x86_64", - constraint_values = [ - "@platforms//os:linux", - "@platforms//cpu:x86_64", - ], -) - -cc_library( - name = "gtest", - deps = select({ - ":linux_x86_64": ["@seekdb_deps_gtest//:gtest"], - "//conditions:default": ["//bazel/third_party:gtest"], - }), -) diff --git a/bazel/seekdb_deps/repositories.bzl b/bazel/seekdb_deps/repositories.bzl deleted file mode 100644 index a41c1e163e..0000000000 --- a/bazel/seekdb_deps/repositories.bzl +++ /dev/null @@ -1,64 +0,0 @@ -"""Bazel repositories backed by packages published from seekdb-deps.""" - -def _seekdb_deps_repository_impl(repository_ctx): - lock = json.decode(repository_ctx.read(repository_ctx.attr.lock_file)) - if lock.get("schema_version") != 1: - fail("unsupported deps.lock.json schema") - - matches = [package for package in lock.get("packages", []) - if package.get("name") == repository_ctx.attr.package_name and - package.get("target") == repository_ctx.attr.target and - package.get("artifact_type") == "binary"] - if len(matches) != 1: - fail("deps.lock.json must contain exactly one binary package for %s (%s)" % - (repository_ctx.attr.package_name, repository_ctx.attr.target)) - - package = matches[0] - version = package.get("version") - url = package.get("url") - sha256 = package.get("sha256") - if not version or not url or not sha256: - fail("incomplete deps.lock.json entry for %s" % repository_ctx.attr.package_name) - - archive = repository_ctx.path("package.tar.gz") - repository_ctx.download( - url = url, - output = archive, - sha256 = sha256, - ) - repository_ctx.extract( - archive = archive, - stripPrefix = "%s-%s" % (repository_ctx.attr.package_name, version), - ) - repository_ctx.file("BUILD.bazel", """ -load("@rules_cc//cc:cc_import.bzl", "cc_import") -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_import( - name = "gtest_archive", - static_library = "lib/libgtest.a", -) - -cc_library( - name = "gtest", - hdrs = glob(["include/gtest/**/*.h"]), - includes = ["include"], - defines = ["_GLIBCXX_USE_CXX11_ABI=1"], - linkopts = select({ - "@platforms//os:linux": ["-pthread"], - "//conditions:default": [], - }), - deps = [":gtest_archive"], -) -""") - -seekdb_deps_repository = repository_rule( - implementation = _seekdb_deps_repository_impl, - attrs = { - "lock_file": attr.label(mandatory = True, allow_single_file = True), - "package_name": attr.string(mandatory = True), - "target": attr.string(mandatory = True), - }, -) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 360a0dbb3d..5baae7d1e5 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -2,6 +2,7 @@ """Prepare seekdb dependencies for native and cross-platform builds.""" import argparse +import json import hashlib import os from pathlib import Path @@ -101,6 +102,43 @@ def packages(profile): return result +def locked_packages(lock_file, system, architecture): + if not lock_file.is_file(): + return [] + lock = json.loads(lock_file.read_text(encoding="utf-8")) + if lock.get("schema_version") != 1: + raise ValueError("Unsupported dependency lock schema: " + str(lock_file)) + + platform_name = {"Darwin": "macos", "Windows": "windows"}.get(system, system.lower()) + prefix = "%s-%s" % (platform_name, architecture) + matches = [package for package in lock.get("packages", []) + if package.get("artifact_type") == "binary" and + package.get("target", "").startswith(prefix)] + if system == "Linux": + libc = platform.libc_ver()[1] + version = re.match(r"(\d+)\.(\d+)", libc) + if version: + libc_version = int(version.group(1)) * 100 + int(version.group(2)) + compatible = [] + for package in matches: + target = re.fullmatch(r"linux-[^-]+-glibc(\d+)", package["target"]) + if target and int(target.group(1)) <= libc_version: + compatible.append((int(target.group(1)), package)) + if compatible: + best = max(version for version, _ in compatible) + matches = [package for version, package in compatible if version == best] + else: + matches = [package for package in matches + if package["target"] == prefix] + else: + matches = [package for package in matches if package["target"] == prefix] + + names = [package.get("name") for package in matches] + if len(names) != len(set(names)): + raise ValueError("Multiple locked binary packages match this host: " + str(lock_file)) + return matches + + def download(url, archive): partial = archive.with_name(archive.name + ".download") try: @@ -138,7 +176,7 @@ def ready(destination, key): return (destination / key).is_file() and (destination / "DONE").is_file() -def populate(profile, destination, key, archive_directory): +def populate(profile, destination, key, archive_directory, lock_file, system, architecture): destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "3rd" @@ -152,20 +190,40 @@ def populate(profile, destination, key, archive_directory): else: download(url, archive) unpack(archive, stage) + prefix = stage / "usr/local/oceanbase/deps/devel" + prefix.mkdir(parents=True, exist_ok=True) + for package in locked_packages(lock_file, system, architecture): + url = package.get("url") + checksum = package.get("sha256") + if not url or not checksum or not package.get("version"): + raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + filename = url.rsplit("/", 1)[-1] + archive = stage / "pkg" / filename + cached = archive_directory / filename + if cached.is_file(): + shutil.copyfile(cached, archive) + else: + download(url, archive) + actual = hashlib.sha256(archive.read_bytes()).hexdigest() + if actual.lower() != checksum.lower(): + raise ValueError("SHA256 mismatch for " + filename) + print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) + unpack(archive, prefix) (stage / key).touch() (stage / "DONE").touch() remove_directory(destination) stage.rename(destination) -def install(profile, destination, cache_directory=None): - # Retain the existing cache identity so initialized SDKs remain reusable. - key = hashlib.md5(profile.read_bytes()).hexdigest() +def install(profile, destination, cache_directory, lock_file, system, architecture): + lock_packages = locked_packages(lock_file, system, architecture) + identity = profile.read_bytes() + json.dumps(lock_packages, sort_keys=True).encode("utf-8") + key = hashlib.sha256(identity).hexdigest() if ready(destination, key): print("Dependencies ready: " + str(destination), flush=True) return if cache_directory is None: - populate(profile, destination, key, destination / "pkg") + populate(profile, destination, key, destination / "pkg", lock_file, system, architecture) return import fcntl @@ -175,7 +233,7 @@ def install(profile, destination, cache_directory=None): with (cache_directory / (key + ".lock")).open("a") as lock: fcntl.flock(lock, fcntl.LOCK_EX) if not ready(cached, key): - populate(profile, cached, key, destination / "pkg") + populate(profile, cached, key, destination / "pkg", lock_file, system, architecture) destination.parent.mkdir(parents=True, exist_ok=True) remove_directory(destination) destination.symlink_to(cached, target_is_directory=True) @@ -227,6 +285,9 @@ def main(arguments): raise ValueError("iOS SDK unavailable; install Xcode and set DEVELOPER_DIR to its Contents/Developer directory") profile = host_profile() + system = platform.system() + architecture = {"amd64": "x86_64", "arm64": "aarch64"}.get( + platform.machine().lower(), platform.machine().lower()) rust_target = None if options.android: rust_target = "aarch64-linux-android" @@ -234,11 +295,13 @@ def main(arguments): rust_target = "aarch64-apple-ios-sim" if options.simulator else "aarch64-apple-ios" prepare_rust(rust_target) cache = os.environ.get("DEP_CACHE_DIR") if os.name != "nt" else None - install(profile, ROOT / "deps/3rd", Path(cache).expanduser().resolve() if cache else None) + install(profile, ROOT / "deps/3rd", Path(cache).expanduser().resolve() if cache else None, + ROOT / "deps.lock.json", system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: - install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android") + install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None, + ROOT / "deps.lock.json", "Android", "arm64") if options.ios: subprocess.run([ sys.executable, str(PROFILES / "ios/build.py"), "--reuse", "--jobs", str(os.cpu_count() or 1), diff --git a/unittest/oblib/BUILD.bazel b/unittest/oblib/BUILD.bazel index be1d27a39d..6c797a23a2 100644 --- a/unittest/oblib/BUILD.bazel +++ b/unittest/oblib/BUILD.bazel @@ -9,7 +9,7 @@ cc_library( alwayslink = True, deps = [ "//src/oblib:oblib_unit_test_internal_headers", - "//bazel/seekdb_deps:gtest", + "//bazel/third_party:gtest", ], target_compatible_with = select({ "//bazel:sanity_enabled": [], diff --git a/unittest/storage/memtable/BUILD.bazel b/unittest/storage/memtable/BUILD.bazel index f4730c458a..30bf45d26d 100644 --- a/unittest/storage/memtable/BUILD.bazel +++ b/unittest/storage/memtable/BUILD.bazel @@ -8,7 +8,7 @@ cc_library( srcs = ["test_memtable_mutator.cpp"], alwayslink = True, deps = [ - "//bazel/seekdb_deps:gtest", + "//bazel/third_party:gtest", "//src/storage:memtable_mutator_test_headers", ], ) diff --git a/unittest/storage/tx/BUILD.bazel b/unittest/storage/tx/BUILD.bazel index c88459111f..dfe53cc8cb 100644 --- a/unittest/storage/tx/BUILD.bazel +++ b/unittest/storage/tx/BUILD.bazel @@ -8,7 +8,7 @@ cc_library( srcs = ["test_tx_replay_executor.cpp"], alwayslink = True, deps = [ - "//bazel/seekdb_deps:gtest", + "//bazel/third_party:gtest", "//src/storage:tx_replay_test_headers", ], ) From 61e88546b8fb51fce66308c7daac184db2b748cd Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 12:06:20 +0800 Subject: [PATCH 04/40] Lock gtest packages for all published platforms --- bazel/third_party/targets.bzl | 1 + deps.lock.json | 32 +++++++++++++++++++++++++ deps/init/oceanbase.al8.aarch64.deps | 1 - deps/init/oceanbase.el7.aarch64.deps | 1 - deps/init/oceanbase.el8.aarch64.deps | 1 - deps/init/oceanbase.el9.aarch64.deps | 1 - deps/init/prepare.py | 36 +++++++++++++++++++++++++--- 7 files changed, 66 insertions(+), 7 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 72eb38f86f..0872299743 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -96,6 +96,7 @@ _WINDOWS_HEADER_LIBRARIES = { } def _windows_libraries(): + cc_import(name = "gtest_archive", static_library = "lib/gtest.lib") for name, (interface, dll, deps) in _WINDOWS_SHARED.items(): cc_import( name = name, diff --git a/deps.lock.json b/deps.lock.json index 5e3ba6afc0..7bab341f39 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -1,6 +1,22 @@ { "schema_version": 1, "packages": [ + { + "name": "gtest", + "version": "1.14.0", + "artifact_type": "binary", + "target": "android-arm64-v8a-api26", + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-75e97b8357c0.tar.gz", + "sha256": "c319ef61e2303a5e7363f76060a40d605038ab69d4c319a28e4e6157921581f7" + }, + { + "name": "gtest", + "version": "1.14.0", + "artifact_type": "binary", + "target": "linux-aarch64-glibc217", + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-75e97b8357c0.tar.gz", + "sha256": "61edbf6caeba64f9f362c1f825a1a0d7f6392a72cd29aed0203a843aa2fc7c63" + }, { "name": "gtest", "version": "1.14.0", @@ -8,6 +24,22 @@ "target": "linux-x86_64-glibc217", "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-75e97b8357c0.tar.gz", "sha256": "10aa4c2226cbbf48bd68eefbc50963c1aebede4c07bcefb867c5b8fb7329e783" + }, + { + "name": "gtest", + "version": "1.14.0", + "artifact_type": "binary", + "target": "macos-arm64-min13", + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-75e97b8357c0.tar.gz", + "sha256": "37fb6914d3abe683ab17b5802523b14eedabff19619d4ba8f09916732e2d9b23" + }, + { + "name": "gtest", + "version": "1.14.0", + "artifact_type": "binary", + "target": "windows-x86_64-md", + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-75e97b8357c0.tar.gz", + "sha256": "723d2d3e1cb0021cb4249b8d7e096ae49d40530b68abca187be03cb5f3914c79" } ] } diff --git a/deps/init/oceanbase.al8.aarch64.deps b/deps/init/oceanbase.al8.aarch64.deps index 11db014113..357eb5c587 100644 --- a/deps/init/oceanbase.al8.aarch64.deps +++ b/deps/init/oceanbase.al8.aarch64.deps @@ -9,7 +9,6 @@ arch=aarch64 repo=http://mirrors.oceanbase.com/oceanbase/community/stable/al/8/aarch64/ [deps] -devdeps-gtest-1.8.0-242026020914.al8.aarch64.rpm devdeps-libcurl-static-8.12.1-132025040210.al8.aarch64.rpm devdeps-libaio-0.3.112-42024092715.al8.aarch64.rpm devdeps-relaxed-rapidjson-1.0.0-132024092715.al8.aarch64.rpm diff --git a/deps/init/oceanbase.el7.aarch64.deps b/deps/init/oceanbase.el7.aarch64.deps index 6855acb9b2..16d237ac62 100644 --- a/deps/init/oceanbase.el7.aarch64.deps +++ b/deps/init/oceanbase.el7.aarch64.deps @@ -10,7 +10,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/community/stable/el/7/aarch64/ [deps] -devdeps-gtest-1.8.0-312026021311.el7.aarch64.rpm devdeps-libcurl-static-8.12.1-132025040210.el7.aarch64.rpm devdeps-libaio-0.3.112-12022092915.el7.aarch64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el7.aarch64.rpm diff --git a/deps/init/oceanbase.el8.aarch64.deps b/deps/init/oceanbase.el8.aarch64.deps index 7aa70e48c5..d98671bb47 100644 --- a/deps/init/oceanbase.el8.aarch64.deps +++ b/deps/init/oceanbase.el8.aarch64.deps @@ -10,7 +10,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/community/stable/el/8/aarch64/ [deps] -devdeps-gtest-1.8.0-312026021311.el8.aarch64.rpm devdeps-libcurl-static-8.12.1-132025040210.el8.aarch64.rpm devdeps-libaio-0.3.112-12022092915.el8.aarch64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el8.aarch64.rpm diff --git a/deps/init/oceanbase.el9.aarch64.deps b/deps/init/oceanbase.el9.aarch64.deps index e51b677119..bb8c6cb2ce 100644 --- a/deps/init/oceanbase.el9.aarch64.deps +++ b/deps/init/oceanbase.el9.aarch64.deps @@ -15,7 +15,6 @@ repo=http://mirrors.oceanbase.com/oceanbase/development-kit/el/9/aarch64/ [deps] -devdeps-gtest-1.8.0-242026020914.el8.aarch64.rpm devdeps-libcurl-static-8.12.1-132025040210.el8.aarch64.rpm devdeps-libaio-0.3.112-12022092915.el8.aarch64.rpm devdeps-relaxed-rapidjson-1.0.0-52023011719.el8.aarch64.rpm diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 5baae7d1e5..6da618a571 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -130,6 +130,32 @@ def locked_packages(lock_file, system, architecture): else: matches = [package for package in matches if package["target"] == prefix] + elif system == "Darwin": + version = re.match(r"(\d+)", platform.mac_ver()[0]) + if version: + compatible = [] + for package in matches: + target = re.fullmatch(r"macos-[^-]+-min(\d+)", package["target"]) + if target and int(target.group(1)) <= int(version.group(1)): + compatible.append((int(target.group(1)), package)) + if compatible: + best = max(minimum for minimum, _ in compatible) + matches = [package for minimum, package in compatible if minimum == best] + else: + matches = [package for package in matches if package["target"] == prefix] + elif system == "Android": + compatible = [] + for package in matches: + target = re.fullmatch(r"android-[^-]+-v8a-api(\d+)", package["target"]) + if target and int(target.group(1)) <= 26: + compatible.append((int(target.group(1)), package)) + if compatible: + best = max(api for api, _ in compatible) + matches = [package for api, package in compatible if api == best] + else: + matches = [package for package in matches if package["target"] == prefix] + elif system == "Windows": + matches = [package for package in matches if package["target"] == prefix + "-md"] else: matches = [package for package in matches if package["target"] == prefix] @@ -190,7 +216,8 @@ def populate(profile, destination, key, archive_directory, lock_file, system, ar else: download(url, archive) unpack(archive, stage) - prefix = stage / "usr/local/oceanbase/deps/devel" + prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else + stage / "usr/local/oceanbase/deps/devel") prefix.mkdir(parents=True, exist_ok=True) for package in locked_packages(lock_file, system, architecture): url = package.get("url") @@ -286,8 +313,11 @@ def main(arguments): profile = host_profile() system = platform.system() - architecture = {"amd64": "x86_64", "arm64": "aarch64"}.get( - platform.machine().lower(), platform.machine().lower()) + architecture = platform.machine().lower() + if system == "Darwin": + architecture = {"aarch64": "arm64", "amd64": "x86_64"}.get(architecture, architecture) + else: + architecture = {"amd64": "x86_64", "arm64": "aarch64"}.get(architecture, architecture) rust_target = None if options.android: rust_target = "aarch64-linux-android" From 0991250d6a18a5ee86803cc1e77847fa327ed746 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 12:11:42 +0800 Subject: [PATCH 05/40] Separate legacy and locked dependency population --- deps/init/prepare.py | 66 +++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 6da618a571..a3bab72d6b 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -202,40 +202,48 @@ def ready(destination, key): return (destination / key).is_file() and (destination / "DONE").is_file() +def populate_profile(profile, stage, archive_directory): + for filename, url in packages(profile): + print("Preparing " + filename, flush=True) + archive = stage / "pkg" / filename + cached = archive_directory / filename + if cached.is_file(): + shutil.copyfile(cached, archive) + else: + download(url, archive) + unpack(archive, stage) + + +def populate_lock(lock_file, stage, archive_directory, system, architecture): + prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else + stage / "usr/local/oceanbase/deps/devel") + prefix.mkdir(parents=True, exist_ok=True) + for package in locked_packages(lock_file, system, architecture): + url = package.get("url") + checksum = package.get("sha256") + if not url or not checksum or not package.get("version"): + raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + filename = url.rsplit("/", 1)[-1] + archive = stage / "pkg" / filename + cached = archive_directory / filename + if cached.is_file(): + shutil.copyfile(cached, archive) + else: + download(url, archive) + actual = hashlib.sha256(archive.read_bytes()).hexdigest() + if actual.lower() != checksum.lower(): + raise ValueError("SHA256 mismatch for " + filename) + print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) + unpack(archive, prefix) + + def populate(profile, destination, key, archive_directory, lock_file, system, architecture): destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "3rd" (stage / "pkg").mkdir(parents=True) - for filename, url in packages(profile): - print("Preparing " + filename, flush=True) - archive = stage / "pkg" / filename - cached = archive_directory / filename - if cached.is_file(): - shutil.copyfile(cached, archive) - else: - download(url, archive) - unpack(archive, stage) - prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else - stage / "usr/local/oceanbase/deps/devel") - prefix.mkdir(parents=True, exist_ok=True) - for package in locked_packages(lock_file, system, architecture): - url = package.get("url") - checksum = package.get("sha256") - if not url or not checksum or not package.get("version"): - raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) - filename = url.rsplit("/", 1)[-1] - archive = stage / "pkg" / filename - cached = archive_directory / filename - if cached.is_file(): - shutil.copyfile(cached, archive) - else: - download(url, archive) - actual = hashlib.sha256(archive.read_bytes()).hexdigest() - if actual.lower() != checksum.lower(): - raise ValueError("SHA256 mismatch for " + filename) - print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) - unpack(archive, prefix) + populate_profile(profile, stage, archive_directory) + populate_lock(lock_file, stage, archive_directory, system, architecture) (stage / key).touch() (stage / "DONE").touch() remove_directory(destination) From 01ee80506fe888a9a886adc90f54356e3d249f06 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 12:19:19 +0800 Subject: [PATCH 06/40] Cache locked dependency archives by SHA256 --- deps/init/prepare.py | 77 ++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index a3bab72d6b..2fc930884a 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -166,7 +166,10 @@ def locked_packages(lock_file, system, architecture): def download(url, archive): - partial = archive.with_name(archive.name + ".download") + descriptor, partial_name = tempfile.mkstemp( + prefix="." + archive.name + ".", suffix=".download", dir=archive.parent) + os.close(descriptor) + partial = Path(partial_name) try: with urllib.request.urlopen(url, timeout=60) as source, partial.open("wb") as output: shutil.copyfileobj(source, output) @@ -176,6 +179,32 @@ def download(url, archive): partial.unlink() +def sha256_file(path): + digest = hashlib.sha256() + with path.open("rb") as source: + for block in iter(lambda: source.read(1024 * 1024), b""): + digest.update(block) + return digest.hexdigest() + + +def locked_archive(package, cache_directory): + url = package.get("url") + checksum = package.get("sha256", "").lower() + if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum) or not package.get("version"): + raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + + cache_directory.mkdir(parents=True, exist_ok=True) + archive = cache_directory / checksum + if archive.is_file() and sha256_file(archive) != checksum: + archive.unlink() + if not archive.is_file(): + download(url, archive) + if sha256_file(archive) != checksum: + archive.unlink() + raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) + return archive + + def unpack(archive, destination): if archive.suffix != ".rpm": subprocess.run(["tar", "-xf", str(archive), "-C", str(destination), @@ -214,43 +243,36 @@ def populate_profile(profile, stage, archive_directory): unpack(archive, stage) -def populate_lock(lock_file, stage, archive_directory, system, architecture): +def populate_lock(lock_file, stage, package_cache_directory, system, architecture): prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else stage / "usr/local/oceanbase/deps/devel") prefix.mkdir(parents=True, exist_ok=True) for package in locked_packages(lock_file, system, architecture): - url = package.get("url") - checksum = package.get("sha256") - if not url or not checksum or not package.get("version"): - raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + cached = locked_archive(package, package_cache_directory) + url = package["url"] filename = url.rsplit("/", 1)[-1] archive = stage / "pkg" / filename - cached = archive_directory / filename - if cached.is_file(): - shutil.copyfile(cached, archive) - else: - download(url, archive) - actual = hashlib.sha256(archive.read_bytes()).hexdigest() - if actual.lower() != checksum.lower(): - raise ValueError("SHA256 mismatch for " + filename) + shutil.copyfile(cached, archive) print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) unpack(archive, prefix) -def populate(profile, destination, key, archive_directory, lock_file, system, architecture): +def populate(profile, destination, key, archive_directory, package_cache_directory, + lock_file, system, architecture): destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "3rd" (stage / "pkg").mkdir(parents=True) populate_profile(profile, stage, archive_directory) - populate_lock(lock_file, stage, archive_directory, system, architecture) + populate_lock(lock_file, stage, package_cache_directory, system, architecture) (stage / key).touch() (stage / "DONE").touch() remove_directory(destination) stage.rename(destination) -def install(profile, destination, cache_directory, lock_file, system, architecture): +def install(profile, destination, cache_directory, package_cache_directory, + lock_file, system, architecture): lock_packages = locked_packages(lock_file, system, architecture) identity = profile.read_bytes() + json.dumps(lock_packages, sort_keys=True).encode("utf-8") key = hashlib.sha256(identity).hexdigest() @@ -258,7 +280,8 @@ def install(profile, destination, cache_directory, lock_file, system, architectu print("Dependencies ready: " + str(destination), flush=True) return if cache_directory is None: - populate(profile, destination, key, destination / "pkg", lock_file, system, architecture) + populate(profile, destination, key, destination / "pkg", package_cache_directory, + lock_file, system, architecture) return import fcntl @@ -268,13 +291,23 @@ def install(profile, destination, cache_directory, lock_file, system, architectu with (cache_directory / (key + ".lock")).open("a") as lock: fcntl.flock(lock, fcntl.LOCK_EX) if not ready(cached, key): - populate(profile, cached, key, destination / "pkg", lock_file, system, architecture) + populate(profile, cached, key, destination / "pkg", package_cache_directory, + lock_file, system, architecture) destination.parent.mkdir(parents=True, exist_ok=True) remove_directory(destination) destination.symlink_to(cached, target_is_directory=True) print("Dependencies ready: " + str(destination), flush=True) +def package_cache_path(cache_directory): + if cache_directory is not None: + return cache_directory / "packages" + if os.name == "nt" and os.environ.get("LOCALAPPDATA"): + return Path(os.environ["LOCALAPPDATA"]) / "seekdb" / "deps" / "packages" + root = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")) + return root / "seekdb" / "deps" / "packages" + + def prepare_rust(target=None): if not shutil.which("rustup") or not shutil.which("cargo"): with tempfile.TemporaryDirectory(prefix="rustup-init.") as directory: @@ -333,13 +366,15 @@ def main(arguments): rust_target = "aarch64-apple-ios-sim" if options.simulator else "aarch64-apple-ios" prepare_rust(rust_target) cache = os.environ.get("DEP_CACHE_DIR") if os.name != "nt" else None - install(profile, ROOT / "deps/3rd", Path(cache).expanduser().resolve() if cache else None, + cache_directory = Path(cache).expanduser().resolve() if cache else None + package_cache_directory = package_cache_path(cache_directory) + install(profile, ROOT / "deps/3rd", cache_directory, package_cache_directory, ROOT / "deps.lock.json", system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None, - ROOT / "deps.lock.json", "Android", "arm64") + package_cache_directory, ROOT / "deps.lock.json", "Android", "arm64") if options.ios: subprocess.run([ sys.executable, str(PROFILES / "ios/build.py"), "--reuse", "--jobs", str(os.cpu_count() or 1), From 1540296dafc09a137364dc346c1fb7b20943c404 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 14:19:55 +0800 Subject: [PATCH 07/40] Keep locked package caches under pkg by SHA256 [skip ci] --- deps/init/prepare.py | 54 ++++++++++++++++---------------------------- 1 file changed, 19 insertions(+), 35 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 2fc930884a..f38bce39fb 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -187,18 +187,20 @@ def sha256_file(path): return digest.hexdigest() -def locked_archive(package, cache_directory): +def locked_archive(package, archive_directory, staging_directory): url = package.get("url") checksum = package.get("sha256", "").lower() if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum) or not package.get("version"): raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) - cache_directory.mkdir(parents=True, exist_ok=True) - archive = cache_directory / checksum - if archive.is_file() and sha256_file(archive) != checksum: - archive.unlink() - if not archive.is_file(): - download(url, archive) + cached = archive_directory / checksum + archive = staging_directory / checksum + if cached.is_file() and sha256_file(cached) == checksum: + shutil.copyfile(cached, archive) + return archive + if cached.is_file(): + cached.unlink() + download(url, archive) if sha256_file(archive) != checksum: archive.unlink() raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) @@ -243,36 +245,30 @@ def populate_profile(profile, stage, archive_directory): unpack(archive, stage) -def populate_lock(lock_file, stage, package_cache_directory, system, architecture): +def populate_lock(lock_file, stage, archive_directory, system, architecture): prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else stage / "usr/local/oceanbase/deps/devel") prefix.mkdir(parents=True, exist_ok=True) for package in locked_packages(lock_file, system, architecture): - cached = locked_archive(package, package_cache_directory) - url = package["url"] - filename = url.rsplit("/", 1)[-1] - archive = stage / "pkg" / filename - shutil.copyfile(cached, archive) + archive = locked_archive(package, archive_directory, stage / "pkg") print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) unpack(archive, prefix) -def populate(profile, destination, key, archive_directory, package_cache_directory, - lock_file, system, architecture): +def populate(profile, destination, key, archive_directory, lock_file, system, architecture): destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "3rd" (stage / "pkg").mkdir(parents=True) populate_profile(profile, stage, archive_directory) - populate_lock(lock_file, stage, package_cache_directory, system, architecture) + populate_lock(lock_file, stage, archive_directory, system, architecture) (stage / key).touch() (stage / "DONE").touch() remove_directory(destination) stage.rename(destination) -def install(profile, destination, cache_directory, package_cache_directory, - lock_file, system, architecture): +def install(profile, destination, cache_directory, lock_file, system, architecture): lock_packages = locked_packages(lock_file, system, architecture) identity = profile.read_bytes() + json.dumps(lock_packages, sort_keys=True).encode("utf-8") key = hashlib.sha256(identity).hexdigest() @@ -280,8 +276,7 @@ def install(profile, destination, cache_directory, package_cache_directory, print("Dependencies ready: " + str(destination), flush=True) return if cache_directory is None: - populate(profile, destination, key, destination / "pkg", package_cache_directory, - lock_file, system, architecture) + populate(profile, destination, key, destination / "pkg", lock_file, system, architecture) return import fcntl @@ -291,23 +286,13 @@ def install(profile, destination, cache_directory, package_cache_directory, with (cache_directory / (key + ".lock")).open("a") as lock: fcntl.flock(lock, fcntl.LOCK_EX) if not ready(cached, key): - populate(profile, cached, key, destination / "pkg", package_cache_directory, - lock_file, system, architecture) + populate(profile, cached, key, destination / "pkg", lock_file, system, architecture) destination.parent.mkdir(parents=True, exist_ok=True) remove_directory(destination) destination.symlink_to(cached, target_is_directory=True) print("Dependencies ready: " + str(destination), flush=True) -def package_cache_path(cache_directory): - if cache_directory is not None: - return cache_directory / "packages" - if os.name == "nt" and os.environ.get("LOCALAPPDATA"): - return Path(os.environ["LOCALAPPDATA"]) / "seekdb" / "deps" / "packages" - root = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")) - return root / "seekdb" / "deps" / "packages" - - def prepare_rust(target=None): if not shutil.which("rustup") or not shutil.which("cargo"): with tempfile.TemporaryDirectory(prefix="rustup-init.") as directory: @@ -367,14 +352,13 @@ def main(arguments): prepare_rust(rust_target) cache = os.environ.get("DEP_CACHE_DIR") if os.name != "nt" else None cache_directory = Path(cache).expanduser().resolve() if cache else None - package_cache_directory = package_cache_path(cache_directory) - install(profile, ROOT / "deps/3rd", cache_directory, package_cache_directory, - ROOT / "deps.lock.json", system, architecture) + install(profile, ROOT / "deps/3rd", cache_directory, ROOT / "deps.lock.json", + system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None, - package_cache_directory, ROOT / "deps.lock.json", "Android", "arm64") + ROOT / "deps.lock.json", "Android", "arm64") if options.ios: subprocess.run([ sys.executable, str(PROFILES / "ios/build.py"), "--reuse", "--jobs", str(os.cpu_count() or 1), From 4718c5eac15131a5146affb2b3ee12ee839f2f11 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 14:33:30 +0800 Subject: [PATCH 08/40] Extract locked gtest package at deps root [skip ci] --- bazel/third_party/repositories.bzl | 12 ++++++++++++ bazel/third_party/targets.bzl | 11 ++++++++--- deps/init/prepare.py | 5 +---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index 2a7074002b..5cf97e401b 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -33,6 +33,11 @@ def _windows_sdk(repository_ctx): "tools/llvm18": "devtools", }.items(): repository_ctx.symlink(sdk + "/" + source, destination) + locked_gtest = sdk + "/include" + if repository_ctx.path(locked_gtest).exists: + repository_ctx.file("seekdb_deps/.keep", "") + repository_ctx.symlink(locked_gtest, "seekdb_deps/include") + repository_ctx.symlink(sdk + "/lib", "seekdb_deps/lib") redist = repository_ctx.getenv("VCToolsRedistDir") if not redist: fail("Run the Windows build from a Visual Studio Developer Command Prompt (VCToolsRedistDir is required)") @@ -94,6 +99,13 @@ def _third_party_headers_repository_impl(repository_ctx): repository_ctx.symlink(sdk + "/devtools", "devtools") repository_ctx.symlink(libraries, "lib") repository_ctx.symlink(libraries64, "lib64") + locked_sdk = str(repository_ctx.workspace_root) + "/deps/3rd" + if platform == "android": + locked_sdk = str(repository_ctx.workspace_root) + "/deps/android" + if repository_ctx.path(locked_sdk + "/include").exists: + repository_ctx.file("seekdb_deps/.keep", "") + repository_ctx.symlink(locked_sdk + "/include", "seekdb_deps/include") + repository_ctx.symlink(locked_sdk + "/lib", "seekdb_deps/lib") repository_ctx.file("BUILD.bazel", '''load("@seekdb//bazel/third_party:targets.bzl", "sdk_targets") package(default_visibility = ["//visibility:public"]) sdk_targets() diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 0872299743..101c98abc4 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -9,7 +9,12 @@ def _headers(directory, includes = ["include"]): return {"hdrs": ["include/" + directory + "/**/*." + extension for extension in _HEADER_EXTENSIONS], "includes": includes} SDK_HEADERS = { - "gtest": _headers("gtest") | { + "gtest": { + "hdrs": [ + "seekdb_deps/include/gtest/**/*.h", + "seekdb_deps/include/gmock/**/*.h", + ], + "includes": ["seekdb_deps/include"], "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], "linkopts": select({"@platforms//os:linux": ["-pthread"], "//conditions:default": []}), @@ -29,7 +34,7 @@ SDK_HEADERS = { "windows_headers": {"hdrs": ["include/pthread*.h", "include/_ptw32.h", "include/sched.h", "include/semaphore.h", "include/dirent.h"], "includes": ["include"]}, } SDK_IMPORTS = { - "gtest_archive": {"static_library": "lib/libgtest.a"}, + "gtest_archive": {"static_library": "seekdb_deps/lib/libgtest.a"}, "libaio": { "static_library": "lib/libaio.a", "hdrs": ["include/libaio.h"], @@ -96,7 +101,7 @@ _WINDOWS_HEADER_LIBRARIES = { } def _windows_libraries(): - cc_import(name = "gtest_archive", static_library = "lib/gtest.lib") + cc_import(name = "gtest_archive", static_library = "seekdb_deps/lib/gtest.lib") for name, (interface, dll, deps) in _WINDOWS_SHARED.items(): cc_import( name = name, diff --git a/deps/init/prepare.py b/deps/init/prepare.py index f38bce39fb..f46a57005f 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -246,13 +246,10 @@ def populate_profile(profile, stage, archive_directory): def populate_lock(lock_file, stage, archive_directory, system, architecture): - prefix = (stage / "vcpkg/x64-windows" if system == "Windows" else - stage / "usr/local/oceanbase/deps/devel") - prefix.mkdir(parents=True, exist_ok=True) for package in locked_packages(lock_file, system, architecture): archive = locked_archive(package, archive_directory, stage / "pkg") print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) - unpack(archive, prefix) + unpack(archive, stage) def populate(profile, destination, key, archive_directory, lock_file, system, architecture): From fccc17cd671cdb991f81168a4e5575b09dcefed1 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 14:42:15 +0800 Subject: [PATCH 09/40] Use GitHub mirror for locked dependency downloads [skip ci] --- deps/init/prepare.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index f46a57005f..d774cd9558 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -179,6 +179,14 @@ def download(url, archive): partial.unlink() +def locked_download_url(url): + if url.startswith("https://github.com/"): + prefix = os.environ.get("SEEKDB_DEPS_GITHUB_PROXY_PREFIX", "https://gh-proxy.com/") + if prefix: + return prefix.rstrip("/") + "/" + url + return url + + def sha256_file(path): digest = hashlib.sha256() with path.open("rb") as source: @@ -200,7 +208,7 @@ def locked_archive(package, archive_directory, staging_directory): return archive if cached.is_file(): cached.unlink() - download(url, archive) + download(locked_download_url(url), archive) if sha256_file(archive) != checksum: archive.unlink() raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) From 3b2d966815db7bb735a343c208d6fbf761ce7e9f Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 15:38:29 +0800 Subject: [PATCH 10/40] Reuse existing Bazel include and lib paths for locked packages [skip ci] --- bazel/third_party/repositories.bzl | 45 ++++++++++++++++++++---------- bazel/third_party/targets.bzl | 10 +++---- 2 files changed, 35 insertions(+), 20 deletions(-) diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index 5cf97e401b..66dd3af8d9 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -1,11 +1,23 @@ """Expose seekdb's bootstrapped third-party SDK as a Bazel repository.""" +def _link_directory_contents(repository_ctx, directories, destination): + names = {} + for directory in directories: + for child in repository_ctx.path(directory).readdir(): + if child.basename not in names: + repository_ctx.symlink(child, destination + "/" + child.basename) + names[child.basename] = True + def _windows_sdk(repository_ctx): sdk = str(repository_ctx.workspace_root) + "/deps/3rd" headers = {} for directory in ["vcpkg/x64-windows/include", "openssl/include", "vsag/include"]: for child in repository_ctx.path(sdk + "/" + directory).readdir(): headers[child.basename] = child + locked_headers = sdk + "/include" + if repository_ctx.path(locked_headers).exists: + for child in repository_ctx.path(locked_headers).readdir(): + headers[child.basename] = child for name, path in headers.items(): if name != "dirent.h": repository_ctx.symlink(path, "include/" + name) @@ -24,7 +36,6 @@ def _windows_sdk(repository_ctx): if result.return_code: fail("Cannot prepare Windows dirent header: " + result.stderr) for source, destination in { - "vcpkg/x64-windows/lib": "lib", "vcpkg/x64-windows/bin": "bin", "openssl/lib/VC/x64/MD": "openssl", "openssl/bin": "openssl_bin", @@ -33,11 +44,11 @@ def _windows_sdk(repository_ctx): "tools/llvm18": "devtools", }.items(): repository_ctx.symlink(sdk + "/" + source, destination) - locked_gtest = sdk + "/include" - if repository_ctx.path(locked_gtest).exists: - repository_ctx.file("seekdb_deps/.keep", "") - repository_ctx.symlink(locked_gtest, "seekdb_deps/include") - repository_ctx.symlink(sdk + "/lib", "seekdb_deps/lib") + locked_libraries = sdk + "/lib" + if repository_ctx.path(locked_libraries).exists: + _link_directory_contents(repository_ctx, [locked_libraries, sdk + "/vcpkg/x64-windows/lib"], "lib") + else: + repository_ctx.symlink(sdk + "/vcpkg/x64-windows/lib", "lib") redist = repository_ctx.getenv("VCToolsRedistDir") if not redist: fail("Run the Windows build from a Visual Studio Developer Command Prompt (VCToolsRedistDir is required)") @@ -69,6 +80,9 @@ def _third_party_headers_repository_impl(repository_ctx): headers = prefix + "/include" libraries = prefix + "/lib" libraries64 = libraries + locked_sdk = str(repository_ctx.workspace_root) + "/deps/3rd" + if platform == "android": + locked_sdk = str(repository_ctx.workspace_root) + "/deps/android" source_headers = [ "absl", "roaring", "vsag", "fmt", "cpuinfo.h", "seekdb-vsag", "omp.h", "ompx.h", "omp-tools.h", "ompt.h", "lapack.h", "lapacke.h", @@ -95,17 +109,18 @@ def _third_party_headers_repository_impl(repository_ctx): if child.basename not in source_headers: repository_ctx.symlink(child, "include/" + child.basename) else: - repository_ctx.symlink(headers, "include") + locked_headers = locked_sdk + "/include" + if repository_ctx.path(locked_headers).exists: + _link_directory_contents(repository_ctx, [locked_headers, headers], "include") + else: + repository_ctx.symlink(headers, "include") repository_ctx.symlink(sdk + "/devtools", "devtools") - repository_ctx.symlink(libraries, "lib") + locked_libraries = locked_sdk + "/lib" + if not ios_sdk and platform != "wasm" and repository_ctx.path(locked_libraries).exists: + _link_directory_contents(repository_ctx, [locked_libraries, libraries], "lib") + else: + repository_ctx.symlink(libraries, "lib") repository_ctx.symlink(libraries64, "lib64") - locked_sdk = str(repository_ctx.workspace_root) + "/deps/3rd" - if platform == "android": - locked_sdk = str(repository_ctx.workspace_root) + "/deps/android" - if repository_ctx.path(locked_sdk + "/include").exists: - repository_ctx.file("seekdb_deps/.keep", "") - repository_ctx.symlink(locked_sdk + "/include", "seekdb_deps/include") - repository_ctx.symlink(locked_sdk + "/lib", "seekdb_deps/lib") repository_ctx.file("BUILD.bazel", '''load("@seekdb//bazel/third_party:targets.bzl", "sdk_targets") package(default_visibility = ["//visibility:public"]) sdk_targets() diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 101c98abc4..4502cf3fd8 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -11,10 +11,10 @@ def _headers(directory, includes = ["include"]): SDK_HEADERS = { "gtest": { "hdrs": [ - "seekdb_deps/include/gtest/**/*.h", - "seekdb_deps/include/gmock/**/*.h", + "include/gtest/**/*.h", + "include/gmock/**/*.h", ], - "includes": ["seekdb_deps/include"], + "includes": ["include"], "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], "linkopts": select({"@platforms//os:linux": ["-pthread"], "//conditions:default": []}), @@ -34,7 +34,7 @@ SDK_HEADERS = { "windows_headers": {"hdrs": ["include/pthread*.h", "include/_ptw32.h", "include/sched.h", "include/semaphore.h", "include/dirent.h"], "includes": ["include"]}, } SDK_IMPORTS = { - "gtest_archive": {"static_library": "seekdb_deps/lib/libgtest.a"}, + "gtest_archive": {"static_library": "lib/libgtest.a"}, "libaio": { "static_library": "lib/libaio.a", "hdrs": ["include/libaio.h"], @@ -101,7 +101,7 @@ _WINDOWS_HEADER_LIBRARIES = { } def _windows_libraries(): - cc_import(name = "gtest_archive", static_library = "seekdb_deps/lib/gtest.lib") + cc_import(name = "gtest_archive", static_library = "lib/gtest.lib") for name, (interface, dll, deps) in _WINDOWS_SHARED.items(): cc_import( name = name, From 9635a70121e48341a778f78ac33504c37b92fff0 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 16:08:24 +0800 Subject: [PATCH 11/40] Pin ABI-compatible Linux gtest packages --- deps.lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index 7bab341f39..f053a89acd 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -14,16 +14,16 @@ "version": "1.14.0", "artifact_type": "binary", "target": "linux-aarch64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-75e97b8357c0.tar.gz", - "sha256": "61edbf6caeba64f9f362c1f825a1a0d7f6392a72cd29aed0203a843aa2fc7c63" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-a0b4edfa6429.tar.gz", + "sha256": "63e5375564510883b70d7a23b9715a98e8d206b41a7e16d5e0c8762d761cb74b" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "linux-x86_64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-75e97b8357c0.tar.gz", - "sha256": "10aa4c2226cbbf48bd68eefbc50963c1aebede4c07bcefb867c5b8fb7329e783" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-a0b4edfa6429.tar.gz", + "sha256": "6270ff0ba0a233dc638351d79c441db5c22cca781cc7deec67399d65d52bc666" }, { "name": "gtest", From ef7e1ff3799f189c4f675fb5e257b4641d00441b Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 16:16:35 +0800 Subject: [PATCH 12/40] Pin gtest archives after ABI profile cleanup --- deps.lock.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index f053a89acd..363694ed7e 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -14,16 +14,16 @@ "version": "1.14.0", "artifact_type": "binary", "target": "linux-aarch64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-a0b4edfa6429.tar.gz", - "sha256": "63e5375564510883b70d7a23b9715a98e8d206b41a7e16d5e0c8762d761cb74b" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-d5db0e766e25.tar.gz", + "sha256": "32b6bea8acea90eb6a125ccac2854a6089e54ce9d4ac5efc1e0ff9322bb6441b" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "linux-x86_64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-a0b4edfa6429.tar.gz", - "sha256": "6270ff0ba0a233dc638351d79c441db5c22cca781cc7deec67399d65d52bc666" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-d5db0e766e25.tar.gz", + "sha256": "9386263da881ef49d7d11ce5229760486d88212e89043aa20ba20e1dcd1e0a22" }, { "name": "gtest", From 66de2fc6a68c1e0fd9822c7e2709604245e09d9a Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 16:59:22 +0800 Subject: [PATCH 13/40] Pin refreshed gtest release and link Linux C++ runtime --- bazel/third_party/targets.bzl | 2 +- deps.lock.json | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 4502cf3fd8..c7b6a1bf48 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -17,7 +17,7 @@ SDK_HEADERS = { "includes": ["include"], "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], - "linkopts": select({"@platforms//os:linux": ["-pthread"], "//conditions:default": []}), + "linkopts": select({"@platforms//os:linux": ["-pthread", "-lstdc++"], "//conditions:default": []}), }, "sanity_headers": {"hdrs": ["devtools/include/sanity/**/*.h"], "includes": ["devtools/include"]}, "absl_headers": _headers("absl"), diff --git a/deps.lock.json b/deps.lock.json index 363694ed7e..a1fa9ebb4d 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -6,40 +6,40 @@ "version": "1.14.0", "artifact_type": "binary", "target": "android-arm64-v8a-api26", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-75e97b8357c0.tar.gz", - "sha256": "c319ef61e2303a5e7363f76060a40d605038ab69d4c319a28e4e6157921581f7" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "6e689c35a406513b7eb358380b6ebd98790f4cf3925d8b9c75793a0470e4b51e" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "linux-aarch64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-d5db0e766e25.tar.gz", - "sha256": "32b6bea8acea90eb6a125ccac2854a6089e54ce9d4ac5efc1e0ff9322bb6441b" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "6db9db8c31b26a5e52392ac4848d16681470c8554154ac046b47b78a2f65bac6" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "linux-x86_64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-d5db0e766e25.tar.gz", - "sha256": "9386263da881ef49d7d11ce5229760486d88212e89043aa20ba20e1dcd1e0a22" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "403ff0e270fffeb5a5336696966963cf5e146fb96c70d9cf81b1383d7d0f8efa" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "macos-arm64-min13", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-75e97b8357c0.tar.gz", - "sha256": "37fb6914d3abe683ab17b5802523b14eedabff19619d4ba8f09916732e2d9b23" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "421f1f3e3dec75cb92320f501ac0679db170d002884db7ac079d9702c38ce3d7" }, { "name": "gtest", "version": "1.14.0", "artifact_type": "binary", "target": "windows-x86_64-md", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-75e97b8357c0.tar.gz", - "sha256": "723d2d3e1cb0021cb4249b8d7e096ae49d40530b68abca187be03cb5f3914c79" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "f2f42becbbbdee3b2f2e6284d1eb7d4a7983544ab1577642ed621a2be4f73029" } ] } From 855eb28df8d51a833c98654b5fb857cc2e50aa00 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 17:06:54 +0800 Subject: [PATCH 14/40] Link gtest with static C++ runtime on Linux --- bazel/third_party/targets.bzl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index c7b6a1bf48..afd4900292 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -17,7 +17,10 @@ SDK_HEADERS = { "includes": ["include"], "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], - "linkopts": select({"@platforms//os:linux": ["-pthread", "-lstdc++"], "//conditions:default": []}), + "linkopts": select({ + "@platforms//os:linux": ["-pthread", "-Wl,-Bstatic", "-lstdc++", "-Wl,-Bdynamic"], + "//conditions:default": [], + }), }, "sanity_headers": {"hdrs": ["devtools/include/sanity/**/*.h"], "includes": ["devtools/include"]}, "absl_headers": _headers("absl"), From 5538f42a166e273acf816af40ffe94fb5fcfe702 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 17:11:52 +0800 Subject: [PATCH 15/40] Link C++ runtime in gtest unit test targets --- bazel/third_party/targets.bzl | 5 +---- unittest/storage/memtable/BUILD.bazel | 4 ++-- unittest/storage/tx/BUILD.bazel | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index afd4900292..4502cf3fd8 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -17,10 +17,7 @@ SDK_HEADERS = { "includes": ["include"], "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], - "linkopts": select({ - "@platforms//os:linux": ["-pthread", "-Wl,-Bstatic", "-lstdc++", "-Wl,-Bdynamic"], - "//conditions:default": [], - }), + "linkopts": select({"@platforms//os:linux": ["-pthread"], "//conditions:default": []}), }, "sanity_headers": {"hdrs": ["devtools/include/sanity/**/*.h"], "includes": ["devtools/include"]}, "absl_headers": _headers("absl"), diff --git a/unittest/storage/memtable/BUILD.bazel b/unittest/storage/memtable/BUILD.bazel index 30bf45d26d..5dc6d01591 100644 --- a/unittest/storage/memtable/BUILD.bazel +++ b/unittest/storage/memtable/BUILD.bazel @@ -16,9 +16,9 @@ cc_library( cc_test( name = "test_memtable_mutator", linkstatic = True, - # liboceanbase supplies the C++ runtime. Use rules_cc's $ORIGIN rpath, - # rather than its $EXEC_ORIGIN path for tests with static C++ runtimes. + # Keep rules_cc's $ORIGIN rpath while linking the C++ runtime used by gtest. features = ["-static_cpp_runtime", "-static_link_cpp_runtimes"], + linkopts = ["-lstdc++"], deps = [ ":memtable_mutator_cases", "//src/observer:liboceanbase", diff --git a/unittest/storage/tx/BUILD.bazel b/unittest/storage/tx/BUILD.bazel index dfe53cc8cb..6239ef0ec4 100644 --- a/unittest/storage/tx/BUILD.bazel +++ b/unittest/storage/tx/BUILD.bazel @@ -17,8 +17,9 @@ cc_test( name = "test_tx_replay_executor", size = "small", linkstatic = True, - # liboceanbase supplies the C++ runtime; select rules_cc's $ORIGIN rpath. + # Keep rules_cc's $ORIGIN rpath while linking the C++ runtime used by gtest. features = ["-static_cpp_runtime", "-static_link_cpp_runtimes"], + linkopts = ["-lstdc++"], deps = [ ":tx_replay_executor_cases", "//src/observer:liboceanbase", From 497d37517c9a28ab6daec9e17482b28ca764cf06 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 6 Nov 2026 23:13:22 +0800 Subject: [PATCH 16/40] Avoid restoring locked package owners on Linux --- deps/init/prepare.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index d774cd9558..c8803634c1 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -215,10 +215,14 @@ def locked_archive(package, archive_directory, staging_directory): return archive -def unpack(archive, destination): +def unpack(archive, destination, *, ignore_owner=False): if archive.suffix != ".rpm": - subprocess.run(["tar", "-xf", str(archive), "-C", str(destination), - "--strip-components=1"], check=True) + command = ["tar"] + if ignore_owner: + command.append("--no-same-owner") + command.extend(["-xf", str(archive), "-C", str(destination), + "--strip-components=1"]) + subprocess.run(command, check=True) else: with subprocess.Popen(["rpm2cpio", str(archive)], stdout=subprocess.PIPE) as rpm: try: @@ -257,7 +261,7 @@ def populate_lock(lock_file, stage, archive_directory, system, architecture): for package in locked_packages(lock_file, system, architecture): archive = locked_archive(package, archive_directory, stage / "pkg") print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) - unpack(archive, stage) + unpack(archive, stage, ignore_owner=system == "Linux") def populate(profile, destination, key, archive_directory, lock_file, system, architecture): From d365d9be73b332a2a7cf2149214025873d6678a6 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 14:27:41 +0800 Subject: [PATCH 17/40] Group locked dependencies by platform --- deps.lock.json | 66 +++++++++++++------------------ deps/init/prepare.py | 93 ++++++++++++++++++++------------------------ 2 files changed, 71 insertions(+), 88 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index a1fa9ebb4d..1fb5239411 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -1,45 +1,35 @@ { - "schema_version": 1, - "packages": [ - { - "name": "gtest", - "version": "1.14.0", - "artifact_type": "binary", - "target": "android-arm64-v8a-api26", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "6e689c35a406513b7eb358380b6ebd98790f4cf3925d8b9c75793a0470e4b51e" + "schema_version": 2, + "platforms": { + "android-arm64-v8a-api26": { + "gtest": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "6e689c35a406513b7eb358380b6ebd98790f4cf3925d8b9c75793a0470e4b51e" + } }, - { - "name": "gtest", - "version": "1.14.0", - "artifact_type": "binary", - "target": "linux-aarch64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "6db9db8c31b26a5e52392ac4848d16681470c8554154ac046b47b78a2f65bac6" + "linux-aarch64-glibc217": { + "gtest": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "6db9db8c31b26a5e52392ac4848d16681470c8554154ac046b47b78a2f65bac6" + } }, - { - "name": "gtest", - "version": "1.14.0", - "artifact_type": "binary", - "target": "linux-x86_64-glibc217", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "403ff0e270fffeb5a5336696966963cf5e146fb96c70d9cf81b1383d7d0f8efa" + "linux-x86_64-glibc217": { + "gtest": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "403ff0e270fffeb5a5336696966963cf5e146fb96c70d9cf81b1383d7d0f8efa" + } }, - { - "name": "gtest", - "version": "1.14.0", - "artifact_type": "binary", - "target": "macos-arm64-min13", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "421f1f3e3dec75cb92320f501ac0679db170d002884db7ac079d9702c38ce3d7" + "macos-arm64-min13": { + "gtest": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "421f1f3e3dec75cb92320f501ac0679db170d002884db7ac079d9702c38ce3d7" + } }, - { - "name": "gtest", - "version": "1.14.0", - "artifact_type": "binary", - "target": "windows-x86_64-md", - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "f2f42becbbbdee3b2f2e6284d1eb7d4a7983544ab1577642ed621a2be4f73029" + "windows-x86_64-md": { + "gtest": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-8f0a0a8e9fe6.tar.gz", + "sha256": "f2f42becbbbdee3b2f2e6284d1eb7d4a7983544ab1577642ed621a2be4f73029" + } } - ] + } } diff --git a/deps/init/prepare.py b/deps/init/prepare.py index c8803634c1..c6f540beb4 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -106,63 +106,56 @@ def locked_packages(lock_file, system, architecture): if not lock_file.is_file(): return [] lock = json.loads(lock_file.read_text(encoding="utf-8")) - if lock.get("schema_version") != 1: + if lock.get("schema_version") != 2: raise ValueError("Unsupported dependency lock schema: " + str(lock_file)) + platforms = lock.get("platforms", {}) + if not isinstance(platforms, dict): + raise ValueError("Invalid dependency lock platforms: " + str(lock_file)) platform_name = {"Darwin": "macos", "Windows": "windows"}.get(system, system.lower()) prefix = "%s-%s" % (platform_name, architecture) - matches = [package for package in lock.get("packages", []) - if package.get("artifact_type") == "binary" and - package.get("target", "").startswith(prefix)] + pattern = None + version = None if system == "Linux": libc = platform.libc_ver()[1] - version = re.match(r"(\d+)\.(\d+)", libc) - if version: - libc_version = int(version.group(1)) * 100 + int(version.group(2)) - compatible = [] - for package in matches: - target = re.fullmatch(r"linux-[^-]+-glibc(\d+)", package["target"]) - if target and int(target.group(1)) <= libc_version: - compatible.append((int(target.group(1)), package)) - if compatible: - best = max(version for version, _ in compatible) - matches = [package for version, package in compatible if version == best] - else: - matches = [package for package in matches - if package["target"] == prefix] + found = re.match(r"(\d+)\.(\d+)", libc) + if found: + version = int(found.group(1)) * 100 + int(found.group(2)) + pattern = re.escape(prefix) + r"-glibc(\d+)" elif system == "Darwin": - version = re.match(r"(\d+)", platform.mac_ver()[0]) - if version: - compatible = [] - for package in matches: - target = re.fullmatch(r"macos-[^-]+-min(\d+)", package["target"]) - if target and int(target.group(1)) <= int(version.group(1)): - compatible.append((int(target.group(1)), package)) - if compatible: - best = max(minimum for minimum, _ in compatible) - matches = [package for minimum, package in compatible if minimum == best] - else: - matches = [package for package in matches if package["target"] == prefix] + found = re.match(r"(\d+)", platform.mac_ver()[0]) + if found: + version = int(found.group(1)) + pattern = re.escape(prefix) + r"-min(\d+)" elif system == "Android": - compatible = [] - for package in matches: - target = re.fullmatch(r"android-[^-]+-v8a-api(\d+)", package["target"]) - if target and int(target.group(1)) <= 26: - compatible.append((int(target.group(1)), package)) - if compatible: - best = max(api for api, _ in compatible) - matches = [package for api, package in compatible if api == best] - else: - matches = [package for package in matches if package["target"] == prefix] - elif system == "Windows": - matches = [package for package in matches if package["target"] == prefix + "-md"] - else: - matches = [package for package in matches if package["target"] == prefix] + version = 26 + pattern = re.escape(prefix) + r"-v8a-api(\d+)" + + target = prefix + "-md" if system == "Windows" else prefix + if pattern: + candidates = [] + for name in platforms: + match = re.fullmatch(pattern, name) + if match: + candidates.append((int(match.group(1)), name)) + if candidates: + if version is None: + raise ValueError("Cannot determine platform version for locked dependencies: " + prefix) + compatible = [candidate for candidate in candidates if candidate[0] <= version] + if compatible: + target = max(compatible)[1] + elif target not in platforms: + raise ValueError("No compatible locked dependency platform: " + prefix) - names = [package.get("name") for package in matches] - if len(names) != len(set(names)): - raise ValueError("Multiple locked binary packages match this host: " + str(lock_file)) - return matches + packages = platforms.get(target, {}) + if not isinstance(packages, dict): + raise ValueError("Invalid dependency lock platform: " + target) + result = [] + for name, package in sorted(packages.items()): + if not isinstance(package, dict): + raise ValueError("Invalid locked dependency: " + name) + result.append(dict(package, name=name)) + return result def download(url, archive): @@ -198,7 +191,7 @@ def sha256_file(path): def locked_archive(package, archive_directory, staging_directory): url = package.get("url") checksum = package.get("sha256", "").lower() - if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum) or not package.get("version"): + if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum): raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) cached = archive_directory / checksum @@ -260,7 +253,7 @@ def populate_profile(profile, stage, archive_directory): def populate_lock(lock_file, stage, archive_directory, system, architecture): for package in locked_packages(lock_file, system, architecture): archive = locked_archive(package, archive_directory, stage / "pkg") - print("Preparing locked package " + package["name"] + " " + package["version"], flush=True) + print("Preparing locked package " + package["name"], flush=True) unpack(archive, stage, ignore_owner=system == "Linux") From 3f39341db0324641439724ff6e07b86cfe32c7fc Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 14:51:52 +0800 Subject: [PATCH 18/40] Separate prebuilt dependencies from legacy cache --- .gitignore | 2 + bazel/third_party/repositories.bzl | 9 +-- deps/init/prepare.py | 88 +++++++++++++++++++----------- 3 files changed, 64 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 5f31724974..33f3f4839c 100644 --- a/.gitignore +++ b/.gitignore @@ -210,6 +210,8 @@ src/oblib/grpc/*.pb.cpp !src/oblib/grpc/standbyservice.grpc.pb.h !src/oblib/grpc/standbyservice.grpc.pb.cc deps/3rd +/deps/prebuilt/ +/deps/android-prebuilt/ deps/ios/ deps/3rd_party deps/usr diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index 66dd3af8d9..22e8339ab8 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -14,7 +14,8 @@ def _windows_sdk(repository_ctx): for directory in ["vcpkg/x64-windows/include", "openssl/include", "vsag/include"]: for child in repository_ctx.path(sdk + "/" + directory).readdir(): headers[child.basename] = child - locked_headers = sdk + "/include" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt" + locked_headers = locked_sdk + "/include" if repository_ctx.path(locked_headers).exists: for child in repository_ctx.path(locked_headers).readdir(): headers[child.basename] = child @@ -44,7 +45,7 @@ def _windows_sdk(repository_ctx): "tools/llvm18": "devtools", }.items(): repository_ctx.symlink(sdk + "/" + source, destination) - locked_libraries = sdk + "/lib" + locked_libraries = locked_sdk + "/lib" if repository_ctx.path(locked_libraries).exists: _link_directory_contents(repository_ctx, [locked_libraries, sdk + "/vcpkg/x64-windows/lib"], "lib") else: @@ -80,9 +81,9 @@ def _third_party_headers_repository_impl(repository_ctx): headers = prefix + "/include" libraries = prefix + "/lib" libraries64 = libraries - locked_sdk = str(repository_ctx.workspace_root) + "/deps/3rd" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt" if platform == "android": - locked_sdk = str(repository_ctx.workspace_root) + "/deps/android" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/android-prebuilt" source_headers = [ "absl", "roaring", "vsag", "fmt", "cpuinfo.h", "seekdb-vsag", "omp.h", "ompx.h", "omp-tools.h", "ompt.h", "lapack.h", "lapacke.h", diff --git a/deps/init/prepare.py b/deps/init/prepare.py index c6f540beb4..aed63703c0 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -188,24 +188,30 @@ def sha256_file(path): return digest.hexdigest() -def locked_archive(package, archive_directory, staging_directory): +def locked_archive(package, archive_directory): url = package.get("url") checksum = package.get("sha256", "").lower() if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum): raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + archive_directory.mkdir(parents=True, exist_ok=True) cached = archive_directory / checksum - archive = staging_directory / checksum if cached.is_file() and sha256_file(cached) == checksum: - shutil.copyfile(cached, archive) - return archive - if cached.is_file(): - cached.unlink() - download(locked_download_url(url), archive) - if sha256_file(archive) != checksum: - archive.unlink() - raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) - return archive + return cached + + descriptor, temporary_name = tempfile.mkstemp( + prefix="." + checksum + ".", suffix=".tmp", dir=archive_directory) + os.close(descriptor) + temporary = Path(temporary_name) + try: + download(locked_download_url(url), temporary) + if sha256_file(temporary) != checksum: + raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) + temporary.replace(cached) + finally: + if temporary.exists(): + temporary.unlink() + return cached def unpack(archive, destination, *, ignore_owner=False): @@ -250,35 +256,25 @@ def populate_profile(profile, stage, archive_directory): unpack(archive, stage) -def populate_lock(lock_file, stage, archive_directory, system, architecture): - for package in locked_packages(lock_file, system, architecture): - archive = locked_archive(package, archive_directory, stage / "pkg") - print("Preparing locked package " + package["name"], flush=True) - unpack(archive, stage, ignore_owner=system == "Linux") - - -def populate(profile, destination, key, archive_directory, lock_file, system, architecture): +def populate(profile, destination, key, archive_directory): destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "3rd" (stage / "pkg").mkdir(parents=True) populate_profile(profile, stage, archive_directory) - populate_lock(lock_file, stage, archive_directory, system, architecture) (stage / key).touch() (stage / "DONE").touch() remove_directory(destination) stage.rename(destination) -def install(profile, destination, cache_directory, lock_file, system, architecture): - lock_packages = locked_packages(lock_file, system, architecture) - identity = profile.read_bytes() + json.dumps(lock_packages, sort_keys=True).encode("utf-8") - key = hashlib.sha256(identity).hexdigest() +def install(profile, destination, cache_directory): + key = hashlib.sha256(profile.read_bytes()).hexdigest() if ready(destination, key): print("Dependencies ready: " + str(destination), flush=True) return if cache_directory is None: - populate(profile, destination, key, destination / "pkg", lock_file, system, architecture) + populate(profile, destination, key, destination / "pkg") return import fcntl @@ -288,13 +284,41 @@ def install(profile, destination, cache_directory, lock_file, system, architectu with (cache_directory / (key + ".lock")).open("a") as lock: fcntl.flock(lock, fcntl.LOCK_EX) if not ready(cached, key): - populate(profile, cached, key, destination / "pkg", lock_file, system, architecture) + populate(profile, cached, key, destination / "pkg") destination.parent.mkdir(parents=True, exist_ok=True) remove_directory(destination) destination.symlink_to(cached, target_is_directory=True) print("Dependencies ready: " + str(destination), flush=True) +def install_locked(lock_file, destination, cache_directory, system, architecture): + packages = locked_packages(lock_file, system, architecture) + key = hashlib.sha256(json.dumps(packages, sort_keys=True).encode("utf-8")).hexdigest() + if ready(destination, key): + print("Locked dependencies ready: " + str(destination), flush=True) + return + + destination.parent.mkdir(parents=True, exist_ok=True) + archive_directory = cache_directory / "pkg" if cache_directory else destination / "pkg" + with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: + stage = Path(temporary) / "prebuilt" + stage.mkdir() + for package in packages: + archive = locked_archive(package, archive_directory) + if cache_directory is None: + (stage / "pkg").mkdir(exist_ok=True) + staged_archive = stage / "pkg" / archive.name + shutil.copyfile(archive, staged_archive) + archive = staged_archive + print("Preparing locked package " + package["name"], flush=True) + unpack(archive, stage, ignore_owner=platform.system() == "Linux") + (stage / key).touch() + (stage / "DONE").touch() + remove_directory(destination) + stage.rename(destination) + print("Locked dependencies ready: " + str(destination), flush=True) + + def prepare_rust(target=None): if not shutil.which("rustup") or not shutil.which("cargo"): with tempfile.TemporaryDirectory(prefix="rustup-init.") as directory: @@ -352,15 +376,17 @@ def main(arguments): elif options.ios: rust_target = "aarch64-apple-ios-sim" if options.simulator else "aarch64-apple-ios" prepare_rust(rust_target) - cache = os.environ.get("DEP_CACHE_DIR") if os.name != "nt" else None + cache = os.environ.get("DEP_CACHE_DIR") cache_directory = Path(cache).expanduser().resolve() if cache else None - install(profile, ROOT / "deps/3rd", cache_directory, ROOT / "deps.lock.json", - system, architecture) + install(profile, ROOT / "deps/3rd", cache_directory if os.name != "nt" else None) + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt", cache_directory, + system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: - install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None, - ROOT / "deps.lock.json", "Android", "arm64") + install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None) + install_locked(ROOT / "deps.lock.json", ROOT / "deps/android-prebuilt", cache_directory, + "Android", "arm64") if options.ios: subprocess.run([ sys.executable, str(PROFILES / "ios/build.py"), "--reuse", "--jobs", str(os.cpu_count() or 1), From 85b43622d3313336632ae1664f20df54dae6bcfd Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:05:14 +0800 Subject: [PATCH 19/40] Use platform cache directories for prebuilt packages --- .gitignore | 1 - bazel/third_party/repositories.bzl | 6 +++--- deps/init/prepare.py | 32 +++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 33f3f4839c..3976496283 100644 --- a/.gitignore +++ b/.gitignore @@ -211,7 +211,6 @@ src/oblib/grpc/*.pb.cpp !src/oblib/grpc/standbyservice.grpc.pb.cc deps/3rd /deps/prebuilt/ -/deps/android-prebuilt/ deps/ios/ deps/3rd_party deps/usr diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index 22e8339ab8..2347b37c76 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -14,7 +14,7 @@ def _windows_sdk(repository_ctx): for directory in ["vcpkg/x64-windows/include", "openssl/include", "vsag/include"]: for child in repository_ctx.path(sdk + "/" + directory).readdir(): headers[child.basename] = child - locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/native" locked_headers = locked_sdk + "/include" if repository_ctx.path(locked_headers).exists: for child in repository_ctx.path(locked_headers).readdir(): @@ -81,9 +81,9 @@ def _third_party_headers_repository_impl(repository_ctx): headers = prefix + "/include" libraries = prefix + "/lib" libraries64 = libraries - locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/native" if platform == "android": - locked_sdk = str(repository_ctx.workspace_root) + "/deps/android-prebuilt" + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/android" source_headers = [ "absl", "roaring", "vsag", "fmt", "cpuinfo.h", "seekdb-vsag", "omp.h", "ompx.h", "omp-tools.h", "ompt.h", "lapack.h", "lapacke.h", diff --git a/deps/init/prepare.py b/deps/init/prepare.py index aed63703c0..75a5d5dd60 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -188,6 +188,25 @@ def sha256_file(path): return digest.hexdigest() +def locked_cache_directory(system, cache_directory): + if cache_directory is not None: + return cache_directory / "pkg" + if system == "Windows": + local_appdata = os.environ.get("LOCALAPPDATA") + if not local_appdata or not Path(local_appdata).is_absolute(): + raise ValueError("LOCALAPPDATA is missing or invalid; set DEP_CACHE_DIR for dependency packages") + cache_home = Path(local_appdata) + elif system == "Darwin": + cache_home = Path.home() / "Library" / "Caches" + else: + xdg_cache = os.environ.get("XDG_CACHE_HOME") + if xdg_cache and Path(xdg_cache).is_absolute(): + cache_home = Path(xdg_cache) + else: + cache_home = Path.home() / ".cache" + return cache_home / "seekdb" / "deps" / "pkg" + + def locked_archive(package, archive_directory): url = package.get("url") checksum = package.get("sha256", "").lower() @@ -291,7 +310,7 @@ def install(profile, destination, cache_directory): print("Dependencies ready: " + str(destination), flush=True) -def install_locked(lock_file, destination, cache_directory, system, architecture): +def install_locked(lock_file, destination, archive_directory, system, architecture): packages = locked_packages(lock_file, system, architecture) key = hashlib.sha256(json.dumps(packages, sort_keys=True).encode("utf-8")).hexdigest() if ready(destination, key): @@ -299,17 +318,11 @@ def install_locked(lock_file, destination, cache_directory, system, architecture return destination.parent.mkdir(parents=True, exist_ok=True) - archive_directory = cache_directory / "pkg" if cache_directory else destination / "pkg" with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "prebuilt" stage.mkdir() for package in packages: archive = locked_archive(package, archive_directory) - if cache_directory is None: - (stage / "pkg").mkdir(exist_ok=True) - staged_archive = stage / "pkg" / archive.name - shutil.copyfile(archive, staged_archive) - archive = staged_archive print("Preparing locked package " + package["name"], flush=True) unpack(archive, stage, ignore_owner=platform.system() == "Linux") (stage / key).touch() @@ -378,14 +391,15 @@ def main(arguments): prepare_rust(rust_target) cache = os.environ.get("DEP_CACHE_DIR") cache_directory = Path(cache).expanduser().resolve() if cache else None + archive_directory = locked_cache_directory(system, cache_directory) install(profile, ROOT / "deps/3rd", cache_directory if os.name != "nt" else None) - install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt", cache_directory, + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/native", archive_directory, system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None) - install_locked(ROOT / "deps.lock.json", ROOT / "deps/android-prebuilt", cache_directory, + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/android", archive_directory, "Android", "arm64") if options.ios: subprocess.run([ From b06854d8fd6e4c18e4a4112bf21e9e32870ff1c3 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:11:50 +0800 Subject: [PATCH 20/40] Limit prebuilt gtest packages to Linux --- bazel/third_party/targets.bzl | 3 ++- deps.lock.json | 18 ------------------ deps/init/prepare.py | 8 ++++---- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 4502cf3fd8..c69d4736c8 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -101,7 +101,6 @@ _WINDOWS_HEADER_LIBRARIES = { } def _windows_libraries(): - cc_import(name = "gtest_archive", static_library = "lib/gtest.lib") for name, (interface, dll, deps) in _WINDOWS_SHARED.items(): cc_import( name = name, @@ -137,6 +136,8 @@ def _windows_libraries(): def sdk_targets(windows = False): native.exports_files(HOST_FILES + native.glob(["lib/**/*.a", "lib/**/*.so", "lib/**/*.so.*", "lib64/**/*.a", "lib64/**/*.so", "lib64/**/*.so.*"], allow_empty = True)) for name, attributes in SDK_HEADERS.items(): + if windows and name == "gtest": + continue if windows and name in _WINDOWS_HEADER_LIBRARIES: attributes = attributes | {"deps": _WINDOWS_HEADER_LIBRARIES[name]} if windows and name == "absl_headers": diff --git a/deps.lock.json b/deps.lock.json index 1fb5239411..a2ab01c4bd 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -1,12 +1,6 @@ { "schema_version": 2, "platforms": { - "android-arm64-v8a-api26": { - "gtest": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-android-arm64-v8a-api26-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "6e689c35a406513b7eb358380b6ebd98790f4cf3925d8b9c75793a0470e4b51e" - } - }, "linux-aarch64-glibc217": { "gtest": { "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", @@ -18,18 +12,6 @@ "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", "sha256": "403ff0e270fffeb5a5336696966963cf5e146fb96c70d9cf81b1383d7d0f8efa" } - }, - "macos-arm64-min13": { - "gtest": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-macos-arm64-min13-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "421f1f3e3dec75cb92320f501ac0679db170d002884db7ac079d9702c38ce3d7" - } - }, - "windows-x86_64-md": { - "gtest": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-windows-x86_64-md-20261106-8f0a0a8e9fe6.tar.gz", - "sha256": "f2f42becbbbdee3b2f2e6284d1eb7d4a7983544ab1577642ed621a2be4f73029" - } } } } diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 75a5d5dd60..fafddcff10 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -310,7 +310,7 @@ def install(profile, destination, cache_directory): print("Dependencies ready: " + str(destination), flush=True) -def install_locked(lock_file, destination, archive_directory, system, architecture): +def install_locked(lock_file, destination, cache_directory, system, architecture): packages = locked_packages(lock_file, system, architecture) key = hashlib.sha256(json.dumps(packages, sort_keys=True).encode("utf-8")).hexdigest() if ready(destination, key): @@ -318,6 +318,7 @@ def install_locked(lock_file, destination, archive_directory, system, architectu return destination.parent.mkdir(parents=True, exist_ok=True) + archive_directory = locked_cache_directory(platform.system(), cache_directory) if packages else None with tempfile.TemporaryDirectory(prefix=".deps-", dir=destination.parent) as temporary: stage = Path(temporary) / "prebuilt" stage.mkdir() @@ -391,15 +392,14 @@ def main(arguments): prepare_rust(rust_target) cache = os.environ.get("DEP_CACHE_DIR") cache_directory = Path(cache).expanduser().resolve() if cache else None - archive_directory = locked_cache_directory(system, cache_directory) install(profile, ROOT / "deps/3rd", cache_directory if os.name != "nt" else None) - install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/native", archive_directory, + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/native", cache_directory, system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) if options.android: install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None) - install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/android", archive_directory, + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/android", cache_directory, "Android", "arm64") if options.ios: subprocess.run([ From eca79806a933b0cdb7148e11702e0e77439354b0 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:40:08 +0800 Subject: [PATCH 21/40] Restore gtest header declaration --- bazel/third_party/targets.bzl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index c69d4736c8..c5792ccf9c 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -9,12 +9,7 @@ def _headers(directory, includes = ["include"]): return {"hdrs": ["include/" + directory + "/**/*." + extension for extension in _HEADER_EXTENSIONS], "includes": includes} SDK_HEADERS = { - "gtest": { - "hdrs": [ - "include/gtest/**/*.h", - "include/gmock/**/*.h", - ], - "includes": ["include"], + "gtest": _headers("gtest") | { "deps": [":gtest_archive"], "defines": ["_GLIBCXX_USE_CXX11_ABI=1"], "linkopts": select({"@platforms//os:linux": ["-pthread"], "//conditions:default": []}), From 6ffc2ff7c37c01ff3927c5531ae85a6a25e55e18 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:41:07 +0800 Subject: [PATCH 22/40] Remove Windows gtest special case --- bazel/third_party/targets.bzl | 2 -- 1 file changed, 2 deletions(-) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index c5792ccf9c..72eb38f86f 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -131,8 +131,6 @@ def _windows_libraries(): def sdk_targets(windows = False): native.exports_files(HOST_FILES + native.glob(["lib/**/*.a", "lib/**/*.so", "lib/**/*.so.*", "lib64/**/*.a", "lib64/**/*.so", "lib64/**/*.so.*"], allow_empty = True)) for name, attributes in SDK_HEADERS.items(): - if windows and name == "gtest": - continue if windows and name in _WINDOWS_HEADER_LIBRARIES: attributes = attributes | {"deps": _WINDOWS_HEADER_LIBRARIES[name]} if windows and name == "absl_headers": From 560d2b2261ae2e55e71944612a748e42b183c33f Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:49:49 +0800 Subject: [PATCH 23/40] Allow locked packages without SHA256 --- deps/init/prepare.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index fafddcff10..c48c3ccab5 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -209,22 +209,28 @@ def locked_cache_directory(system, cache_directory): def locked_archive(package, archive_directory): url = package.get("url") - checksum = package.get("sha256", "").lower() - if not url or not re.fullmatch(r"[0-9a-f]{64}", checksum): + checksum = package.get("sha256", "") + if checksum is None: + checksum = "" + if not isinstance(url, str) or not url or not isinstance(checksum, str): + raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + checksum = checksum.lower() + if checksum and not re.fullmatch(r"[0-9a-f]{64}", checksum): raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) + cache_key = checksum or "url-" + hashlib.sha256(url.encode("utf-8")).hexdigest() archive_directory.mkdir(parents=True, exist_ok=True) - cached = archive_directory / checksum - if cached.is_file() and sha256_file(cached) == checksum: + cached = archive_directory / cache_key + if cached.is_file() and (not checksum or sha256_file(cached) == checksum): return cached descriptor, temporary_name = tempfile.mkstemp( - prefix="." + checksum + ".", suffix=".tmp", dir=archive_directory) + prefix="." + cache_key + ".", suffix=".tmp", dir=archive_directory) os.close(descriptor) temporary = Path(temporary_name) try: download(locked_download_url(url), temporary) - if sha256_file(temporary) != checksum: + if checksum and sha256_file(temporary) != checksum: raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) temporary.replace(cached) finally: From d3668e22aa2d4d70575aed881bee4368b2dbfd68 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 15:54:52 +0800 Subject: [PATCH 24/40] Cache unchecked packages by content SHA256 --- deps/init/prepare.py | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/deps/init/prepare.py b/deps/init/prepare.py index c48c3ccab5..6ab6f2bf53 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -218,24 +218,47 @@ def locked_archive(package, archive_directory): if checksum and not re.fullmatch(r"[0-9a-f]{64}", checksum): raise ValueError("Incomplete locked dependency: " + str(package.get("name"))) - cache_key = checksum or "url-" + hashlib.sha256(url.encode("utf-8")).hexdigest() archive_directory.mkdir(parents=True, exist_ok=True) - cached = archive_directory / cache_key - if cached.is_file() and (not checksum or sha256_file(cached) == checksum): - return cached + index = None + if checksum: + cached = archive_directory / checksum + if cached.is_file() and sha256_file(cached) == checksum: + return cached + else: + index = archive_directory / "urls" / hashlib.sha256(url.encode("utf-8")).hexdigest() + if index.is_file(): + cached_checksum = index.read_text(encoding="ascii").strip() + if re.fullmatch(r"[0-9a-f]{64}", cached_checksum): + cached = archive_directory / cached_checksum + if cached.is_file(): + return cached descriptor, temporary_name = tempfile.mkstemp( - prefix="." + cache_key + ".", suffix=".tmp", dir=archive_directory) + prefix=".package.", suffix=".tmp", dir=archive_directory) os.close(descriptor) temporary = Path(temporary_name) try: download(locked_download_url(url), temporary) - if checksum and sha256_file(temporary) != checksum: + actual_checksum = sha256_file(temporary) + if checksum and actual_checksum != checksum: raise ValueError("SHA256 mismatch for " + url.rsplit("/", 1)[-1]) + cached = archive_directory / actual_checksum temporary.replace(cached) finally: if temporary.exists(): temporary.unlink() + + if index is not None: + index.parent.mkdir(parents=True, exist_ok=True) + descriptor, temporary_name = tempfile.mkstemp(prefix=".url.", suffix=".tmp", dir=index.parent) + temporary = Path(temporary_name) + try: + with os.fdopen(descriptor, "w", encoding="ascii") as output: + output.write(actual_checksum + "\n") + temporary.replace(index) + finally: + if temporary.exists(): + temporary.unlink() return cached From aee525d9fd6c041a13556cf14f7a73c04301d448 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 9 Nov 2026 16:17:12 +0800 Subject: [PATCH 25/40] Remove dependency lock schema version --- deps.lock.json | 1 - deps/init/prepare.py | 3 --- 2 files changed, 4 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index a2ab01c4bd..bede0568fd 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -1,5 +1,4 @@ { - "schema_version": 2, "platforms": { "linux-aarch64-glibc217": { "gtest": { diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 6ab6f2bf53..ab2cdd6c22 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -106,9 +106,6 @@ def locked_packages(lock_file, system, architecture): if not lock_file.is_file(): return [] lock = json.loads(lock_file.read_text(encoding="utf-8")) - if lock.get("schema_version") != 2: - raise ValueError("Unsupported dependency lock schema: " + str(lock_file)) - platforms = lock.get("platforms", {}) if not isinstance(platforms, dict): raise ValueError("Invalid dependency lock platforms: " + str(lock_file)) From 9e9c8090ad5aea58eaf02ac8a6279530284bd3ac Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Fri, 13 Nov 2026 18:17:39 +0800 Subject: [PATCH 26/40] Use released VSAG and jemalloc packages on supported platforms --- MODULE.bazel | 2 - bazel/ios_framework.bzl | 4 ++ bazel/sdk_sources/BUILD.bazel | 17 +++----- bazel/sdk_sources/repositories.bzl | 6 +-- bazel/third_party/repositories.bzl | 20 +++++++++- bazel/third_party/targets.bzl | 14 ++++++- deps.lock.json | 54 ++++++++++++++++++++++++++ deps/external/bazel/jemalloc.bzl | 40 +++++++++++++------ deps/init/oceanbase.al8.aarch64.deps | 1 - deps/init/oceanbase.al8.x86_64.deps | 1 - deps/init/oceanbase.android.arm64.deps | 1 - deps/init/oceanbase.el7.aarch64.deps | 1 - deps/init/oceanbase.el7.x86_64.deps | 1 - deps/init/oceanbase.el8.aarch64.deps | 1 - deps/init/oceanbase.el8.x86_64.deps | 1 - deps/init/oceanbase.el9.aarch64.deps | 1 - deps/init/oceanbase.el9.x86_64.deps | 1 - deps/init/oceanbase.macos13.arm64.deps | 1 - deps/init/oceanbase.macos15.arm64.deps | 1 - deps/init/oceanbase.macos27.arm64.deps | 1 - deps/init/prepare.py | 17 +++++++- src/observer/observer_link_deps.bzl | 5 +-- 22 files changed, 143 insertions(+), 48 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index a4dd8f065a..d1fc036089 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -252,8 +252,6 @@ use_repo( sdk_sources, "sdk_abseil", "sdk_roaring", - "sdk_vsag_ios", - "sdk_vsag_wasm", "sdk_cpuinfo", "sdk_fmt", "sdk_spdlog", diff --git a/bazel/ios_framework.bzl b/bazel/ios_framework.bzl index e0c07ca86f..30497a13cc 100644 --- a/bazel/ios_framework.bzl +++ b/bazel/ios_framework.bzl @@ -84,6 +84,8 @@ def ios_framework(): "//bazel/sdk_sources:ios_licenses", "//bazel/third_party:ios_base_metadata", "//bazel/third_party:ios_base_licenses", + "//bazel/third_party:ios_locked_metadata", + "//bazel/third_party:ios_locked_licenses", ], tools = ["//package/ios:package_framework.py"], outs = [ @@ -101,8 +103,10 @@ def ios_framework(): ' --rust-licenses "$(location //package/ios:rust_licenses)"' + ' --source-metadata $(locations //bazel/sdk_sources:ios_source_metadata)' + ' $(locations //bazel/third_party:ios_base_metadata)' + + ' $(locations //bazel/third_party:ios_locked_metadata)' + ' --licenses $(location //:LICENSE) $(locations //bazel/sdk_sources:ios_licenses)' + ' $(locations //bazel/third_party:ios_base_licenses)' + + ' $(locations //bazel/third_party:ios_locked_licenses)' + ' --output "$(@D)/framework/SeekDB.framework" --platform ' + select({ "//bazel:ios_simulator": "IOSSIMULATOR", "//conditions:default": "IOS", diff --git a/bazel/sdk_sources/BUILD.bazel b/bazel/sdk_sources/BUILD.bazel index 1562ecbeac..4cf2203dec 100644 --- a/bazel/sdk_sources/BUILD.bazel +++ b/bazel/sdk_sources/BUILD.bazel @@ -40,28 +40,21 @@ sdk_archives( }), deps = ["@sdk_roaring//:library"] + select({ "@platforms//os:emscripten": [ - "@sdk_vsag_wasm//:library", + "@third_party_wasm//:vsag_sdk", + ], + "//bazel:ios_simulator": [ + "@third_party_ios_simulator//:vsag_sdk", ], "//conditions:default": [ - "@sdk_vsag_ios//:library", + "@third_party_ios//:vsag_sdk", ], }), ) _IOS_SOURCE_REPOSITORIES = [ "@sdk_abseil", - "@sdk_antlr4", "@sdk_boost", - "@sdk_cpuinfo", - "@sdk_fmt", - "@sdk_lapack", - "@sdk_nlohmann_json", - "@sdk_openmp", "@sdk_roaring", - "@sdk_robin_map", - "@sdk_spdlog", - "@sdk_thread_pool", - "@sdk_vsag_ios", ] filegroup( diff --git a/bazel/sdk_sources/repositories.bzl b/bazel/sdk_sources/repositories.bzl index d25bb694ce..854222285d 100644 --- a/bazel/sdk_sources/repositories.bzl +++ b/bazel/sdk_sources/repositories.bzl @@ -39,13 +39,11 @@ _source = repository_rule( def _sdk_sources_impl(ctx): manifest = json.decode(ctx.read(Label("//bazel/sdk_sources:dependencies.json"))) for name in manifest["sources"]: - profiles = ["ios", "wasm"] if name == "vsag" else [""] - for profile in profiles: + if name != "vsag": _source( - name = "sdk_" + name + ("_" + profile if profile else ""), + name = "sdk_" + name, build_file = Label("//bazel/sdk_sources:%s.BUILD" % name), package = name, - profile = profile, ) sdk_sources = module_extension(implementation = _sdk_sources_impl) diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index f61a762ba3..3827efba0e 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -86,6 +86,12 @@ def _third_party_headers_repository_impl(repository_ctx): locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/native" if platform == "android": locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/android" + elif platform == "iphoneos": + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/ios" + elif platform == "iphonesimulator": + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/ios_simulator" + elif platform == "wasm": + locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/wasm" source_headers = [ "absl", "roaring", "vsag", "fmt", "cpuinfo.h", "seekdb-vsag", "omp.h", "ompx.h", "omp-tools.h", "ompt.h", "lapack.h", "lapacke.h", @@ -97,6 +103,11 @@ def _third_party_headers_repository_impl(repository_ctx): fail("Missing iOS dependencies; run ./build.py init --ios" + (" --simulator" if ios_sdk == "iphonesimulator" else "")) target_headers = repository_ctx.path(prefix + "/include") target_names = [child.basename for child in target_headers.readdir()] + locked_headers = locked_sdk + "/include" + if repository_ctx.path(locked_headers).exists: + for child in repository_ctx.path(locked_headers).readdir(): + repository_ctx.symlink(child, "include/" + child.basename) + target_names.append(child.basename) for child in repository_ctx.path(headers).readdir(): if child.basename not in target_names and child.basename not in source_headers + ["boost"]: repository_ctx.symlink(child, "include/" + child.basename) @@ -108,6 +119,10 @@ def _third_party_headers_repository_impl(repository_ctx): libraries = prefix + "/lib" libraries64 = libraries elif platform == "wasm": + locked_headers = locked_sdk + "/include" + if repository_ctx.path(locked_headers).exists: + for child in repository_ctx.path(locked_headers).readdir(): + repository_ctx.symlink(child, "include/" + child.basename) for child in repository_ctx.path(headers).readdir(): if child.basename not in source_headers: repository_ctx.symlink(child, "include/" + child.basename) @@ -119,10 +134,13 @@ def _third_party_headers_repository_impl(repository_ctx): repository_ctx.symlink(headers, "include") repository_ctx.symlink(sdk + "/devtools", "devtools") locked_libraries = locked_sdk + "/lib" - if not ios_sdk and platform != "wasm" and repository_ctx.path(locked_libraries).exists: + if repository_ctx.path(locked_libraries).exists: _link_directory_contents(repository_ctx, [locked_libraries, libraries], "lib") else: repository_ctx.symlink(libraries, "lib") + if ios_sdk: + repository_ctx.symlink(locked_sdk + "/manifest.json", "locked_manifest.json") + repository_ctx.symlink(locked_sdk + "/share/licenses", "locked_licenses") repository_ctx.symlink(libraries64, "lib64") repository_ctx.file("BUILD.bazel", '''load("@seekdb//bazel/third_party:targets.bzl", "sdk_targets") package(default_visibility = ["//visibility:public"]) diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 8847367dc6..745e850791 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -28,6 +28,7 @@ SDK_HEADERS = { }), }, "roaring_headers": _headers("roaring"), + "jemalloc_headers": _headers("jemalloc"), "vsag_headers": _headers("vsag"), "windows_headers": {"hdrs": ["include/pthread*.h", "include/_ptw32.h", "include/sched.h", "include/semaphore.h", "include/dirent.h"], "includes": ["include"]}, } @@ -53,6 +54,8 @@ SDK_IMPORTS = { SDK_FILEGROUPS = { "ios_base_metadata": {"srcs": ["verified/*.json"]}, "ios_base_licenses": {"srcs": ["licenses/**/*"]}, + "ios_locked_metadata": {"srcs": ["locked_manifest.json"]}, + "ios_locked_licenses": {"srcs": ["locked_licenses/**/*"]}, "sanity_pass": {"srcs": ["devtools/lib64/libsanitypass.so"]}, } @@ -135,13 +138,22 @@ def sdk_targets(windows = False): cc_import(name = name, **(attributes | ({"hdrs": native.glob(attributes["hdrs"], allow_empty = True)} if "hdrs" in attributes else {}))) for name, attributes in SDK_FILEGROUPS.items(): native.filegroup(name = name, **(attributes | {"srcs": native.glob(attributes["srcs"], allow_empty = True)})) + vsag_imports = [] + for library in native.glob(["lib/" + name for name in [ + "libvsag_static.a", "libdiskann.a", "libsimd.a", "libcpuinfo.a", + "libopenblas.a", "libio.a", "libomp_static.a", + "libantlr4-runtime.a", "libantlr4-autogen.a", "libfmt.a", + ]], allow_empty = True): + target = "_vsag_sdk_" + library.rsplit("/", 1)[-1] + cc_import(name = target, static_library = library, visibility = ["//visibility:private"]) + vsag_imports.append(":" + target) + cc_library(name = "vsag_sdk", deps = [":vsag_headers"] + vsag_imports) if windows: _windows_libraries() _SOURCE_HEADERS = { "absl_headers": ("abseil", "abseil"), "roaring_headers": ("roaring", "roaring"), - "vsag_headers": ("vsag_ios", "vsag_wasm"), } def sdk_aliases(): diff --git a/deps.lock.json b/deps.lock.json index bede0568fd..d200cf0c57 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -1,15 +1,69 @@ { "platforms": { + "android-arm64-v8a-api26": { + "jemalloc": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/jemalloc-5.3.1/jemalloc-5.3.1-bin-android-arm64-v8a-api26-20261113T092920%2B0000-4c3512459ecc.tar.gz", + "sha256": "1c56becb2d54655fdc79f3edf3a78e1ea2705f700481f58d8a9c1c5cc261e9b1" + }, + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-android-arm64-v8a-api26-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "955a9e3b28ea5e7f2d10301879ec2983b1b162be0ade1202377a3c1f9bb31883" + } + }, + "ios-arm64-device-min18": { + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-device-min18-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "f8dd7eaef04b17ed79ecbb38663a8b56ff1234867fa8dc7e95b4b5df5c93deee" + } + }, + "ios-arm64-simulator-min18": { + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-simulator-min18-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "ce2bdda31a2e6871c08c589a75a4328e88d118e681924963d0f0a06a8b9f43c5" + } + }, "linux-aarch64-glibc217": { "gtest": { "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-aarch64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", "sha256": "6db9db8c31b26a5e52392ac4848d16681470c8554154ac046b47b78a2f65bac6" + }, + "jemalloc": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/jemalloc-5.3.1/jemalloc-5.3.1-bin-linux-aarch64-glibc217-20261113T092920%2B0000-4c3512459ecc.tar.gz", + "sha256": "80343fd4b97c62c9689007d3229f0ea05f8d062b10136a6f094787e154d678ee" + }, + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-aarch64-glibc217-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "501c730180d77b070de5f36dc401fef6bb32a4ba6d7da990dea432f5b1280dba" } }, "linux-x86_64-glibc217": { "gtest": { "url": "https://github.com/oceanbase/seekdb-deps/releases/download/gtest-1.14.0/gtest-1.14.0-bin-linux-x86_64-glibc217-20261106-8f0a0a8e9fe6.tar.gz", "sha256": "403ff0e270fffeb5a5336696966963cf5e146fb96c70d9cf81b1383d7d0f8efa" + }, + "jemalloc": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/jemalloc-5.3.1/jemalloc-5.3.1-bin-linux-x86_64-glibc217-20261113T092920%2B0000-4c3512459ecc.tar.gz", + "sha256": "041ae2dce281770af17c18bec4dbcb3b0524e88366217eca38c0f797c15e64d9" + }, + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-x86_64-glibc217-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "e9e2037601f2cc6f46a0e3b843ca12f77f13a2cefa1ba49338b9d531971843d2" + } + }, + "macos-arm64-min13": { + "jemalloc": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/jemalloc-5.3.1/jemalloc-5.3.1-bin-macos-arm64-min13-20261113T092920%2B0000-4c3512459ecc.tar.gz", + "sha256": "9acb925380fdb1c326513f1fe2a718cbccefa196bc12cf7e36aaa02d131c3473" + }, + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-macos-arm64-min13-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "2a9ebe59b7d26975e65985af4247f105f97784322b0b000deb30feaa0ea53ea6" + } + }, + "wasm32-emscripten": { + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261113T073702%2B0000-655b9e5f1178.tar.gz", + "sha256": "62891c4f3de67bd215771b34c842a35c8034bb78a562fca37945d81d4fe8962d" } } } diff --git a/deps/external/bazel/jemalloc.bzl b/deps/external/bazel/jemalloc.bzl index 1f2dc6ab41..8f1f5cf3ee 100644 --- a/deps/external/bazel/jemalloc.bzl +++ b/deps/external/bazel/jemalloc.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Build and expose the native artifacts from seekdb-jemalloc-sys.""" +"""Expose prebuilt jemalloc, retaining the Rust build for iOS and Windows.""" load("@rules_cc//cc:cc_import.bzl", "cc_import") load("@rules_cc//cc:cc_library.bzl", "cc_library") @@ -50,39 +50,57 @@ _jemalloc_build = rule( ) def jemalloc(name): - """Expose the native outputs of the rules_rust build script to C++.""" + """Expose the platform's jemalloc archive and public header to C++.""" build_target = "_%s_build" % name - public_header_target = "%s_public_header" % name + rust_archive = "_%s_rust_archive" % name + rust_header = "_%s_rust_header" % name _jemalloc_build( name = build_target, target_compatible_with = select({ - "@platforms//os:linux": [], - "@platforms//os:macos": [], "@platforms//os:ios": [], "@platforms//os:windows": [], - "@platforms//os:android": [], "//conditions:default": ["@platforms//:incompatible"], }), ) native.filegroup( - name = "%s_archive" % name, + name = rust_archive, srcs = [":" + build_target], output_group = "jemalloc_archive", - visibility = ["//src/observer:__pkg__"], ) native.filegroup( - name = public_header_target, + name = rust_header, srcs = [":" + build_target], output_group = "jemalloc_header", ) cc_library( - name = "%s_headers" % name, - hdrs = [":" + public_header_target], + name = "_%s_rust_headers" % name, + hdrs = [":" + rust_header], strip_include_prefix = "jemalloc/include", + ) + + native.filegroup( + name = "%s_archive" % name, + srcs = select({ + "@platforms//os:linux": ["@third_party_native//:lib/libjemalloc_pic.a"], + "@platforms//os:macos": ["@third_party_native//:lib/libjemalloc_pic.a"], + "@platforms//os:android": ["@third_party_android//:lib/libjemalloc_pic.a"], + "//conditions:default": [":" + rust_archive], + }), + visibility = ["//src/observer:__pkg__"], + ) + + native.alias( + name = "%s_headers" % name, + actual = select({ + "@platforms//os:linux": "@third_party_native//:jemalloc_headers", + "@platforms//os:macos": "@third_party_native//:jemalloc_headers", + "@platforms//os:android": "@third_party_android//:jemalloc_headers", + "//conditions:default": ":_%s_rust_headers" % name, + }), visibility = ["//src/oblib:__pkg__", "//src/observer:__pkg__"], ) diff --git a/deps/init/oceanbase.al8.aarch64.deps b/deps/init/oceanbase.al8.aarch64.deps index fd41bd1928..df7556fc2e 100644 --- a/deps/init/oceanbase.al8.aarch64.deps +++ b/deps/init/oceanbase.al8.aarch64.deps @@ -15,7 +15,6 @@ devdeps-openssl-static-1.1.1u-132024092718.al8.aarch64.rpm devdeps-boost-1.74.0-72024092811.al8.aarch64.rpm devdeps-abseil-cpp-20211102.0-82026020911.al8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-92024092815.al8.aarch64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.al8.aarch64.rpm [tools] obdevtools-bison-2.4.1-42024092621.al8.aarch64.rpm diff --git a/deps/init/oceanbase.al8.x86_64.deps b/deps/init/oceanbase.al8.x86_64.deps index ed70b305e2..99deb7cf59 100644 --- a/deps/init/oceanbase.al8.x86_64.deps +++ b/deps/init/oceanbase.al8.x86_64.deps @@ -15,7 +15,6 @@ devdeps-openssl-static-1.1.1u-132024092718.al8.x86_64.rpm devdeps-boost-1.74.0-72024092811.al8.x86_64.rpm devdeps-abseil-cpp-20211102.0-82026020911.al8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-92024092815.al8.x86_64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.al8.x86_64.rpm [tools] obdevtools-bison-2.4.1-42024092621.al8.x86_64.rpm diff --git a/deps/init/oceanbase.android.arm64.deps b/deps/init/oceanbase.android.arm64.deps index 38babdbe64..22904a8aef 100644 --- a/deps/init/oceanbase.android.arm64.deps +++ b/deps/init/oceanbase.android.arm64.deps @@ -10,4 +10,3 @@ devdeps-libcurl-8.2.1-20260309.tar.gz devdeps-llvm-17.0.6-20260309.tar.gz devdeps-openssl-1.1.1u-20260309.tar.gz devdeps-roaringbitmap-croaring-3.0.0-20260309.tar.gz -devdeps-vsag-0.18.0-20260407.tar.gz diff --git a/deps/init/oceanbase.el7.aarch64.deps b/deps/init/oceanbase.el7.aarch64.deps index f7283899a6..c954eadb05 100644 --- a/deps/init/oceanbase.el7.aarch64.deps +++ b/deps/init/oceanbase.el7.aarch64.deps @@ -16,7 +16,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el7.aarch64.rpm devdeps-boost-1.74.0-22022110914.el7.aarch64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el7.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.aarch64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el7.aarch64.rpm [tools] obdevtools-bison-2.4.1-12022100413.el7.aarch64.rpm diff --git a/deps/init/oceanbase.el7.x86_64.deps b/deps/init/oceanbase.el7.x86_64.deps index e650ca1119..9c5c02e837 100644 --- a/deps/init/oceanbase.el7.x86_64.deps +++ b/deps/init/oceanbase.el7.x86_64.deps @@ -17,7 +17,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el7.x86_64.rpm devdeps-boost-1.74.0-22022110914.el7.x86_64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el7.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el7.x86_64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el7.x86_64.rpm [tools] obdevtools-bison-2.4.1-12022100413.el7.x86_64.rpm diff --git a/deps/init/oceanbase.el8.aarch64.deps b/deps/init/oceanbase.el8.aarch64.deps index d95518ff7e..ef310f6f36 100644 --- a/deps/init/oceanbase.el8.aarch64.deps +++ b/deps/init/oceanbase.el8.aarch64.deps @@ -16,7 +16,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el8.aarch64.rpm devdeps-boost-1.74.0-22022110914.el8.aarch64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el8.aarch64.rpm [tools] obdevtools-bison-2.4.1-12022100413.el8.aarch64.rpm diff --git a/deps/init/oceanbase.el8.x86_64.deps b/deps/init/oceanbase.el8.x86_64.deps index 01fa7335eb..f8c9ae13d5 100644 --- a/deps/init/oceanbase.el8.x86_64.deps +++ b/deps/init/oceanbase.el8.x86_64.deps @@ -16,7 +16,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el8.x86_64.rpm devdeps-boost-1.74.0-22022110914.el8.x86_64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el8.x86_64.rpm [tools] obdevtools-bison-2.4.1-12022100413.el8.x86_64.rpm diff --git a/deps/init/oceanbase.el9.aarch64.deps b/deps/init/oceanbase.el9.aarch64.deps index 73860b02ea..10efcfb52b 100644 --- a/deps/init/oceanbase.el9.aarch64.deps +++ b/deps/init/oceanbase.el9.aarch64.deps @@ -21,7 +21,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el8.aarch64.rpm devdeps-boost-1.74.0-22022110914.el8.aarch64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el8.aarch64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.aarch64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el8.aarch64.rpm [deps-el9] diff --git a/deps/init/oceanbase.el9.x86_64.deps b/deps/init/oceanbase.el9.x86_64.deps index a1c68ca182..35b0dc8b52 100644 --- a/deps/init/oceanbase.el9.x86_64.deps +++ b/deps/init/oceanbase.el9.x86_64.deps @@ -21,7 +21,6 @@ devdeps-openssl-static-1.1.1u-22023100710.el8.x86_64.rpm devdeps-boost-1.74.0-22022110914.el8.x86_64.rpm devdeps-abseil-cpp-20211102.0-82026020911.el8.x86_64.rpm devdeps-roaringbitmap-croaring-3.0.0-42024042816.el8.x86_64.rpm -devdeps-vsag-abiv1-1.1.0-1752026041310.el8.x86_64.rpm [deps-el9] diff --git a/deps/init/oceanbase.macos13.arm64.deps b/deps/init/oceanbase.macos13.arm64.deps index 35a2cadcdd..5fe71ea314 100644 --- a/deps/init/oceanbase.macos13.arm64.deps +++ b/deps/init/oceanbase.macos13.arm64.deps @@ -14,7 +14,6 @@ devdeps-boost-1.74.0-20260126.tar.gz devdeps-libcurl-8.12.1-20260126.tar.gz devdeps-openssl-1.1.1u-20260126.tar.gz devdeps-roaringbitmap-croaring-3.0.0-20260126.tar.gz -devdeps-vsag-1.1.0-20260126.tar.gz [tools] obdevtools-bison-2.4.1-20260122.tar.gz diff --git a/deps/init/oceanbase.macos15.arm64.deps b/deps/init/oceanbase.macos15.arm64.deps index 2325cebb6d..7a5cb6d013 100644 --- a/deps/init/oceanbase.macos15.arm64.deps +++ b/deps/init/oceanbase.macos15.arm64.deps @@ -15,7 +15,6 @@ devdeps-libcurl-8.12.1-20251210.tar.gz devdeps-openssl-1.1.1u-20251204.tar.gz devdeps-roaringbitmap-croaring-3.0.0-20251208.tar.gz devdeps-xz-5.2.2-20251208.tar.gz -devdeps-vsag-1.1.0-20260107.tar.gz [tools] obdevtools-llvm-17.0.6-20251212.tar.gz obdevtools-bison-2.4.1-20251219.tar.gz diff --git a/deps/init/oceanbase.macos27.arm64.deps b/deps/init/oceanbase.macos27.arm64.deps index 8b21d05c1f..4ae11a1f50 100644 --- a/deps/init/oceanbase.macos27.arm64.deps +++ b/deps/init/oceanbase.macos27.arm64.deps @@ -16,7 +16,6 @@ devdeps-libcurl-8.12.1-20251210.tar.gz devdeps-openssl-1.1.1u-20251204.tar.gz devdeps-roaringbitmap-croaring-3.0.0-20251208.tar.gz devdeps-xz-5.2.2-20251208.tar.gz -devdeps-vsag-1.1.0-20260107.tar.gz [tools] obdevtools-bison-2.4.1-20251219.tar.gz obdevtools-flex-2.5.35-20251219.tar.gz diff --git a/deps/init/prepare.py b/deps/init/prepare.py index ab2cdd6c22..3101caf793 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -109,7 +109,10 @@ def locked_packages(lock_file, system, architecture): platforms = lock.get("platforms", {}) if not isinstance(platforms, dict): raise ValueError("Invalid dependency lock platforms: " + str(lock_file)) - platform_name = {"Darwin": "macos", "Windows": "windows"}.get(system, system.lower()) + platform_name = { + "Darwin": "macos", "Windows": "windows", + "iOSDevice": "ios", "iOSSimulator": "ios", + }.get(system, system.lower()) prefix = "%s-%s" % (platform_name, architecture) pattern = None version = None @@ -127,8 +130,13 @@ def locked_packages(lock_file, system, architecture): elif system == "Android": version = 26 pattern = re.escape(prefix) + r"-v8a-api(\d+)" + elif system in ("iOSDevice", "iOSSimulator"): + version = 18 + variant = "device" if system == "iOSDevice" else "simulator" + pattern = re.escape(prefix) + "-" + variant + r"-min(\d+)" - target = prefix + "-md" if system == "Windows" else prefix + target = (prefix + "-md" if system == "Windows" else + "wasm32-emscripten" if system == "Wasm" else prefix) if pattern: candidates = [] for name in platforms: @@ -423,6 +431,8 @@ def main(arguments): system, architecture) if options.wasm: subprocess.run([sys.executable, str(PROFILES / "wasm/build.py")], cwd=ROOT, check=True) + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/wasm", cache_directory, + "Wasm", "wasm32") if options.android: install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None) install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/android", cache_directory, @@ -431,6 +441,9 @@ def main(arguments): subprocess.run([ sys.executable, str(PROFILES / "ios/build.py"), "--reuse", "--jobs", str(os.cpu_count() or 1), ] + (["--simulator"] if options.simulator else []), cwd=ROOT, check=True) + install_locked(ROOT / "deps.lock.json", + ROOT / "deps/prebuilt" / ("ios_simulator" if options.simulator else "ios"), + cache_directory, "iOSSimulator" if options.simulator else "iOSDevice", "arm64") subprocess.run([ sys.executable, str(ROOT / "build.py"), "build", "--config=" + ("ios-simulator" if options.simulator else "ios"), diff --git a/src/observer/observer_link_deps.bzl b/src/observer/observer_link_deps.bzl index c4c749b9df..a1ff837703 100644 --- a/src/observer/observer_link_deps.bzl +++ b/src/observer/observer_link_deps.bzl @@ -28,15 +28,14 @@ def observer_third_party_link_files(platform): repository = "@third_party_android" if android else "@third_party_native" macos = platform == "macos" lib64 = "lib" if android or macos else "lib64" - vsag = "lib" if android else "lib/vsag_lib" + vsag = "lib" files = [] files += [vsag + "/" + name for name in [ "libcpuinfo.a", "libsimd.a", "libvsag_static.a", "libdiskann.a", ]] if macos: files += [vsag + "/" + name for name in [ - "libio.a", "libgfortran_static.a", "libquadmath_static.a", - "libgcc.a", "libomp_static.a", "libopenblas.a", + "libio.a", "libomp_static.a", "libopenblas.a", ]] else: files += [vsag + "/libopenblas.a"] From 2f1350bc5d051dc962154e69e9477af4c9f4163b Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 16 Nov 2026 10:03:40 +0800 Subject: [PATCH 27/40] Use Windows MD release packages and official rustup in hosted CI --- .github/workflows/codeql.yml | 5 +++++ .github/workflows/rust-checks.yml | 5 +++++ bazel/third_party/repositories.bzl | 10 ++++++---- bazel/third_party/targets.bzl | 6 +++--- deps.lock.json | 10 ++++++++++ deps/external/bazel/jemalloc.bzl | 18 +++++++----------- deps/init/oceanbase.windows.x86_64.deps | 1 - 7 files changed, 36 insertions(+), 19 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 03b5b490b9..da793dc564 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,6 +4,11 @@ on: schedule: - cron: "0 0 * * 1" # every Monday +env: + RUSTUP_DIST_SERVER: https://static.rust-lang.org + RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup + RUSTUP_INIT_URL: https://sh.rustup.rs + jobs: codeql: runs-on: ubuntu-22.04 diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml index e3fb67f54d..69a3895571 100644 --- a/.github/workflows/rust-checks.yml +++ b/.github/workflows/rust-checks.yml @@ -39,6 +39,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +env: + RUSTUP_DIST_SERVER: https://static.rust-lang.org + RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup + RUSTUP_INIT_URL: https://sh.rustup.rs + jobs: clippy-and-audit: runs-on: ubuntu-latest diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index 3827efba0e..38fa2502d7 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -11,7 +11,7 @@ def _link_directory_contents(repository_ctx, directories, destination): def _windows_sdk(repository_ctx): sdk = str(repository_ctx.workspace_root) + "/deps/3rd" headers = {} - for directory in ["vcpkg/x64-windows/include", "openssl/include", "vsag/include"]: + for directory in ["vcpkg/x64-windows/include", "openssl/include"]: for child in repository_ctx.path(sdk + "/" + directory).readdir(): headers[child.basename] = child locked_sdk = str(repository_ctx.workspace_root) + "/deps/prebuilt/native" @@ -39,14 +39,16 @@ def _windows_sdk(repository_ctx): if result.return_code: fail("Cannot prepare Windows dirent header: " + result.stderr) for source, destination in { - "vcpkg/x64-windows/bin": "bin", "openssl/lib/VC/x64/MD": "openssl", "openssl/bin": "openssl_bin", - "vsag/lib": "vsag", - "vsag/bin": "vsag_bin", "tools/llvm18": "devtools", }.items(): repository_ctx.symlink(sdk + "/" + source, destination) + locked_bins = locked_sdk + "/bin" + if repository_ctx.path(locked_bins).exists: + _link_directory_contents(repository_ctx, [locked_bins, sdk + "/vcpkg/x64-windows/bin"], "bin") + else: + repository_ctx.symlink(sdk + "/vcpkg/x64-windows/bin", "bin") locked_libraries = locked_sdk + "/lib" if repository_ctx.path(locked_libraries).exists: _link_directory_contents(repository_ctx, [locked_libraries, sdk + "/vcpkg/x64-windows/lib"], "lib") diff --git a/bazel/third_party/targets.bzl b/bazel/third_party/targets.bzl index 745e850791..008c63398e 100644 --- a/bazel/third_party/targets.bzl +++ b/bazel/third_party/targets.bzl @@ -80,7 +80,7 @@ _WINDOWS_SHARED = { "abseil_dll": ("lib/abseil_dll.lib", "bin/abseil_dll.dll", []), "roaring": ("lib/roaring.lib", "bin/roaring.dll", []), "pthreads": ("lib/pthreadVC3.lib", "bin/pthreadVC3.dll", []), - "openmp": ("vsag/libomp.lib", "vsag_bin/libomp.dll", []), + "openmp": ("lib/libomp.lib", "bin/libomp.dll", []), } _WINDOWS_HEADER_LIBRARIES = { @@ -104,7 +104,7 @@ def _windows_libraries(): # Archives within one upstream package stay private to its library target. archives = { "absl": (native.glob(["lib/absl_*.lib"]), [":abseil_dll"]), - "vsag": (["vsag/" + name + ".lib" for name in [ + "vsag": (["lib/" + name + ".lib" for name in [ "cpuinfo", "simd", "vsag_static", "diskann", "openblas", "antlr4-runtime-static", "antlr4-autogen", "fmt", ]], [":openmp"]), @@ -125,7 +125,7 @@ def _windows_libraries(): ) def sdk_targets(windows = False): - native.exports_files(HOST_FILES + native.glob(["lib/**/*.a", "lib/**/*.so", "lib/**/*.so.*", "lib64/**/*.a", "lib64/**/*.so", "lib64/**/*.so.*"], allow_empty = True)) + native.exports_files(HOST_FILES + native.glob(["lib/**/*.a", "lib/**/*.so", "lib/**/*.so.*", "lib64/**/*.a", "lib64/**/*.so", "lib64/**/*.so.*"] + (["lib/**/*.lib"] if windows else []), allow_empty = True)) for name, attributes in SDK_HEADERS.items(): if windows and name in _WINDOWS_HEADER_LIBRARIES: attributes = attributes | {"deps": _WINDOWS_HEADER_LIBRARIES[name]} diff --git a/deps.lock.json b/deps.lock.json index d200cf0c57..9d819925f0 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -65,6 +65,16 @@ "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261113T073702%2B0000-655b9e5f1178.tar.gz", "sha256": "62891c4f3de67bd215771b34c842a35c8034bb78a562fca37945d81d4fe8962d" } + }, + "windows-x86_64-md": { + "jemalloc": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/jemalloc-5.3.1/jemalloc-5.3.1-bin-windows-x86_64-md-20261114T020301%2B0000-845c8920ddfb.tar.gz", + "sha256": "c4613853aabe251fa5abf12dec68bd468cf47551735185f1270ae228bd9cef49" + }, + "vsag": { + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-windows-x86_64-md-20261114T022500%2B0000-24707283d449.tar.gz", + "sha256": "49b1a01fb56bcd8d19b301cffd926ac078c92332fe4ddff5aba70ab1289fdbd8" + } } } } diff --git a/deps/external/bazel/jemalloc.bzl b/deps/external/bazel/jemalloc.bzl index 8f1f5cf3ee..2c219c88e8 100644 --- a/deps/external/bazel/jemalloc.bzl +++ b/deps/external/bazel/jemalloc.bzl @@ -12,27 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Expose prebuilt jemalloc, retaining the Rust build for iOS and Windows.""" +"""Expose prebuilt jemalloc, retaining the Rust build for iOS.""" load("@rules_cc//cc:cc_import.bzl", "cc_import") load("@rules_cc//cc:cc_library.bzl", "cc_library") load("@rules_rust//rust:rust_common.bzl", "BuildInfo") -load("//bazel:platforms.bzl", "PLATFORM_ATTRS", "target_platform") def _jemalloc_build_impl(ctx): - windows = target_platform(ctx).os == "windows" - archive_name = "jemalloc.lib" if windows else "libjemalloc_pic.a" - built_archive = "jemalloc_s.lib" if windows else "libjemalloc_pic.a" - archive = ctx.actions.declare_file("jemalloc/lib/" + archive_name) + archive = ctx.actions.declare_file("jemalloc/lib/libjemalloc_pic.a") public_header = ctx.actions.declare_file("jemalloc/include/jemalloc/jemalloc.h") output = ctx.attr.build_script[BuildInfo].out_dir ctx.actions.run_shell( inputs = [output], outputs = [archive, public_header], - arguments = [output.path, archive.path, public_header.path, built_archive], - command = 'cp "$1/jemalloc-build/lib/$4" "$2" && cp "$1/jemalloc-build/include/jemalloc/jemalloc.h" "$3"', + arguments = [output.path, archive.path, public_header.path], + command = 'cp "$1/jemalloc-build/lib/libjemalloc_pic.a" "$2" && cp "$1/jemalloc-build/include/jemalloc/jemalloc.h" "$3"', mnemonic = "JemallocArtifacts", - use_default_shell_env = windows, ) return [ DefaultInfo(files = depset([archive, public_header])), @@ -46,7 +41,7 @@ _jemalloc_build = rule( implementation = _jemalloc_build_impl, attrs = { "build_script": attr.label(default = "@external_crates//:jemalloc_build", providers = [BuildInfo]), - } | PLATFORM_ATTRS, + }, ) def jemalloc(name): @@ -59,7 +54,6 @@ def jemalloc(name): name = build_target, target_compatible_with = select({ "@platforms//os:ios": [], - "@platforms//os:windows": [], "//conditions:default": ["@platforms//:incompatible"], }), ) @@ -88,6 +82,7 @@ def jemalloc(name): "@platforms//os:linux": ["@third_party_native//:lib/libjemalloc_pic.a"], "@platforms//os:macos": ["@third_party_native//:lib/libjemalloc_pic.a"], "@platforms//os:android": ["@third_party_android//:lib/libjemalloc_pic.a"], + "@platforms//os:windows": ["@third_party_native//:lib/jemalloc.lib"], "//conditions:default": [":" + rust_archive], }), visibility = ["//src/observer:__pkg__"], @@ -99,6 +94,7 @@ def jemalloc(name): "@platforms//os:linux": "@third_party_native//:jemalloc_headers", "@platforms//os:macos": "@third_party_native//:jemalloc_headers", "@platforms//os:android": "@third_party_android//:jemalloc_headers", + "@platforms//os:windows": "@third_party_native//:jemalloc_headers", "//conditions:default": ":_%s_rust_headers" % name, }), visibility = ["//src/oblib:__pkg__", "//src/observer:__pkg__"], diff --git a/deps/init/oceanbase.windows.x86_64.deps b/deps/init/oceanbase.windows.x86_64.deps index 6d4936d93b..9af152c4c2 100644 --- a/deps/init/oceanbase.windows.x86_64.deps +++ b/deps/init/oceanbase.windows.x86_64.deps @@ -12,7 +12,6 @@ devdeps-abseil-20260506.tar.gz devdeps-boost-geometry-20260506.tar.gz devdeps-roaring-20260506.tar.gz devdeps-openssl-20260414.tar.gz -devdeps-vsag-20260416.tar.gz [tools] obdevtools-llvm-18.1.8-20260414.tar.gz From 844a26370fa4ff5da44e603f34a129b9463773ae Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 16 Nov 2026 10:43:12 +0800 Subject: [PATCH 28/40] Verify seekdb dependency migration on Apple platforms --- .../workflows/dependency-platform-checks.yml | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/dependency-platform-checks.yml diff --git a/.github/workflows/dependency-platform-checks.yml b/.github/workflows/dependency-platform-checks.yml new file mode 100644 index 0000000000..999bd930ed --- /dev/null +++ b/.github/workflows/dependency-platform-checks.yml @@ -0,0 +1,57 @@ +# Copyright (c) 2025 OceanBase. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: dependency-platform-checks + +on: + pull_request: + paths: + - 'deps.lock.json' + - 'deps/init/**' + - 'deps/external/**' + - 'bazel/third_party/**' + - 'bazel/sdk_sources/**' + - '.github/workflows/dependency-platform-checks.yml' + +permissions: + contents: read + +jobs: + apple: + name: ${{ matrix.platform }} + runs-on: macos-15 + timeout-minutes: 360 + strategy: + fail-fast: false + matrix: + include: + - platform: macos-arm64 + init: '' + config: '' + - platform: ios-arm64 + init: '--ios' + config: '--config=ios' + env: + RUSTUP_DIST_SERVER: https://static.rust-lang.org + RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup + RUSTUP_INIT_URL: https://sh.rustup.rs + SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' + steps: + - uses: actions/checkout@v4 + - name: Show build environment + run: uname -a; xcodebuild -version; df -h . + - name: Initialize dependencies + run: python3 build.py init ${{ matrix.init }} + - name: Build seekdb + run: python3 build.py build ${{ matrix.config }} --jobs=2 seekdb From d92f67c46af4625abaff546c3bc27ca0ecd1ef02 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Mon, 16 Nov 2026 11:44:10 +0800 Subject: [PATCH 29/40] Match VSAG allocator size type on wasm32 --- src/observer/vector_index/ob_plugin_vector_index_adaptor.cpp | 4 ++-- src/query/api/query/vector/ob_vector_index_adaptor.h | 4 ++-- src/storage/allocator/ob_vector_allocator.cpp | 4 ++-- src/storage/allocator/ob_vector_allocator.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/observer/vector_index/ob_plugin_vector_index_adaptor.cpp b/src/observer/vector_index/ob_plugin_vector_index_adaptor.cpp index 37819166b3..d09a1f53d8 100644 --- a/src/observer/vector_index/ob_plugin_vector_index_adaptor.cpp +++ b/src/observer/vector_index/ob_plugin_vector_index_adaptor.cpp @@ -4778,7 +4778,7 @@ bool ObHnswBitmapFilter::is_subset(roaring::api::roaring64_bitmap_t *bitmap) return bret; } -void *ObVsagSearchAlloc::Allocate(uint64_t size) +void *ObVsagSearchAlloc::Allocate(vsag::AllocatorSize size) { void *ret_ptr = nullptr; @@ -4795,7 +4795,7 @@ void *ObVsagSearchAlloc::Allocate(uint64_t size) return ret_ptr; } -void *ObVsagSearchAlloc::Reallocate(void* p, uint64_t size) +void *ObVsagSearchAlloc::Reallocate(void* p, vsag::AllocatorSize size) { void *new_ptr = nullptr; if (size == 0) { diff --git a/src/query/api/query/vector/ob_vector_index_adaptor.h b/src/query/api/query/vector/ob_vector_index_adaptor.h index 96e14d64b1..723f2ec74f 100644 --- a/src/query/api/query/vector/ob_vector_index_adaptor.h +++ b/src/query/api/query/vector/ob_vector_index_adaptor.h @@ -242,9 +242,9 @@ class ObVsagSearchAlloc : public vsag::Allocator {} std::string Name() override { return "ObVsagSearchAlloc"; } - void* Allocate(uint64_t size) override; + void* Allocate(vsag::AllocatorSize size) override; void Deallocate(void* p) override { alloc_.free(p); }; - void* Reallocate(void* p, uint64_t size) override; + void* Reallocate(void* p, vsag::AllocatorSize size) override; int64_t hold() { return alloc_.total(); } int64_t used() { return alloc_.used(); } void reset() { alloc_.reset(); } diff --git a/src/storage/allocator/ob_vector_allocator.cpp b/src/storage/allocator/ob_vector_allocator.cpp index 702ee23a1f..9ab5caea5f 100644 --- a/src/storage/allocator/ob_vector_allocator.cpp +++ b/src/storage/allocator/ob_vector_allocator.cpp @@ -49,7 +49,7 @@ void *ObVectorAllocator::alloc(const int64_t size, const ObMemAttr &attr) } -void *ObVsagMemContext::Allocate(uint64_t size) +void *ObVsagMemContext::Allocate(vsag::AllocatorSize size) { void *ret_ptr = nullptr; int ret = OB_SUCCESS; @@ -78,7 +78,7 @@ void ObVsagMemContext::Deallocate(void* p) } } -void *ObVsagMemContext::Reallocate(void* p, uint64_t size) +void *ObVsagMemContext::Reallocate(void* p, vsag::AllocatorSize size) { void *new_ptr = nullptr; if (size == 0) { diff --git a/src/storage/allocator/ob_vector_allocator.h b/src/storage/allocator/ob_vector_allocator.h index dd572d9a45..da9b0dc45a 100644 --- a/src/storage/allocator/ob_vector_allocator.h +++ b/src/storage/allocator/ob_vector_allocator.h @@ -87,11 +87,11 @@ class ObVsagMemContext : public vsag::Allocator, std::string Name() override { return "ObVsagAlloc"; } - void* Allocate(uint64_t size) override; + void* Allocate(vsag::AllocatorSize size) override; void Deallocate(void* p) override; - void* Reallocate(void* p, uint64_t size) override; + void* Reallocate(void* p, vsag::AllocatorSize size) override; int64_t hold() { int res = 0; From 5180e7e93337671d8160a178a9a2eabcfec13d61 Mon Sep 17 00:00:00 2001 From: hnwyllmm <5187215+hnwyllmm@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:11:59 +0800 Subject: [PATCH 30/40] Align Windows seekdb toolset with released VSAG package --- build.py | 13 +++++++++++++ deps.lock.json | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build.py b/build.py index 61cd1699c3..b4b51fdef8 100755 --- a/build.py +++ b/build.py @@ -21,6 +21,17 @@ class BuildError(RuntimeError): """The seekdb build environment could not be prepared.""" +def _check_windows_toolset() -> None: + # Released Windows dependencies were built with the VS 2022 14.44 toolset. + version = os.environ.get("VCToolsVersion", "") + if not re.fullmatch(r"14\.44\.\d+", version): + raise BuildError( + "Windows builds require the MSVC 14.44 toolset used by seekdb-deps; " + "initialize the VS 2022 x64 developer environment with -vcvars_ver=14.44 " + "(found %s)" % (version or "no active MSVC toolset") + ) + + def _host_platform() -> str: system = {"Linux": "linux", "Darwin": "darwin", "Windows": "windows"}.get( platform.system() @@ -225,6 +236,8 @@ def main(arguments: List[str]) -> int: command, *arguments = arguments if command.startswith("-"): parser.error("put the command before its options, for example: build -o build3 seekdb") + if os.name == "nt" and command in ("build", "test", "run", "coverage"): + _check_windows_toolset() separator = arguments.index("--") if "--" in arguments else len(arguments) options, remaining = bootstrap.parse_known_args(arguments[:separator]) cache = options.launcher_cache_dir.expanduser().resolve() diff --git a/deps.lock.json b/deps.lock.json index 9d819925f0..98192cb8dd 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -72,8 +72,8 @@ "sha256": "c4613853aabe251fa5abf12dec68bd468cf47551735185f1270ae228bd9cef49" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-windows-x86_64-md-20261114T022500%2B0000-24707283d449.tar.gz", - "sha256": "49b1a01fb56bcd8d19b301cffd926ac078c92332fe4ddff5aba70ab1289fdbd8" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-windows-x86_64-md-20261116T024308%2B0000-e8260eea65ea.tar.gz", + "sha256": "e713992579a7cff08f01efa862fcd14aac9633afea9d53088a53a173d7dabd87" } } } From 2b6cdfca434e1d47876563d80332f40c8230736d Mon Sep 17 00:00:00 2001 From: hnwyllmm <5187215+hnwyllmm@users.noreply.github.com> Date: Mon, 16 Nov 2026 12:14:38 +0800 Subject: [PATCH 31/40] Target macOS 15 for seekdb Bazel builds --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index a692b0cd94..7fe68cfc30 100644 --- a/.bazelrc +++ b/.bazelrc @@ -44,7 +44,7 @@ build:O1 --@rules_rust//rust/settings:lto=off build:O2 --compilation_mode=opt # Apple's fastbuild/dbg DEBUG macro conflicts with seekdb's DEBUG log level. build:macos --copt=-UDEBUG -build:macos --macos_minimum_os=13.0 +build:macos --macos_minimum_os=15.0 build:android --platforms=//bazel/platforms:android_arm64 build:ios --platforms=@apple_support//platforms:ios_arm64 build:ios --ios_minimum_os=18.0 From 0cba44025630ee38fb6fcdd2e754e946a1fa693e Mon Sep 17 00:00:00 2001 From: hnwyllmm <5187215+hnwyllmm@users.noreply.github.com> Date: Mon, 16 Nov 2026 16:27:37 +0800 Subject: [PATCH 32/40] Update VSAG release package pins for all platforms --- deps.lock.json | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index 98192cb8dd..46ab33ea88 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -6,20 +6,20 @@ "sha256": "1c56becb2d54655fdc79f3edf3a78e1ea2705f700481f58d8a9c1c5cc261e9b1" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-android-arm64-v8a-api26-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "955a9e3b28ea5e7f2d10301879ec2983b1b162be0ade1202377a3c1f9bb31883" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-android-arm64-v8a-api26-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "6508edba1550b02f8e11c8d898b9bb79f69dd376158452f7ed13123357c51868" } }, "ios-arm64-device-min18": { "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-device-min18-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "f8dd7eaef04b17ed79ecbb38663a8b56ff1234867fa8dc7e95b4b5df5c93deee" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-device-min18-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "f3da41f8752b0781377b7283c0112bbf81c3f24b7c68c6c3a949ceb1bfdaed33" } }, "ios-arm64-simulator-min18": { "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-simulator-min18-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "ce2bdda31a2e6871c08c589a75a4328e88d118e681924963d0f0a06a8b9f43c5" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-ios-arm64-simulator-min18-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e708ec65aecaea1ed45e799990fa08147b12ea97f399d241192405c358ac9908" } }, "linux-aarch64-glibc217": { @@ -32,8 +32,8 @@ "sha256": "80343fd4b97c62c9689007d3229f0ea05f8d062b10136a6f094787e154d678ee" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-aarch64-glibc217-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "501c730180d77b070de5f36dc401fef6bb32a4ba6d7da990dea432f5b1280dba" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-aarch64-glibc217-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e30183e23d29f477936c1ee5f3ef92467003ee62e0ce42195e082e3744b0033c" } }, "linux-x86_64-glibc217": { @@ -46,8 +46,8 @@ "sha256": "041ae2dce281770af17c18bec4dbcb3b0524e88366217eca38c0f797c15e64d9" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-x86_64-glibc217-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "e9e2037601f2cc6f46a0e3b843ca12f77f13a2cefa1ba49338b9d531971843d2" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-linux-x86_64-glibc217-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "d9b9d2d7f6122d6e4a2e60c46afa2ec7d3e3858db42c194687d234fd4f086a53" } }, "macos-arm64-min13": { @@ -56,14 +56,14 @@ "sha256": "9acb925380fdb1c326513f1fe2a718cbccefa196bc12cf7e36aaa02d131c3473" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-macos-arm64-min13-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "2a9ebe59b7d26975e65985af4247f105f97784322b0b000deb30feaa0ea53ea6" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-macos-arm64-min13-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "8dc91f3b7618656e1b9bcd58bab694bcf2995e54a0eba704ca9e9f4477508b8c" } }, "wasm32-emscripten": { "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261113T073702%2B0000-655b9e5f1178.tar.gz", - "sha256": "62891c4f3de67bd215771b34c842a35c8034bb78a562fca37945d81d4fe8962d" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "9d7996cc0564c0646da9e1f4c31bd093dd045084d5f556e6d49c901cf76d8e2b" } }, "windows-x86_64-md": { @@ -72,8 +72,8 @@ "sha256": "c4613853aabe251fa5abf12dec68bd468cf47551735185f1270ae228bd9cef49" }, "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-windows-x86_64-md-20261116T024308%2B0000-e8260eea65ea.tar.gz", - "sha256": "e713992579a7cff08f01efa862fcd14aac9633afea9d53088a53a173d7dabd87" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-windows-x86_64-md-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e1f27d782f614caad7a24ae19a2fcb40f64a63405b1ae9ea1cfd427b7c8191aa" } } } From 46d859b1d0c235db9019dff1dfb557430338629b Mon Sep 17 00:00:00 2001 From: hnwyllmm <5187215+hnwyllmm@users.noreply.github.com> Date: Mon, 16 Nov 2026 17:44:06 +0800 Subject: [PATCH 33/40] Validate dependency packages on Linux arm64 and iOS simulator --- .../workflows/dependency-platform-checks.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/dependency-platform-checks.yml b/.github/workflows/dependency-platform-checks.yml index 999bd930ed..12cfb3e89d 100644 --- a/.github/workflows/dependency-platform-checks.yml +++ b/.github/workflows/dependency-platform-checks.yml @@ -28,6 +28,23 @@ permissions: contents: read jobs: + linux-arm64: + runs-on: ubuntu-24.04-arm + timeout-minutes: 360 + env: + RUSTUP_DIST_SERVER: https://static.rust-lang.org + RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup + RUSTUP_INIT_URL: https://sh.rustup.rs + SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' + steps: + - uses: actions/checkout@v4 + - name: Show build environment + run: uname -a; df -h . + - name: Initialize dependencies + run: python3 build.py init + - name: Build seekdb + run: python3 build.py build --jobs=2 seekdb + apple: name: ${{ matrix.platform }} runs-on: macos-15 @@ -42,6 +59,9 @@ jobs: - platform: ios-arm64 init: '--ios' config: '--config=ios' + - platform: ios-simulator-arm64 + init: '--ios --simulator' + config: '--config=ios-simulator' env: RUSTUP_DIST_SERVER: https://static.rust-lang.org RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup From a3a224a0ceb7a916992c4aef36b440083c2180f6 Mon Sep 17 00:00:00 2001 From: hnwyllmm <5187215+hnwyllmm@users.noreply.github.com> Date: Mon, 16 Nov 2026 18:53:51 +0800 Subject: [PATCH 34/40] Include required Rust libraries in WebAssembly build --- rust/seekdb-rust/BUILD.bazel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/seekdb-rust/BUILD.bazel b/rust/seekdb-rust/BUILD.bazel index 1a0aba3346..f361dab3c1 100644 --- a/rust/seekdb-rust/BUILD.bazel +++ b/rust/seekdb-rust/BUILD.bazel @@ -27,14 +27,14 @@ rust_static_library( "//rust/spatial-covering:spatial_covering", "//rust/uuid-generator:uuid_generator", "//rust/json", + "//rust/math", + "//rust/vector-kernels:vector_kernels", + "//rust/path-utils:path_utils", ] + select({ "@platforms//os:emscripten": [], "//conditions:default": [ "//rust/standby-rpc:standby_rpc", "//rust/http-client:http_client", - "//rust/math", - "//rust/vector-kernels:vector_kernels", - "//rust/path-utils:path_utils", ], }), proc_macro_deps = all_crate_deps(proc_macro = True), From fedee4b8bde4c87bfbb8dd17b8a0d911e83d14f1 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 09:37:55 +0800 Subject: [PATCH 35/40] Remove obsolete VSAG iOS and WASM source patches --- MODULE.bazel | 11 - MODULE.bazel.lock | 117 +------ bazel/sdk_sources/BUILD.bazel | 10 - bazel/sdk_sources/antlr4.BUILD | 175 ---------- bazel/sdk_sources/clapack.BUILD | 89 ----- bazel/sdk_sources/cpuinfo.BUILD | 54 --- bazel/sdk_sources/dependencies.json | 458 ------------------------- bazel/sdk_sources/fmt.BUILD | 34 -- bazel/sdk_sources/lapack.BUILD | 43 --- bazel/sdk_sources/nlohmann_json.BUILD | 23 -- bazel/sdk_sources/openblas.BUILD | 53 --- bazel/sdk_sources/openblas/blas_abi.h | 25 -- bazel/sdk_sources/openmp.BUILD | 96 ------ bazel/sdk_sources/openmp/configure.bzl | 35 -- bazel/sdk_sources/openmp/kmp_config.h | 140 -------- bazel/sdk_sources/prepare.py | 19 - bazel/sdk_sources/robin_map.BUILD | 23 -- bazel/sdk_sources/spdlog.BUILD | 25 -- bazel/sdk_sources/thread_pool.BUILD | 23 -- bazel/sdk_sources/vsag.BUILD | 293 ---------------- bazel/sdk_sources/vsag/ios/cblas.h | 19 - 21 files changed, 5 insertions(+), 1760 deletions(-) delete mode 100644 bazel/sdk_sources/antlr4.BUILD delete mode 100644 bazel/sdk_sources/clapack.BUILD delete mode 100644 bazel/sdk_sources/cpuinfo.BUILD delete mode 100644 bazel/sdk_sources/fmt.BUILD delete mode 100644 bazel/sdk_sources/lapack.BUILD delete mode 100644 bazel/sdk_sources/nlohmann_json.BUILD delete mode 100644 bazel/sdk_sources/openblas.BUILD delete mode 100644 bazel/sdk_sources/openblas/blas_abi.h delete mode 100644 bazel/sdk_sources/openmp.BUILD delete mode 100644 bazel/sdk_sources/openmp/configure.bzl delete mode 100644 bazel/sdk_sources/openmp/kmp_config.h delete mode 100644 bazel/sdk_sources/robin_map.BUILD delete mode 100644 bazel/sdk_sources/spdlog.BUILD delete mode 100644 bazel/sdk_sources/thread_pool.BUILD delete mode 100644 bazel/sdk_sources/vsag.BUILD delete mode 100644 bazel/sdk_sources/vsag/ios/cblas.h diff --git a/MODULE.bazel b/MODULE.bazel index d1fc036089..a459aed63a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -252,17 +252,6 @@ use_repo( sdk_sources, "sdk_abseil", "sdk_roaring", - "sdk_cpuinfo", - "sdk_fmt", - "sdk_spdlog", - "sdk_nlohmann_json", - "sdk_robin_map", - "sdk_thread_pool", - "sdk_clapack", - "sdk_openblas", - "sdk_antlr4", - "sdk_lapack", - "sdk_openmp", "sdk_boost", ) diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 63d784d432..459c852f2c 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -205,138 +205,31 @@ "moduleExtensions": { "//bazel/sdk_sources:repositories.bzl%sdk_sources": { "general": { - "bzlTransitiveDigest": "wjCRn4cLyvC/wUfKXaD731rHkDKSdgW0Uk8ATAYtrSo=", + "bzlTransitiveDigest": "6qbbcXCKyLfjRt7/fjlAk+QaxaAbiAQTZk24i6KV55g=", "usagesDigest": "C88oWWRSwl985DWTNoqa3RJhrmyPEurpg8bTGjwBxHo=", "recordedInputs": [ - "FILE:@@//bazel/sdk_sources/dependencies.json dc42c8f57f31d55f6ba4d3be551661e93937662415599b8c3601a2561968eda6" + "FILE:@@//bazel/sdk_sources/dependencies.json e6cc5afa8c36fef2bb50de9d9b870a71a0f4333edc11951fa2a03dbdabb03ca7" ], "generatedRepoSpecs": { "sdk_abseil": { "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", "attributes": { "build_file": "@@//bazel/sdk_sources:abseil.BUILD", - "package": "abseil", - "profile": "" + "package": "abseil" } }, "sdk_roaring": { "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", "attributes": { "build_file": "@@//bazel/sdk_sources:roaring.BUILD", - "package": "roaring", - "profile": "" - } - }, - "sdk_vsag_ios": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:vsag.BUILD", - "package": "vsag", - "profile": "ios" - } - }, - "sdk_vsag_wasm": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:vsag.BUILD", - "package": "vsag", - "profile": "wasm" - } - }, - "sdk_cpuinfo": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:cpuinfo.BUILD", - "package": "cpuinfo", - "profile": "" - } - }, - "sdk_fmt": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:fmt.BUILD", - "package": "fmt", - "profile": "" - } - }, - "sdk_spdlog": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:spdlog.BUILD", - "package": "spdlog", - "profile": "" - } - }, - "sdk_nlohmann_json": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:nlohmann_json.BUILD", - "package": "nlohmann_json", - "profile": "" - } - }, - "sdk_robin_map": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:robin_map.BUILD", - "package": "robin_map", - "profile": "" - } - }, - "sdk_thread_pool": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:thread_pool.BUILD", - "package": "thread_pool", - "profile": "" - } - }, - "sdk_clapack": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:clapack.BUILD", - "package": "clapack", - "profile": "" - } - }, - "sdk_openblas": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:openblas.BUILD", - "package": "openblas", - "profile": "" - } - }, - "sdk_antlr4": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:antlr4.BUILD", - "package": "antlr4", - "profile": "" - } - }, - "sdk_lapack": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:lapack.BUILD", - "package": "lapack", - "profile": "" - } - }, - "sdk_openmp": { - "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", - "attributes": { - "build_file": "@@//bazel/sdk_sources:openmp.BUILD", - "package": "openmp", - "profile": "" + "package": "roaring" } }, "sdk_boost": { "repoRuleId": "@@//bazel/sdk_sources:repositories.bzl%_source", "attributes": { "build_file": "@@//bazel/sdk_sources:boost.BUILD", - "package": "boost", - "profile": "" + "package": "boost" } } } diff --git a/bazel/sdk_sources/BUILD.bazel b/bazel/sdk_sources/BUILD.bazel index 4cf2203dec..26d6091b21 100644 --- a/bazel/sdk_sources/BUILD.bazel +++ b/bazel/sdk_sources/BUILD.bazel @@ -1,4 +1,3 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") load(":archives.bzl", "sdk_archives") package(default_visibility = ["//visibility:public"]) @@ -6,17 +5,8 @@ package(default_visibility = ["//visibility:public"]) exports_files(glob(["*.BUILD"]) + [ "dependencies.json", "prepare.py", - "openblas/blas_abi.h", - "openmp/kmp_config.h", ]) -cc_library( - name = "ios_cblas", - hdrs = ["vsag/ios/cblas.h"], - includes = ["vsag/ios"], - target_compatible_with = ["@platforms//os:ios"], -) - alias( name = "base_crypto", actual = select({ diff --git a/bazel/sdk_sources/antlr4.BUILD b/bazel/sdk_sources/antlr4.BUILD deleted file mode 100644 index 0a4e71b21d..0000000000 --- a/bazel/sdk_sources/antlr4.BUILD +++ /dev/null @@ -1,175 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "runtime/Cpp/runtime/src/ANTLRErrorListener.cpp", - "runtime/Cpp/runtime/src/ANTLRErrorStrategy.cpp", - "runtime/Cpp/runtime/src/ANTLRFileStream.cpp", - "runtime/Cpp/runtime/src/ANTLRInputStream.cpp", - "runtime/Cpp/runtime/src/BailErrorStrategy.cpp", - "runtime/Cpp/runtime/src/BaseErrorListener.cpp", - "runtime/Cpp/runtime/src/BufferedTokenStream.cpp", - "runtime/Cpp/runtime/src/CharStream.cpp", - "runtime/Cpp/runtime/src/CommonToken.cpp", - "runtime/Cpp/runtime/src/CommonTokenFactory.cpp", - "runtime/Cpp/runtime/src/CommonTokenStream.cpp", - "runtime/Cpp/runtime/src/ConsoleErrorListener.cpp", - "runtime/Cpp/runtime/src/DefaultErrorStrategy.cpp", - "runtime/Cpp/runtime/src/DiagnosticErrorListener.cpp", - "runtime/Cpp/runtime/src/Exceptions.cpp", - "runtime/Cpp/runtime/src/FailedPredicateException.cpp", - "runtime/Cpp/runtime/src/InputMismatchException.cpp", - "runtime/Cpp/runtime/src/IntStream.cpp", - "runtime/Cpp/runtime/src/InterpreterRuleContext.cpp", - "runtime/Cpp/runtime/src/Lexer.cpp", - "runtime/Cpp/runtime/src/LexerInterpreter.cpp", - "runtime/Cpp/runtime/src/LexerNoViableAltException.cpp", - "runtime/Cpp/runtime/src/ListTokenSource.cpp", - "runtime/Cpp/runtime/src/NoViableAltException.cpp", - "runtime/Cpp/runtime/src/Parser.cpp", - "runtime/Cpp/runtime/src/ParserInterpreter.cpp", - "runtime/Cpp/runtime/src/ParserRuleContext.cpp", - "runtime/Cpp/runtime/src/ProxyErrorListener.cpp", - "runtime/Cpp/runtime/src/RecognitionException.cpp", - "runtime/Cpp/runtime/src/Recognizer.cpp", - "runtime/Cpp/runtime/src/RuleContext.cpp", - "runtime/Cpp/runtime/src/RuleContextWithAltNum.cpp", - "runtime/Cpp/runtime/src/RuntimeMetaData.cpp", - "runtime/Cpp/runtime/src/Token.cpp", - "runtime/Cpp/runtime/src/TokenSource.cpp", - "runtime/Cpp/runtime/src/TokenStream.cpp", - "runtime/Cpp/runtime/src/TokenStreamRewriter.cpp", - "runtime/Cpp/runtime/src/UnbufferedCharStream.cpp", - "runtime/Cpp/runtime/src/UnbufferedTokenStream.cpp", - "runtime/Cpp/runtime/src/Vocabulary.cpp", - "runtime/Cpp/runtime/src/WritableToken.cpp", - "runtime/Cpp/runtime/src/atn/ATN.cpp", - "runtime/Cpp/runtime/src/atn/ATNConfig.cpp", - "runtime/Cpp/runtime/src/atn/ATNConfigSet.cpp", - "runtime/Cpp/runtime/src/atn/ATNDeserializationOptions.cpp", - "runtime/Cpp/runtime/src/atn/ATNDeserializer.cpp", - "runtime/Cpp/runtime/src/atn/ATNSimulator.cpp", - "runtime/Cpp/runtime/src/atn/ATNState.cpp", - "runtime/Cpp/runtime/src/atn/ATNStateType.cpp", - "runtime/Cpp/runtime/src/atn/ActionTransition.cpp", - "runtime/Cpp/runtime/src/atn/AmbiguityInfo.cpp", - "runtime/Cpp/runtime/src/atn/ArrayPredictionContext.cpp", - "runtime/Cpp/runtime/src/atn/AtomTransition.cpp", - "runtime/Cpp/runtime/src/atn/ContextSensitivityInfo.cpp", - "runtime/Cpp/runtime/src/atn/DecisionEventInfo.cpp", - "runtime/Cpp/runtime/src/atn/DecisionInfo.cpp", - "runtime/Cpp/runtime/src/atn/DecisionState.cpp", - "runtime/Cpp/runtime/src/atn/EpsilonTransition.cpp", - "runtime/Cpp/runtime/src/atn/ErrorInfo.cpp", - "runtime/Cpp/runtime/src/atn/LL1Analyzer.cpp", - "runtime/Cpp/runtime/src/atn/LexerATNConfig.cpp", - "runtime/Cpp/runtime/src/atn/LexerATNSimulator.cpp", - "runtime/Cpp/runtime/src/atn/LexerAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerActionExecutor.cpp", - "runtime/Cpp/runtime/src/atn/LexerChannelAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerCustomAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerIndexedCustomAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerModeAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerMoreAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerPopModeAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerPushModeAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerSkipAction.cpp", - "runtime/Cpp/runtime/src/atn/LexerTypeAction.cpp", - "runtime/Cpp/runtime/src/atn/LookaheadEventInfo.cpp", - "runtime/Cpp/runtime/src/atn/NotSetTransition.cpp", - "runtime/Cpp/runtime/src/atn/OrderedATNConfigSet.cpp", - "runtime/Cpp/runtime/src/atn/ParseInfo.cpp", - "runtime/Cpp/runtime/src/atn/ParserATNSimulator.cpp", - "runtime/Cpp/runtime/src/atn/PrecedencePredicateTransition.cpp", - "runtime/Cpp/runtime/src/atn/PredicateEvalInfo.cpp", - "runtime/Cpp/runtime/src/atn/PredicateTransition.cpp", - "runtime/Cpp/runtime/src/atn/PredictionContext.cpp", - "runtime/Cpp/runtime/src/atn/PredictionContextCache.cpp", - "runtime/Cpp/runtime/src/atn/PredictionContextMergeCache.cpp", - "runtime/Cpp/runtime/src/atn/PredictionMode.cpp", - "runtime/Cpp/runtime/src/atn/ProfilingATNSimulator.cpp", - "runtime/Cpp/runtime/src/atn/RangeTransition.cpp", - "runtime/Cpp/runtime/src/atn/RuleTransition.cpp", - "runtime/Cpp/runtime/src/atn/SemanticContext.cpp", - "runtime/Cpp/runtime/src/atn/SetTransition.cpp", - "runtime/Cpp/runtime/src/atn/SingletonPredictionContext.cpp", - "runtime/Cpp/runtime/src/atn/StarLoopbackState.cpp", - "runtime/Cpp/runtime/src/atn/Transition.cpp", - "runtime/Cpp/runtime/src/atn/TransitionType.cpp", - "runtime/Cpp/runtime/src/atn/WildcardTransition.cpp", - "runtime/Cpp/runtime/src/dfa/DFA.cpp", - "runtime/Cpp/runtime/src/dfa/DFASerializer.cpp", - "runtime/Cpp/runtime/src/dfa/DFAState.cpp", - "runtime/Cpp/runtime/src/dfa/LexerDFASerializer.cpp", - "runtime/Cpp/runtime/src/internal/Synchronization.cpp", - "runtime/Cpp/runtime/src/misc/InterpreterDataReader.cpp", - "runtime/Cpp/runtime/src/misc/Interval.cpp", - "runtime/Cpp/runtime/src/misc/IntervalSet.cpp", - "runtime/Cpp/runtime/src/misc/MurmurHash.cpp", - "runtime/Cpp/runtime/src/misc/Predicate.cpp", - "runtime/Cpp/runtime/src/support/Any.cpp", - "runtime/Cpp/runtime/src/support/Arrays.cpp", - "runtime/Cpp/runtime/src/support/CPPUtils.cpp", - "runtime/Cpp/runtime/src/support/StringUtils.cpp", - "runtime/Cpp/runtime/src/support/Utf8.cpp", - "runtime/Cpp/runtime/src/tree/ErrorNodeImpl.cpp", - "runtime/Cpp/runtime/src/tree/IterativeParseTreeWalker.cpp", - "runtime/Cpp/runtime/src/tree/ParseTree.cpp", - "runtime/Cpp/runtime/src/tree/ParseTreeListener.cpp", - "runtime/Cpp/runtime/src/tree/ParseTreeVisitor.cpp", - "runtime/Cpp/runtime/src/tree/ParseTreeWalker.cpp", - "runtime/Cpp/runtime/src/tree/TerminalNodeImpl.cpp", - "runtime/Cpp/runtime/src/tree/Trees.cpp", - "runtime/Cpp/runtime/src/tree/pattern/Chunk.cpp", - "runtime/Cpp/runtime/src/tree/pattern/ParseTreeMatch.cpp", - "runtime/Cpp/runtime/src/tree/pattern/ParseTreePattern.cpp", - "runtime/Cpp/runtime/src/tree/pattern/ParseTreePatternMatcher.cpp", - "runtime/Cpp/runtime/src/tree/pattern/RuleTagToken.cpp", - "runtime/Cpp/runtime/src/tree/pattern/TagChunk.cpp", - "runtime/Cpp/runtime/src/tree/pattern/TextChunk.cpp", - "runtime/Cpp/runtime/src/tree/pattern/TokenTagToken.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPath.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathLexerErrorListener.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathRuleAnywhereElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathRuleElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathTokenAnywhereElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathTokenElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathWildcardAnywhereElement.cpp", - "runtime/Cpp/runtime/src/tree/xpath/XPathWildcardElement.cpp", - ], - hdrs = glob( - [ - "runtime/Cpp/runtime/src/**/*.h", - "antlr4-runtime/**/*.h", - ], - allow_empty = True, - ), - copts = ["-std=c++17"] + select({ - "@platforms//os:emscripten": [ - "-pthread", - "-fexceptions", - ], - "//conditions:default": [], - }), - defines = ["ANTLR4CPP_STATIC"], - includes = [ - ".", - "runtime/Cpp/runtime/src", - ], - linkstatic = True, -) - -filegroup( - name = "licenses", - srcs = ["LICENSE.txt"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/clapack.BUILD b/bazel/sdk_sources/clapack.BUILD deleted file mode 100644 index 429cd83fee..0000000000 --- a/bazel/sdk_sources/clapack.BUILD +++ /dev/null @@ -1,89 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "BLAS/SRC/isamax.c", - "BLAS/SRC/saxpy.c", - "BLAS/SRC/scopy.c", - "BLAS/SRC/sdot.c", - "BLAS/SRC/sgemm.c", - "BLAS/SRC/sgemv.c", - "BLAS/SRC/sger.c", - "BLAS/SRC/snrm2.c", - "BLAS/SRC/sscal.c", - "BLAS/SRC/sswap.c", - "BLAS/SRC/ssymv.c", - "BLAS/SRC/ssyr2.c", - "BLAS/SRC/ssyr2k.c", - "BLAS/SRC/strmm.c", - "BLAS/SRC/strmv.c", - "BLAS/SRC/strsm.c", - "BLAS/SRC/xerbla.c", - "F2CLIBS/libf2c/i_nint.c", - "F2CLIBS/libf2c/pow_ii.c", - "F2CLIBS/libf2c/pow_ri.c", - "F2CLIBS/libf2c/r_sign.c", - "F2CLIBS/libf2c/s_cmp.c", - "F2CLIBS/libf2c/s_copy.c", - "INSTALL/lsame.c", - "INSTALL/slamch.c", - "SRC/ieeeck.c", - "SRC/ilaenv.c", - "SRC/ilaslc.c", - "SRC/ilaslr.c", - "SRC/iparmq.c", - "SRC/sgeqr2.c", - "SRC/sgeqrf.c", - "SRC/sgetf2.c", - "SRC/sgetrf.c", - "SRC/sisnan.c", - "SRC/slae2.c", - "SRC/slaev2.c", - "SRC/slaisnan.c", - "SRC/slanst.c", - "SRC/slansy.c", - "SRC/slapy2.c", - "SRC/slarf.c", - "SRC/slarfb.c", - "SRC/slarfg.c", - "SRC/slarfp.c", - "SRC/slarft.c", - "SRC/slartg.c", - "SRC/slascl.c", - "SRC/slaset.c", - "SRC/slasr.c", - "SRC/slasrt.c", - "SRC/slassq.c", - "SRC/slaswp.c", - "SRC/slatrd.c", - "SRC/sorg2l.c", - "SRC/sorg2r.c", - "SRC/sorgql.c", - "SRC/sorgqr.c", - "SRC/sorgtr.c", - "SRC/ssteqr.c", - "SRC/ssterf.c", - "SRC/ssyev.c", - "SRC/ssytd2.c", - "SRC/ssytrd.c", - ], - hdrs = glob( - [ - "INCLUDE/*.h", - "F2CLIBS/libf2c/*.h", - ], - allow_empty = True, - ), - additional_compiler_inputs = ["@seekdb//bazel/sdk_sources:openblas/blas_abi.h"], - copts = [ - "-pthread", - "-include", - "$(location @seekdb//bazel/sdk_sources:openblas/blas_abi.h)", - ], - includes = ["INCLUDE"], - linkstatic = True, - local_defines = ["NO_BLAS_WRAP"], -) diff --git a/bazel/sdk_sources/cpuinfo.BUILD b/bazel/sdk_sources/cpuinfo.BUILD deleted file mode 100644 index 729cb0f3b2..0000000000 --- a/bazel/sdk_sources/cpuinfo.BUILD +++ /dev/null @@ -1,54 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "src/api.c", - "src/cache.c", - "src/init.c", - "src/log.c", - ] + select({ - "@platforms//os:emscripten": ["src/emscripten/init.c"], - "//conditions:default": [ - "src/arm/cache.c", - "src/arm/mach/init.c", - "src/arm/uarch.c", - "src/mach/topology.c", - ], - }), - hdrs = glob( - [ - "include/**/*.h", - "src/**/*.h", - ], - allow_empty = True, - ), - copts = select({ - "@platforms//os:emscripten": [ - "-pthread", - "-fexceptions", - ], - "//conditions:default": [], - }), - includes = [ - "include", - "src", - ], - linkstatic = True, - local_defines = [ - "CPUINFO_LOG_TO_STDIO=1", - "CPUINFO_LOG_LEVEL=2", - ], -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/dependencies.json b/bazel/sdk_sources/dependencies.json index 7ebe5ade16..25bb2fdc70 100644 --- a/bazel/sdk_sources/dependencies.json +++ b/bazel/sdk_sources/dependencies.json @@ -12,79 +12,6 @@ "sha256": "25183bc54ab650d964256d547869a34573a13d06f7e6a369b79e77f5c1feb8ba", "source_directory": "CRoaring-3.0.0" }, - "vsag": { - "version": "129b82c", - "url": "https://codeload.github.com/antgroup/vsag/tar.gz/129b82c", - "sha256": "4cd2f2ba5f3fe894f9ebe0a943d2cb479234bfb5614a7cdc089981ce859365c6", - "source_directory": "vsag-129b82c", - "native_version": "129b82c-dirty; all public headers match this source archive" - }, - "cpuinfo": { - "version": "ca678952a9a8eaa6de112d154e8e104b22f9ab3f", - "url": "https://codeload.github.com/pytorch/cpuinfo/tar.gz/ca678952a9a8eaa6de112d154e8e104b22f9ab3f", - "sha256": "c8f43b307fa7d911d88fec05448161eb1949c3fc0cb62f3a7a2c61928cdf2e9b", - "source_directory": "cpuinfo-ca678952a9a8eaa6de112d154e8e104b22f9ab3f" - }, - "fmt": { - "version": "10.2.1", - "url": "https://codeload.github.com/fmtlib/fmt/tar.gz/refs/tags/10.2.1", - "sha256": "1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811", - "source_directory": "fmt-10.2.1" - }, - "spdlog": { - "version": "v1.12.0", - "url": "https://codeload.github.com/gabime/spdlog/tar.gz/refs/tags/v1.12.0", - "sha256": "4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9", - "source_directory": "spdlog-1.12.0" - }, - "nlohmann_json": { - "version": "v3.11.3", - "url": "https://codeload.github.com/nlohmann/json/tar.gz/refs/tags/v3.11.3", - "sha256": "0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406", - "source_directory": "json-3.11.3" - }, - "robin_map": { - "version": "v1.4.0", - "url": "https://codeload.github.com/Tessil/robin-map/tar.gz/refs/tags/v1.4.0", - "sha256": "7930dbf9634acfc02686d87f615c0f4f33135948130b8922331c16d90a03250c", - "source_directory": "robin-map-1.4.0" - }, - "thread_pool": { - "version": "3507796e172d36555b47d6191f170823d9f6b12c", - "url": "https://codeload.github.com/log4cplus/ThreadPool/tar.gz/3507796e172d36555b47d6191f170823d9f6b12c", - "sha256": "5919b8c88af6d22994c816c59e222dff9ef488995388727507407219f6654788", - "source_directory": "ThreadPool-3507796e172d36555b47d6191f170823d9f6b12c" - }, - "clapack": { - "version": "3.2.1", - "url": "https://www.netlib.org/clapack/clapack-3.2.1-CMAKE.tgz", - "sha256": "0b3f782bc24845d85f36bafbff0f2f1384dc72df730fda4e7924ec1a70baca5a", - "source_directory": "clapack-3.2.1-CMAKE" - }, - "openblas": { - "version": "0.3.23", - "url": "https://codeload.github.com/OpenMathLib/OpenBLAS/tar.gz/refs/tags/v0.3.23", - "sha256": "5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114", - "source_directory": "OpenBLAS-0.3.23" - }, - "antlr4": { - "version": "4.13.2", - "url": "https://codeload.github.com/antlr/antlr4/tar.gz/refs/tags/4.13.2", - "sha256": "9f18272a9b32b622835a3365f850dd1063d60f5045fb1e12ce475ae6e18a35bb", - "source_directory": "antlr4-4.13.2" - }, - "lapack": { - "version": "3.12.0", - "url": "https://codeload.github.com/Reference-LAPACK/lapack/tar.gz/refs/tags/v3.12.0", - "sha256": "eac9570f8e0ad6f30ce4b963f4f033f0f643e7c3912fc9ee6cd99120675ad48b", - "source_directory": "lapack-3.12.0" - }, - "openmp": { - "version": "21.1.8", - "url": "https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.8/openmp-21.1.8.src.tar.xz", - "sha256": "856b023748b41ac7b2c83fd8e9f765ff48a4df2fe6777d2811ef7c7ed8f2f977", - "source_directory": "openmp-21.1.8.src" - }, "boost": { "version": "1.74.0", "url": "https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.bz2", @@ -93,391 +20,6 @@ } }, "patches": { - "vsag_dataset_paths": { - "path": "src/dataset_impl.cpp", - "description": "DeepCopy must preserve absent optional Paths instead of dereferencing a null string array.", - "input_sha256": "fdce87529cda3d1ad4e87a8df3ed8a9e1b284d7a62b8a37ad948b96c87c64dc6", - "output_sha256": "994569b9d1abb1a04fb05e1ba77322acc91a339c97ed714856096240fb5094e5", - "replacements": [ - [ - " auto* paths = new std::string[num_elements];\n copy_dataset->Paths(paths);\n for (int i = 0; i < num_elements; ++i) {\n paths[i] += this->GetPaths()[i];\n }", - " if (const auto* source_paths = this->GetPaths(); source_paths != nullptr) {\n auto* paths = new std::string[num_elements];\n copy_dataset->Paths(paths);\n for (int64_t i = 0; i < num_elements; ++i) {\n paths[i] = source_paths[i];\n }\n }" - ] - ] - }, - "vsag_stream_sizes": { - "path": "src/storage/stream_reader.h", - "description": "Validate 64-bit string/vector lengths before conversion to target size_t and before reading payloads.", - "input_sha256": "2a6bee0ad7d03c3b5173a40a649b1da93134e46ffd4da5d01dbb46684f4ce54b", - "output_sha256": "72c2672809aca2fe9d725ce690723b46992063792c0e4e0e5052aeea4fb11938", - "replacements": [ - [ - "#include ", - "#include \n#include " - ], - [ - " std::vector buffer(length);\n reader.Read(buffer.data(), length);\n return {buffer.data(), length};", - " std::string result;\n if (length > result.max_size()) {\n throw std::length_error(\"VSAG string exceeds target address space\");\n }\n result.resize(static_cast(length));\n if (length != 0) {\n reader.Read(result.data(), length);\n }\n return result;" - ], - [ - " val.resize(size);\n reader.Read(reinterpret_cast(val.data()), size * sizeof(T));", - " if (size > val.max_size() || size > SIZE_MAX / sizeof(T)) {\n throw std::length_error(\"VSAG vector exceeds target address space\");\n }\n val.resize(static_cast(size));\n if (size != 0) {\n reader.Read(reinterpret_cast(val.data()), size * sizeof(T));\n }" - ] - ] - }, - "vsag_allocator_sizes": { - "path": "src/impl/allocator/default_allocator.cpp", - "description": "Reject uint64 allocation sizes not representable in target size_t; preserve the original block on rejected realloc.", - "input_sha256": "a8a9a88e0a9605fc0d7ea783a9db618c7378ecc367a524b25e9011f5f5382f54", - "output_sha256": "cc8c045ee9d451a28ae32d36cd9508333a0c7ba3b802bc1a472d481205a6a285", - "replacements": [ - [ - "#include ", - "#include \n#include " - ], - [ - "DefaultAllocator::Allocate(uint64_t size) {", - "DefaultAllocator::Allocate(uint64_t size) {\n if (size > SIZE_MAX) {\n return nullptr;\n }" - ], - [ - "DefaultAllocator::Reallocate(void* p, uint64_t size) {", - "DefaultAllocator::Reallocate(void* p, uint64_t size) {\n if (size > SIZE_MAX) {\n return nullptr;\n }" - ] - ] - }, - "vsag_source_patches": { - "description": "Keep static PQ HNSW optional with explicit unsupported errors; remove unused DiskANN includes; guard OpenMP thread settings when using a serial BLAS backend; keep empty HGraph reverse loops valid on wasm32. Pthread task execution remains intact.", - "files": [ - { - "path": "src/algorithm/hgraph.cpp", - "description": "Convert the upper-graph count to int64_t before subtracting one, so an empty vector skips reverse traversal on wasm32.", - "input_sha256": "b5e13a0b1ab68b235561bae24ee40275eaf594e38ffb3f552f5028426340d4db", - "output_sha256": "47d7d52f3d2f96dbc8f4c41a8db3b498b247ca28f21e815626d32cfab5fe00e4", - "replacements": [ - [ - " for (auto i = static_cast(this->route_graphs_.size() - 1); i >= 0; --i) {", - " for (auto i = static_cast(this->route_graphs_.size()) - 1; i >= 0; --i) {" - ], - [ - " for (auto i = static_cast(this->route_graphs_.size() - 1); i >= 0; --i) {\n auto result = this->search_one_graph(raw_query,", - " for (auto i = static_cast(this->route_graphs_.size()) - 1; i >= 0; --i) {\n auto result = this->search_one_graph(raw_query," - ], - [ - " for (auto i = static_cast(this->route_graphs_.size() - 1); i >= 0; --i) {\n auto result = this->search_one_graph(\n", - " for (auto i = static_cast(this->route_graphs_.size()) - 1; i >= 0; --i) {\n auto result = this->search_one_graph(\n" - ] - ] - }, - { - "path": "src/algorithm/hnswlib/hnswlib.h", - "input_sha256": "76bfafda3cf238c6784d6650293207a302f28c5517b08d3e69c4bb10cd0dd0b5", - "output_sha256": "71adf41fd0179ccae578697f767efbc4ae383f3d49fd36665da52f1a02b7a2d5", - "replacements": [ - [ - "#include \"hnswalg_static.h\"", - "#ifndef VSAG_DISABLE_STATIC_HNSW\n#include \"hnswalg_static.h\"\n#endif" - ] - ] - }, - { - "path": "src/index/hnsw.cpp", - "input_sha256": "d88895568affcd0ee301f4787621cb80a5ef7455e839d9d581f92741f431a790", - "output_sha256": "6b3cc7d2426b0e9c2ae8c2e5a04ba8dd189518cf73d5e688e273f8fb4d29ec6e", - "replacements": [ - [ - " } else {\n if (dim_ % 4 != 0) {", - " } else {\n#ifdef VSAG_DISABLE_STATIC_HNSW\n throw VsagException(ErrorType::UNSUPPORTED_INDEX, \"static PQ HNSW is disabled in this build\");\n#else\n if (dim_ % 4 != 0) {" - ], - [ - " Options::Instance().block_size_limit());\n }", - " Options::Instance().block_size_limit());\n#endif\n }" - ], - [ - " if (use_static_) {\n SlowTaskTimer t(\"hnsw pq\", 1000);", - "#ifndef VSAG_DISABLE_STATIC_HNSW\n if (use_static_) {\n SlowTaskTimer t(\"hnsw pq\", 1000);" - ], - [ - " hnsw->encode_hnsw_data();\n }", - " hnsw->encode_hnsw_data();\n }\n#endif" - ] - ] - }, - { - "path": "src/impl/odescent/odescent_graph_builder.h", - "input_sha256": "f0d9441a550e89a0c1390f20ee8edb571f85f7f8f18bc8ab23fd2867fe16cbd2", - "output_sha256": "e4b6c24a9ffdfdb252778c0d9bb6e9963765b8103bb41caf0570c03c20995779", - "replacements": [ - [ - "#include \"diskann_logger.h\"\n", - "" - ], - [ - "#include \"utils.h\"\n", - "" - ] - ] - }, - { - "path": "src/impl/cluster/kmeans_cluster.cpp", - "input_sha256": "2fb6b26137018ef891fa52750486c3c5cc6ce35436c08ed30a029d1a4f6e4165", - "output_sha256": "5f1b84195b6695975ca60e28f58441d791ba548eb3de1d9822a86f1c66a697a3", - "replacements": [ - [ - "#include ", - "#ifdef _OPENMP\n#include \n#endif" - ], - [ - "#include \"diskann_logger.h\"\n", - "" - ], - [ - "auto update_centroids_func = [&](uint64_t start, uint64_t end) {\n omp_set_num_threads(1);", - "auto update_centroids_func = [&](uint64_t start, uint64_t end) {\n#ifdef _OPENMP\n omp_set_num_threads(1);\n#endif" - ], - [ - "auto assign_labels_func = [&](uint64_t start, uint64_t end) -> void {\n omp_set_num_threads(1);", - "auto assign_labels_func = [&](uint64_t start, uint64_t end) -> void {\n#ifdef _OPENMP\n omp_set_num_threads(1);\n#endif" - ] - ] - }, - { - "path": "src/impl/conjugate_graph.cpp", - "description": "Count the serialized uint64 neighbor length rather than target size_t, so wasm32 footer offsets survive reopen.", - "input_sha256": "65cb33d123068e021230d449fd99470fb3c1e7a291804dc078b329440b64671a", - "output_sha256": "5efa29de4fb7a5e638a3b289eced89d025201560e4d99a2484d1e8c9bf8cf1cc", - "replacements": [ - [ - "memory_usage_ += sizeof(neighbor_set->size());", - "// Serialize writes the neighbor count as uint64_t on every target.\n memory_usage_ += sizeof(uint64_t);" - ] - ] - }, - { - "path": "src/factory/engine.cpp", - "description": "Make DiskANN optional; seekdb selects HNSW/HGraph/SINDI, and explicit DiskANN requests must report UNSUPPORTED_INDEX.", - "input_sha256": "cc10acab0e349900717912e8594896b6459b70efc3855df89625c3b728e7d63a", - "output_sha256": "fc75e3a04c98338462f756743c3fe7094de8f5d96e0c4cfb7fed0245caaf2c8a", - "replacements": [ - [ - "#include \"index/diskann.h\"\n#include \"index/diskann_zparameters.h\"", - "#ifndef VSAG_DISABLE_DISKANN\n#include \"index/diskann.h\"\n#include \"index/diskann_zparameters.h\"\n#endif" - ], - [ - " } else if (name == INDEX_DISKANN) {", - " } else if (name == INDEX_DISKANN) {\n#ifdef VSAG_DISABLE_DISKANN\n LOG_ERROR_AND_RETURNS(ErrorType::UNSUPPORTED_INDEX, \"DiskANN is disabled in this build\");\n#else" - ], - [ - " return std::make_shared(diskann_params, index_common_params);", - " return std::make_shared(diskann_params, index_common_params);\n#endif" - ] - ] - }, - { - "path": "src/algorithm/pyramid_zparameters.cpp", - "input_sha256": "0778c8315f49119c64dafcf298cd1314907b5ac3643852a5c49eab0f92695240", - "output_sha256": "3056661d6ba3e55045b0adfca2d2f7a73a5bf8438c9b3aae55349dc4ce544510", - "replacements": [ - [ - "#include \"index/diskann_zparameters.h\"\n", - "" - ] - ] - }, - { - "path": "src/datacell/sparse_graph_datacell.cpp", - "description": "Serialize sparse graph node count as the uint64_t expected by its reader, including on wasm32.", - "input_sha256": "dc3582131897c166d4a129f9b6213bbb0e230b75a062ab2cdce9381b0b9c6016", - "output_sha256": "9a5c96efe1a9c5822ab36dc9b172edde1b379b93af67cd54033e9b575f204e76", - "replacements": [ - [ - " auto size = this->neighbors_.size();", - " uint64_t size = this->neighbors_.size();" - ] - ] - } - ] - }, - "vsag_blas_patches": { - "description": "Match f2c i32 return signatures, use TLS for CBLAS error context, and serialize LAPACK cached machine constants.", - "files": [ - { - "dependency": "openblas", - "path": "lapack-netlib/CBLAS/include/cblas_f77.h", - "input_sha256": "dd7538ccd4ed4c87a70b38666345f5db7deee0bacdd4cbbe74ab99a806c3791c", - "output_sha256": "5ba2f67342526258cb3c3990818aa8a95a8ea2e9d4b6fe1dae3fec235aeb463e", - "replacements": [ - [ - "void F77_saxpy(", - "int F77_saxpy(" - ], - [ - "void F77_sscal(", - "int F77_sscal(" - ], - [ - "void F77_sgemv(", - "int F77_sgemv(" - ], - [ - "void F77_sgemm(", - "int F77_sgemm(" - ] - ] - }, - { - "dependency": "openblas", - "path": "lapack-netlib/LAPACKE/include/lapack.h", - "input_sha256": "37b26f23f5bbb4e46ba82e59ff706087f3f18837def889aee7026225af226fde", - "output_sha256": "8011304ac9b559027cd227886bbb0acec73b89d6fe28e4292116576f6961067b", - "replacements": [ - [ - "void LAPACK_sgeqrf(", - "int LAPACK_sgeqrf(" - ], - [ - "void LAPACK_sorgqr(", - "int LAPACK_sorgqr(" - ], - [ - "void LAPACK_ssyev_base(", - "int LAPACK_ssyev_base(" - ] - ] - }, - { - "dependency": "openblas", - "path": "lapack-netlib/CBLAS/src/cblas_globals.c", - "input_sha256": "369ecd90075e0bc41b667bdc5c2fb2c254477ec852aae7b263629f9c5824b9cd", - "output_sha256": "eba5746130e7718f25acd0e27d3d256ca6e26e066903361029cb56d4ea68b23c", - "replacements": [ - [ - "int CBLAS_CallFromC", - "_Thread_local int CBLAS_CallFromC" - ], - [ - "int RowMajorStrg", - "_Thread_local int RowMajorStrg" - ] - ] - }, - { - "dependency": "openblas", - "path": "lapack-netlib/CBLAS/src/cblas_sgemm.c", - "input_sha256": "154f6c5a132bffe7e8192f44265e9574b1bb37be25f2f72467eec1d5eb24adf6", - "output_sha256": "f40c6395e385a32a854a82255cea95fd85b299cbe83799b005ce9e4626f5e4eb", - "replacements": [ - [ - "extern int CBLAS_CallFromC", - "extern _Thread_local int CBLAS_CallFromC" - ], - [ - "extern int RowMajorStrg", - "extern _Thread_local int RowMajorStrg" - ] - ] - }, - { - "dependency": "openblas", - "path": "lapack-netlib/CBLAS/src/cblas_sgemv.c", - "input_sha256": "9038ce4792789488cf217ca71d1e779141e08c1788c5c52eefe21d03dccfcbcf", - "output_sha256": "c99132da0bb98a41e0b3b8296c609d84ed0c4113fd24831d442e08d235f67be0", - "replacements": [ - [ - "extern int CBLAS_CallFromC", - "extern _Thread_local int CBLAS_CallFromC" - ], - [ - "extern int RowMajorStrg", - "extern _Thread_local int RowMajorStrg" - ] - ] - }, - { - "dependency": "openblas", - "path": "lapack-netlib/CBLAS/src/cblas_xerbla.c", - "input_sha256": "0377dcc703bb436bf3f0c13ce499d7ab617194751738c686c0676d9e152bc537", - "output_sha256": "670572592fa9f5345c6bb7075d5394a2d32357882fe1766b41af7f1562eb80a6", - "replacements": [ - [ - "extern int RowMajorStrg", - "extern _Thread_local int RowMajorStrg" - ] - ] - }, - { - "dependency": "vsag", - "path": "src/impl/blas/blas_function.cpp", - "input_sha256": "0858936f8f9f33574daffe174bc3873a85d7950a25b4073b64bd8ee014893b1a", - "output_sha256": "0fd832c03e20e96ff7a8f626af494ffdfe09cd3135561be1429169cd8d9b6487", - "replacements": [ - [ - "#include ", - "#include \n#include \n#include \n\nnamespace {\nstd::mutex lapack_mutex;\n// LAPACKE multiplies dimensions in size_t when allocating transpose buffers.\n// Reject an unrepresentable matrix before its NaN scan or allocation can wrap.\nbool matrix_exceeds_address_space(int order, int m, int n, int lda) {\n if ((order != LAPACK_ROW_MAJOR && order != LAPACK_COL_MAJOR) ||\n m <= 0 || n <= 0 || lda <= 0) {\n return false; // Let LAPACKE return its normal argument/empty-matrix result.\n }\n const uint64_t outer = order == LAPACK_ROW_MAJOR ? m : n;\n return outer * static_cast(lda) > SIZE_MAX / sizeof(float);\n}\n}" - ], - [ - "BlasFunction::Sgeqrf(int32_t order, int32_t m, int32_t n, float* a, int32_t lda, float* tau) {", - "BlasFunction::Sgeqrf(int32_t order, int32_t m, int32_t n, float* a, int32_t lda, float* tau) {\n if (order != LAPACK_ROW_MAJOR && order != LAPACK_COL_MAJOR) return -1;\n if (m < 0) return -2;\n if (n < 0) return -3;\n if (lda < (order == LAPACK_ROW_MAJOR ? n : (m > 0 ? m : 1))) return -5;\n if (matrix_exceeds_address_space(order, m, n, lda)) {\n return LAPACK_WORK_MEMORY_ERROR;\n }\n std::lock_guard lock(lapack_mutex);" - ], - [ - " int32_t order, int32_t m, int32_t n, int32_t k, float* a, int32_t lda, const float* tau) {", - " int32_t order, int32_t m, int32_t n, int32_t k, float* a, int32_t lda, const float* tau) {\n if (order != LAPACK_ROW_MAJOR && order != LAPACK_COL_MAJOR) return -1;\n if (m < 0) return -2;\n if (n < 0 || n > m) return -3;\n if (k < 0 || k > n) return -4;\n if (lda < (order == LAPACK_ROW_MAJOR ? n : (m > 0 ? m : 1))) return -6;\n if (matrix_exceeds_address_space(order, m, n, lda)) {\n return LAPACK_WORK_MEMORY_ERROR;\n }\n std::lock_guard lock(lapack_mutex);" - ], - [ - "BlasFunction::Sgetrf(int32_t order, int32_t m, int32_t n, float* a, int32_t lda, int32_t* ipiv) {", - "BlasFunction::Sgetrf(int32_t order, int32_t m, int32_t n, float* a, int32_t lda, int32_t* ipiv) {\n if (order != LAPACK_ROW_MAJOR && order != LAPACK_COL_MAJOR) return -1;\n if (m < 0) return -2;\n if (n < 0) return -3;\n if (lda < (order == LAPACK_ROW_MAJOR ? n : (m > 0 ? m : 1))) return -5;\n if (matrix_exceeds_address_space(order, m, n, lda)) {\n return LAPACK_WORK_MEMORY_ERROR;\n }\n std::lock_guard lock(lapack_mutex);" - ], - [ - " int32_t order, char jobz, char uplo, int32_t n, float* a, int32_t lda, float* w) {", - " int32_t order, char jobz, char uplo, int32_t n, float* a, int32_t lda, float* w) {\n if (order != LAPACK_ROW_MAJOR && order != LAPACK_COL_MAJOR) return -1;\n if (jobz != 'V' && jobz != 'v' && jobz != 'N' && jobz != 'n') return -2;\n if (uplo != 'U' && uplo != 'u' && uplo != 'L' && uplo != 'l') return -3;\n if (n < 0) return -4;\n if (lda < (order == LAPACK_ROW_MAJOR ? n : (n > 0 ? n : 1))) return -6;\n if (matrix_exceeds_address_space(order, n, n, lda)) {\n return LAPACK_WORK_MEMORY_ERROR;\n }\n std::lock_guard lock(lapack_mutex);" - ] - ] - }, - { - "dependency": "clapack", - "path": "BLAS/SRC/xerbla.c", - "input_sha256": "f19c8b8849ac16067ffb4b7b68762144397a931dbde333c366b8ff0f97109ea4", - "output_sha256": "71ea74f75f932b882bb794d4c1ad57c870a64f0dbeb3160569cdea5cda155773", - "replacements": [ - [ - "#include \"f2c.h\"", - "#include \n#include \"f2c.h\"" - ], - [ - "parameter number %2i", - "parameter number %2ld" - ] - ] - }, - { - "dependency": "clapack", - "path": "SRC/ilaenv.c", - "input_sha256": "2126b531c520cb016abd9294c44a5e7e087a38b0007cdc96f5e5697364e7ea15", - "output_sha256": "ffe3dc8d826d064cfe386143136589b679c075b33f2bc141e59bebf395f0cd42", - "replacements": [ - [ - "/* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);", - "void s_copy(char *, char *, ftnlen, ftnlen);" - ] - ] - }, - { - "dependency": "clapack", - "path": "INSTALL/slamch.c", - "input_sha256": "3e060df534fe1f286cb18f40d77eb6ba7059b97e4314b8ce94545b0d73a58512", - "output_sha256": "cdb6b7dfb4cbdfe04568e1b8d2d57baa59157205b740a4735e29f2d1b00591a0", - "replacements": [ - [ - "#include \"f2c.h\"", - "#include \n#include \"f2c.h\"" - ], - [ - "\t s_wsfe(&io___58);\n\t do_fio(&c__1, (char *)&lemin, (ftnlen)sizeof(integer));\n\t e_wsfe();", - "\t fprintf(stderr, \"SLAMC2 warning: EMIN=%ld may be incorrect; inspect it and supply EMIN explicitly if necessary.\\n\", lemin);" - ] - ] - } - ] - }, "boost_ios_numeric": { "files": [ { diff --git a/bazel/sdk_sources/fmt.BUILD b/bazel/sdk_sources/fmt.BUILD deleted file mode 100644 index 3976b4c0dc..0000000000 --- a/bazel/sdk_sources/fmt.BUILD +++ /dev/null @@ -1,34 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "src/format.cc", - "src/os.cc", - ], - hdrs = glob( - ["include/fmt/*.h"], - allow_empty = True, - ), - copts = ["-std=c++17"] + select({ - "@platforms//os:emscripten": [ - "-pthread", - "-fexceptions", - ], - "//conditions:default": [], - }), - includes = ["include"], - linkstatic = True, -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/lapack.BUILD b/bazel/sdk_sources/lapack.BUILD deleted file mode 100644 index e4be97bfa1..0000000000 --- a/bazel/sdk_sources/lapack.BUILD +++ /dev/null @@ -1,43 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -genrule( - name = "mangling", - srcs = ["LAPACKE/include/lapacke_mangling_with_flags.h.in"], - outs = ["generated/lapacke_mangling.h"], - cmd = "cp $< $@", -) - -cc_library( - name = "library", - srcs = [ - "LAPACKE/src/lapacke_nancheck.c", - "LAPACKE/src/lapacke_sgeqrf.c", - "LAPACKE/src/lapacke_sgeqrf_work.c", - "LAPACKE/src/lapacke_sgesdd.c", - "LAPACKE/src/lapacke_sgesdd_work.c", - "LAPACKE/src/lapacke_sgetrf.c", - "LAPACKE/src/lapacke_sgetrf_work.c", - "LAPACKE/src/lapacke_sorgqr.c", - "LAPACKE/src/lapacke_sorgqr_work.c", - "LAPACKE/src/lapacke_ssyev.c", - "LAPACKE/src/lapacke_ssyev_work.c", - ] + glob(["LAPACKE/utils/*.c"]), - hdrs = [":mangling"] + glob(["LAPACKE/include/*.h"]), - includes = ["LAPACKE/include", "generated"], - local_defines = ["LAPACK_F2C"], - linkopts = ["-framework", "Accelerate"], - linkstatic = True, - target_compatible_with = ["@platforms//os:ios", "@platforms//cpu:aarch64"], -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/nlohmann_json.BUILD b/bazel/sdk_sources/nlohmann_json.BUILD deleted file mode 100644 index 6fd39af4f7..0000000000 --- a/bazel/sdk_sources/nlohmann_json.BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - hdrs = glob( - ["include/**/*.hpp"], - allow_empty = True, - ), - includes = ["include"], - linkstatic = True, -) - -filegroup( - name = "licenses", - srcs = ["LICENSE.MIT"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/openblas.BUILD b/bazel/sdk_sources/openblas.BUILD deleted file mode 100644 index 8c80793d4b..0000000000 --- a/bazel/sdk_sources/openblas.BUILD +++ /dev/null @@ -1,53 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "lapack-netlib/CBLAS/src/cblas_globals.c", - "lapack-netlib/CBLAS/src/cblas_saxpy.c", - "lapack-netlib/CBLAS/src/cblas_sgemm.c", - "lapack-netlib/CBLAS/src/cblas_sgemv.c", - "lapack-netlib/CBLAS/src/cblas_sscal.c", - "lapack-netlib/CBLAS/src/cblas_xerbla.c", - "lapack-netlib/LAPACKE/src/lapacke_nancheck.c", - "lapack-netlib/LAPACKE/src/lapacke_sgeqrf.c", - "lapack-netlib/LAPACKE/src/lapacke_sgeqrf_work.c", - "lapack-netlib/LAPACKE/src/lapacke_sgetrf.c", - "lapack-netlib/LAPACKE/src/lapacke_sgetrf_work.c", - "lapack-netlib/LAPACKE/src/lapacke_sorgqr.c", - "lapack-netlib/LAPACKE/src/lapacke_sorgqr_work.c", - "lapack-netlib/LAPACKE/src/lapacke_ssyev.c", - "lapack-netlib/LAPACKE/src/lapacke_ssyev_work.c", - "lapack-netlib/LAPACKE/utils/lapacke_lsame.c", - "lapack-netlib/LAPACKE/utils/lapacke_s_nancheck.c", - "lapack-netlib/LAPACKE/utils/lapacke_sge_nancheck.c", - "lapack-netlib/LAPACKE/utils/lapacke_sge_trans.c", - "lapack-netlib/LAPACKE/utils/lapacke_ssy_nancheck.c", - "lapack-netlib/LAPACKE/utils/lapacke_ssy_trans.c", - "lapack-netlib/LAPACKE/utils/lapacke_str_nancheck.c", - "lapack-netlib/LAPACKE/utils/lapacke_str_trans.c", - "lapack-netlib/LAPACKE/utils/lapacke_xerbla.c", - ], - hdrs = glob( - [ - "lapack-netlib/CBLAS/include/*.h", - "lapack-netlib/LAPACKE/include/*.h", - ], - allow_empty = True, - ), - additional_compiler_inputs = ["@seekdb//bazel/sdk_sources:openblas/blas_abi.h"], - copts = [ - "-pthread", - "-include", - "$(location @seekdb//bazel/sdk_sources:openblas/blas_abi.h)", - ], - includes = [ - "lapack-netlib/CBLAS/include", - "lapack-netlib/LAPACKE/include", - ], - linkstatic = True, - local_defines = ["NO_BLAS_WRAP"], - deps = ["@sdk_clapack//:library"], -) diff --git a/bazel/sdk_sources/openblas/blas_abi.h b/bazel/sdk_sources/openblas/blas_abi.h deleted file mode 100644 index 7b0981fe13..0000000000 --- a/bazel/sdk_sources/openblas/blas_abi.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2026 OceanBase. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once -#include -#define F77_GLOBAL(lower, upper) lower##_ -#define F77_GLOBAL_(lower, upper) lower##_ -#ifdef __cplusplus -static_assert(sizeof(long) == sizeof(int32_t), "f2c integer must match LAPACKE integer"); -#else -_Static_assert(sizeof(long) == sizeof(int32_t), "f2c integer must match LAPACKE integer"); -#endif diff --git a/bazel/sdk_sources/openmp.BUILD b/bazel/sdk_sources/openmp.BUILD deleted file mode 100644 index 7a47001eb9..0000000000 --- a/bazel/sdk_sources/openmp.BUILD +++ /dev/null @@ -1,96 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") -load("@seekdb//bazel/sdk_sources:openmp/configure.bzl", "openmp_headers") - -package(default_visibility = ["//visibility:public"]) - -openmp_headers( - name = "headers", - omp_template = "runtime/src/include/omp.h.var", - ompx_template = "runtime/src/include/ompx.h.var", -) - -genrule( - name = "messages", - srcs = [ - "runtime/src/i18n/en_US.txt", - "runtime/tools/libomputils.py", - ], - outs = [ - "generated/kmp_i18n_id.inc", - "generated/kmp_i18n_default.inc", - ], - cmd = "python3 $(location runtime/tools/message-converter.py) --target-system-override=Darwin " + - "--enum=$(location generated/kmp_i18n_id.inc) $(location runtime/src/i18n/en_US.txt) && " + - "python3 $(location runtime/tools/message-converter.py) --target-system-override=Darwin " + - "--default=$(location generated/kmp_i18n_default.inc) $(location runtime/src/i18n/en_US.txt)", - tools = ["runtime/tools/message-converter.py"], -) - -cc_library( - name = "library", - srcs = [ - "runtime/src/kmp_affinity.cpp", - "runtime/src/kmp_alloc.cpp", - "runtime/src/kmp_atomic.cpp", - "runtime/src/kmp_barrier.cpp", - "runtime/src/kmp_cancel.cpp", - "runtime/src/kmp_collapse.cpp", - "runtime/src/kmp_csupport.cpp", - "runtime/src/kmp_debug.cpp", - "runtime/src/kmp_dispatch.cpp", - "runtime/src/kmp_environment.cpp", - "runtime/src/kmp_error.cpp", - "runtime/src/kmp_ftn_cdecl.cpp", - "runtime/src/kmp_ftn_extra.cpp", - "runtime/src/kmp_global.cpp", - "runtime/src/kmp_gsupport.cpp", - "runtime/src/kmp_i18n.cpp", - "runtime/src/kmp_io.cpp", - "runtime/src/kmp_itt.cpp", - "runtime/src/kmp_lock.cpp", - "runtime/src/kmp_runtime.cpp", - "runtime/src/kmp_sched.cpp", - "runtime/src/kmp_settings.cpp", - "runtime/src/kmp_str.cpp", - "runtime/src/kmp_taskdeps.cpp", - "runtime/src/kmp_tasking.cpp", - "runtime/src/kmp_threadprivate.cpp", - "runtime/src/kmp_utility.cpp", - "runtime/src/kmp_version.cpp", - "runtime/src/kmp_wait_release.cpp", - "runtime/src/z_Linux_asm.S", - "runtime/src/z_Linux_util.cpp", - ], - hdrs = [ - ":headers", - ":messages", - ] + glob([ - "runtime/src/*.h", - "runtime/src/*.inl", - "runtime/src/thirdparty/ittnotify/*.h", - ]), - copts = ["-std=c++17", "-fno-exceptions", "-fno-rtti"], - local_defines = [ - "_GNU_SOURCE", - "_REENTRANT", - "LIBOMP_HAVE_PTHREAD_SETNAME_NP", - ], - includes = [ - "generated", - "runtime/src", - "runtime/src/i18n", - "runtime/src/thirdparty/ittnotify", - ], - linkstatic = True, - target_compatible_with = ["@platforms//os:ios", "@platforms//cpu:aarch64"], -) - -filegroup( - name = "licenses", - srcs = ["LICENSE.TXT"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/openmp/configure.bzl b/bazel/sdk_sources/openmp/configure.bzl deleted file mode 100644 index 38993bd608..0000000000 --- a/bazel/sdk_sources/openmp/configure.bzl +++ /dev/null @@ -1,35 +0,0 @@ -def _openmp_headers_impl(ctx): - substitutions = { - "@LIBOMP_VERSION_MAJOR@": "5", - "@LIBOMP_VERSION_MINOR@": "0", - "@LIBOMP_VERSION_BUILD@": "20140926", - "@LIBOMP_BUILD_DATE@": "No_Timestamp", - } - for template, output in [ - (ctx.file.omp_template, ctx.outputs.omp), - (ctx.file.ompx_template, ctx.outputs.ompx), - (ctx.file.config_template, ctx.outputs.config), - ]: - ctx.actions.expand_template( - template = template, - output = output, - substitutions = substitutions, - ) - return [DefaultInfo(files = depset([ctx.outputs.omp, ctx.outputs.ompx, ctx.outputs.config]))] - -openmp_headers = rule( - implementation = _openmp_headers_impl, - attrs = { - "omp_template": attr.label(allow_single_file = True), - "ompx_template": attr.label(allow_single_file = True), - "config_template": attr.label( - default = Label("//bazel/sdk_sources:openmp/kmp_config.h"), - allow_single_file = True, - ), - }, - outputs = { - "omp": "generated/omp.h", - "ompx": "generated/ompx.h", - "config": "generated/kmp_config.h", - }, -) diff --git a/bazel/sdk_sources/openmp/kmp_config.h b/bazel/sdk_sources/openmp/kmp_config.h deleted file mode 100644 index 02d60cdfae..0000000000 --- a/bazel/sdk_sources/openmp/kmp_config.h +++ /dev/null @@ -1,140 +0,0 @@ -// Modifications Copyright (c) 2026 OceanBase. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -#pragma once - -#include "kmp_platform.h" - -#define DEBUG_BUILD 0 -#define RELWITHDEBINFO_BUILD 0 -#define LIBOMP_USE_ITT_NOTIFY 0 -#define USE_ITT_NOTIFY LIBOMP_USE_ITT_NOTIFY -#if ! LIBOMP_USE_ITT_NOTIFY -# define INTEL_NO_ITTNOTIFY_API -#endif -#define LIBOMP_USE_VERSION_SYMBOLS 0 -#if LIBOMP_USE_VERSION_SYMBOLS -# define KMP_USE_VERSION_SYMBOLS -#endif -#define LIBOMP_HAVE_WEAK_ATTRIBUTE 1 -#define KMP_HAVE_WEAK_ATTRIBUTE LIBOMP_HAVE_WEAK_ATTRIBUTE -#define LIBOMP_HAVE_PSAPI 0 -#define KMP_HAVE_PSAPI LIBOMP_HAVE_PSAPI -#define LIBOMP_STATS 0 -#define KMP_STATS_ENABLED LIBOMP_STATS -#define LIBOMP_HAVE_X86INTRIN_H 0 -#define KMP_HAVE_X86INTRIN_H LIBOMP_HAVE_X86INTRIN_H -#define LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER 0 -#define KMP_HAVE___BUILTIN_READCYCLECOUNTER LIBOMP_HAVE___BUILTIN_READCYCLECOUNTER -#define LIBOMP_HAVE___RDTSC 0 -#define KMP_HAVE___RDTSC LIBOMP_HAVE___RDTSC -#define LIBOMP_USE_DEBUGGER 0 -#define USE_DEBUGGER LIBOMP_USE_DEBUGGER -#define LIBOMP_OMPT_DEBUG 0 -#define OMPT_DEBUG LIBOMP_OMPT_DEBUG -#define LIBOMP_OMPT_SUPPORT 0 -#define OMPT_SUPPORT LIBOMP_OMPT_SUPPORT -#define LIBOMP_OMPD_SUPPORT 0 -#define OMPD_SUPPORT LIBOMP_OMPD_SUPPORT -#define LIBOMP_OMPX_TASKGRAPH 0 -#define OMPX_TASKGRAPH LIBOMP_OMPX_TASKGRAPH -#define LIBOMP_PROFILING_SUPPORT 0 -#define OMP_PROFILING_SUPPORT LIBOMP_PROFILING_SUPPORT -#define LIBOMP_OMPT_OPTIONAL 1 -#define OMPT_OPTIONAL LIBOMP_OMPT_OPTIONAL -#define LIBOMP_USE_ADAPTIVE_LOCKS 0 -#define KMP_USE_ADAPTIVE_LOCKS LIBOMP_USE_ADAPTIVE_LOCKS -#define KMP_DEBUG_ADAPTIVE_LOCKS 0 -#define LIBOMP_USE_INTERNODE_ALIGNMENT 0 -#define KMP_USE_INTERNODE_ALIGNMENT LIBOMP_USE_INTERNODE_ALIGNMENT -#define LIBOMP_ENABLE_ASSERTIONS 1 -#define KMP_USE_ASSERT LIBOMP_ENABLE_ASSERTIONS -#define LIBOMP_USE_HIER_SCHED 0 -#define KMP_USE_HIER_SCHED LIBOMP_USE_HIER_SCHED -#define STUBS_LIBRARY 0 -#define LIBOMP_USE_HWLOC 0 -#define KMP_USE_HWLOC LIBOMP_USE_HWLOC -#define LIBOMP_ENABLE_SHARED 0 -#define KMP_DYNAMIC_LIB LIBOMP_ENABLE_SHARED -#define KMP_ARCH_STR "AARCH64" -#define KMP_LIBRARY_FILE "libomp.a" -#define KMP_VERSION_MAJOR 5 -#define KMP_VERSION_MINOR 0 -#define MSVC 0 -#define KMP_MSVC_COMPAT MSVC -#define LIBOMP_HAVE_WAITPKG_INTRINSICS 0 -#define KMP_HAVE_WAITPKG_INTRINSICS LIBOMP_HAVE_WAITPKG_INTRINSICS -#define LIBOMP_HAVE_RTM_INTRINSICS 0 -#define KMP_HAVE_RTM_INTRINSICS LIBOMP_HAVE_RTM_INTRINSICS -#define LIBOMP_HAVE_IMMINTRIN_H 0 -#define KMP_HAVE_IMMINTRIN_H LIBOMP_HAVE_IMMINTRIN_H -#define LIBOMP_HAVE_INTRIN_H 0 -#define KMP_HAVE_INTRIN_H LIBOMP_HAVE_INTRIN_H -#define LIBOMP_HAVE_ATTRIBUTE_WAITPKG 0 -#define KMP_HAVE_ATTRIBUTE_WAITPKG LIBOMP_HAVE_ATTRIBUTE_WAITPKG -#define LIBOMP_HAVE_ATTRIBUTE_RTM 0 -#define KMP_HAVE_ATTRIBUTE_RTM LIBOMP_HAVE_ATTRIBUTE_RTM -#define LIBOMP_ARCH_AARCH64_A64FX 0 -#define KMP_ARCH_AARCH64_A64FX LIBOMP_ARCH_AARCH64_A64FX -#define LIBOMP_HAVE_XMMINTRIN_H 0 -#define KMP_HAVE_XMMINTRIN_H LIBOMP_HAVE_XMMINTRIN_H -#define LIBOMP_HAVE__MM_MALLOC 0 -#define KMP_HAVE__MM_MALLOC LIBOMP_HAVE__MM_MALLOC -#define LIBOMP_HAVE_ALIGNED_ALLOC 1 -#define KMP_HAVE_ALIGNED_ALLOC LIBOMP_HAVE_ALIGNED_ALLOC -#define LIBOMP_HAVE_POSIX_MEMALIGN 1 -#define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN -#define LIBOMP_HAVE__ALIGNED_MALLOC 0 -#define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC -#define OPENMP_ENABLE_LIBOMPTARGET 0 -#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET - -#define CACHE_LINE 64 - -#if ! KMP_32_BIT_ARCH -# define BUILD_I8 1 -#endif - -#define KMP_NESTED_HOT_TEAMS 1 -#define KMP_ADJUST_BLOCKTIME 1 -#define BUILD_PARALLEL_ORDERED 1 -#define KMP_ASM_INTRINS 1 -#define USE_ITT_BUILD LIBOMP_USE_ITT_NOTIFY -#define INTEL_ITTNOTIFY_PREFIX __kmp_itt_ -#if ! (KMP_MIC || KMP_OS_HAIKU) -# define USE_LOAD_BALANCE 1 -#endif -#if ! (KMP_OS_WINDOWS || KMP_OS_DARWIN) -# define KMP_TDATA_GTID 1 -#endif -#if STUBS_LIBRARY -# define KMP_STUB 1 -#endif -#if DEBUG_BUILD || RELWITHDEBINFO_BUILD -# define KMP_DEBUG 1 -#endif - -#if KMP_OS_WINDOWS -# define KMP_WIN_CDECL -#else -# define BUILD_TV -# define KMP_GOMP_COMPAT -#endif diff --git a/bazel/sdk_sources/prepare.py b/bazel/sdk_sources/prepare.py index 25a1425ddc..7ff71adefa 100644 --- a/bazel/sdk_sources/prepare.py +++ b/bazel/sdk_sources/prepare.py @@ -10,12 +10,6 @@ selected = [] if package == "boost": selected += patches["boost_ios_numeric"]["files"] -if package == "vsag" and profile == "wasm": - selected += [patches[name] for name in ( - "vsag_dataset_paths", "vsag_stream_sizes", "vsag_allocator_sizes")] - selected += patches["vsag_source_patches"]["files"] -if package in ("clapack", "openblas") or (package == "vsag" and profile == "wasm"): - selected += [p for p in patches["vsag_blas_patches"]["files"] if p["dependency"] == package] for patch in selected: path = Path(patch["path"]) data = path.read_bytes() @@ -40,19 +34,6 @@ if package == "roaring": for path in Path("cpp").glob("*.hh"): Path("include/roaring", path.name).symlink_to("../../" + str(path)) -if package == "vsag": - Path("version.h").write_text(Path("src/version.h.in").read_text().replace( - "@VSAG_VERSION@", manifest["sources"][package]["version"] + "-" + profile)) - Path("antlr4-autogen").symlink_to("extern/antlr4/fc", target_is_directory=True) -if package == "antlr4": - Path("antlr4-runtime").symlink_to("runtime/Cpp/runtime/src", target_is_directory=True) - # DiskANN's exceptions.h collides with ANTLR's Exceptions.h on macOS. - for path in Path("runtime/Cpp/runtime/src").rglob("*"): - if path.suffix in (".h", ".cpp"): - path.write_text(path.read_text().replace('#include "Exceptions.h"', '#include "antlr4-runtime/Exceptions.h"')) -if package == "openblas": - source = Path("lapack-netlib/CBLAS/include/cblas_mangling_with_flags.h.in") - Path("lapack-netlib/CBLAS/include/cblas_mangling.h").write_bytes(source.read_bytes()) Path("source.json").write_text(json.dumps({ "package": package, "profile": profile, diff --git a/bazel/sdk_sources/robin_map.BUILD b/bazel/sdk_sources/robin_map.BUILD deleted file mode 100644 index 508db4f071..0000000000 --- a/bazel/sdk_sources/robin_map.BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - hdrs = glob( - ["include/**/*.h"], - allow_empty = True, - ), - includes = ["include"], - linkstatic = True, -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/spdlog.BUILD b/bazel/sdk_sources/spdlog.BUILD deleted file mode 100644 index d334b566a7..0000000000 --- a/bazel/sdk_sources/spdlog.BUILD +++ /dev/null @@ -1,25 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - hdrs = glob( - ["include/**/*.h"], - allow_empty = True, - ), - defines = ["SPDLOG_FMT_EXTERNAL"], - includes = ["include"], - linkstatic = True, - deps = ["@sdk_fmt//:library"], -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/thread_pool.BUILD b/bazel/sdk_sources/thread_pool.BUILD deleted file mode 100644 index 6479d6ef86..0000000000 --- a/bazel/sdk_sources/thread_pool.BUILD +++ /dev/null @@ -1,23 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - hdrs = glob( - ["ThreadPool.h"], - allow_empty = True, - ), - includes = ["."], - linkstatic = True, -) - -filegroup( - name = "licenses", - srcs = ["COPYING"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/vsag.BUILD b/bazel/sdk_sources/vsag.BUILD deleted file mode 100644 index 474a65bb41..0000000000 --- a/bazel/sdk_sources/vsag.BUILD +++ /dev/null @@ -1,293 +0,0 @@ -load("@rules_cc//cc:cc_library.bzl", "cc_library") - -package(default_visibility = ["//visibility:public"]) - -cc_library( - name = "library", - srcs = [ - "extern/antlr4/fc/FCBaseListener.cpp", - "extern/antlr4/fc/FCBaseVisitor.cpp", - "extern/antlr4/fc/FCLexer.cpp", - "extern/antlr4/fc/FCListener.cpp", - "extern/antlr4/fc/FCParser.cpp", - "extern/antlr4/fc/FCVisitor.cpp", - "src/algorithm/brute_force.cpp", - "src/algorithm/brute_force_parameter.cpp", - "src/algorithm/hgraph.cpp", - "src/algorithm/hgraph_parameter.cpp", - "src/algorithm/hnswlib/algorithm_interface.cpp", - "src/algorithm/hnswlib/block_manager.cpp", - "src/algorithm/hnswlib/hnswalg.cpp", - "src/algorithm/inner_index_interface.cpp", - "src/algorithm/inner_index_parameter.cpp", - "src/algorithm/ivf.cpp", - "src/algorithm/ivf_parameter.cpp", - "src/algorithm/ivf_partition/gno_imi_parameter.cpp", - "src/algorithm/ivf_partition/gno_imi_partition.cpp", - "src/algorithm/ivf_partition/ivf_nearest_partition.cpp", - "src/algorithm/ivf_partition/ivf_partition_strategy.cpp", - "src/algorithm/ivf_partition/ivf_partition_strategy_parameter.cpp", - "src/algorithm/pyramid.cpp", - "src/algorithm/pyramid_zparameters.cpp", - "src/algorithm/sindi/sindi.cpp", - "src/algorithm/sindi/sindi_parameter.cpp", - "src/algorithm/sparse_index.cpp", - "src/algorithm/sparse_index_parameters.cpp", - "src/attr/argparse.cpp", - "src/attr/attr_type_schema.cpp", - "src/attr/attr_value_map.cpp", - "src/attr/attribute.cpp", - "src/attr/executor/comparison_executor.cpp", - "src/attr/executor/executor.cpp", - "src/attr/executor/integer_list_executor.cpp", - "src/attr/executor/logical_executor.cpp", - "src/attr/executor/string_list_executor.cpp", - "src/attr/expression_visitor.cpp", - "src/attr/multi_bitset_manager.cpp", - "src/constants.cpp", - "src/datacell/attribute_bucket_inverted_datacell.cpp", - "src/datacell/attribute_inverted_interface.cpp", - "src/datacell/attribute_inverted_interface_parameter.cpp", - "src/datacell/bucket_datacell_parameter.cpp", - "src/datacell/bucket_interface.cpp", - "src/datacell/compressed_graph_datacell.cpp", - "src/datacell/extra_info_datacell_parameter.cpp", - "src/datacell/extra_info_interface.cpp", - "src/datacell/flatten_datacell_parameter.cpp", - "src/datacell/flatten_interface.cpp", - "src/datacell/flatten_interface_parameter.cpp", - "src/datacell/graph_datacell_parameter.cpp", - "src/datacell/graph_interface.cpp", - "src/datacell/graph_interface_parameter.cpp", - "src/datacell/sparse_graph_datacell.cpp", - "src/datacell/sparse_graph_datacell_parameter.cpp", - "src/datacell/sparse_term_datacell.cpp", - "src/dataset_impl.cpp", - "src/factory/engine.cpp", - "src/factory/factory.cpp", - "src/factory/resource.cpp", - "src/impl/allocator/default_allocator.cpp", - "src/impl/basic_optimizer.cpp", - "src/impl/bitset/bitset.cpp", - "src/impl/bitset/computable_bitset.cpp", - "src/impl/bitset/fast_bitset.cpp", - "src/impl/bitset/sparse_bitset.cpp", - "src/impl/blas/blas_function.cpp", - "src/impl/cluster/kmeans_cluster.cpp", - "src/impl/conjugate_graph.cpp", - "src/impl/elias_fano_encoder.cpp", - "src/impl/filter/black_list_filter.cpp", - "src/impl/filter/extrainfo_wrapper_filter.cpp", - "src/impl/filter/white_list_filter.cpp", - "src/impl/heap/distance_heap.cpp", - "src/impl/heap/memmove_heap.cpp", - "src/impl/heap/standard_heap.cpp", - "src/impl/label_table.cpp", - "src/impl/logger/default_logger.cpp", - "src/impl/logger/logger.cpp", - "src/impl/odescent/odescent_graph_builder.cpp", - "src/impl/odescent/odescent_graph_parameter.cpp", - "src/impl/pruning_strategy.cpp", - "src/impl/reorder/flatten_reorder.cpp", - "src/impl/searcher/basic_searcher.cpp", - "src/impl/searcher/parallel_searcher.cpp", - "src/impl/thread_pool/default_thread_pool.cpp", - "src/impl/transform/fht_kac_rotate_transformer.cpp", - "src/impl/transform/pca_transformer.cpp", - "src/impl/transform/random_orthogonal_transformer.cpp", - "src/impl/transform/vector_transformer.cpp", - "src/impl/transform/vector_transformer_parameter.cpp", - "src/index/hnsw.cpp", - "src/index/hnsw_zparameters.cpp", - "src/index/iterator_filter.cpp", - "src/index_common_param.cpp", - "src/index_detail_info.cpp", - "src/index_feature_list.cpp", - "src/io/async_io.cpp", - "src/io/async_io_parameter.cpp", - "src/io/buffer_io.cpp", - "src/io/buffer_io_parameter.cpp", - "src/io/io_parameter.cpp", - "src/io/memory_block_io.cpp", - "src/io/memory_block_io_parameter.cpp", - "src/io/memory_io.cpp", - "src/io/memory_io_parameter.cpp", - "src/io/mmap_io.cpp", - "src/io/mmap_io_parameter.cpp", - "src/io/reader_io.cpp", - "src/io/reader_io_parameter.cpp", - "src/json_wrapper.cpp", - "src/options.cpp", - "src/quantization/fp32_quantizer.cpp", - "src/quantization/fp32_quantizer_parameter.cpp", - "src/quantization/int8_quantizer.cpp", - "src/quantization/int8_quantizer_parameter.cpp", - "src/quantization/product_quantization/pq_fastscan_quantizer.cpp", - "src/quantization/product_quantization/pq_fastscan_quantizer_parameter.cpp", - "src/quantization/product_quantization/product_quantizer.cpp", - "src/quantization/product_quantization/product_quantizer_parameter.cpp", - "src/quantization/quantizer_adapter.cpp", - "src/quantization/quantizer_parameter.cpp", - "src/quantization/rabitq_quantization/rabitq_quantizer.cpp", - "src/quantization/rabitq_quantization/rabitq_quantizer_parameter.cpp", - "src/quantization/scalar_quantization/bf16_quantizer.cpp", - "src/quantization/scalar_quantization/bf16_quantizer_parameter.cpp", - "src/quantization/scalar_quantization/fp16_quantizer.cpp", - "src/quantization/scalar_quantization/fp16_quantizer_parameter.cpp", - "src/quantization/scalar_quantization/scalar_quantization_trainer.cpp", - "src/quantization/scalar_quantization/scalar_quantizer.cpp", - "src/quantization/scalar_quantization/sq4_uniform_quantizer.cpp", - "src/quantization/scalar_quantization/sq4_uniform_quantizer_parameter.cpp", - "src/quantization/scalar_quantization/sq8_uniform_quantizer.cpp", - "src/quantization/scalar_quantization/sq8_uniform_quantizer_parameter.cpp", - "src/quantization/transform_quantization/transform_quantizer_parameter.cpp", - "src/reader.cpp", - "src/simd/avx.cpp", - "src/simd/avx2.cpp", - "src/simd/avx512.cpp", - "src/simd/avx512vpopcntdq.cpp", - "src/simd/basic_func.cpp", - "src/simd/bf16_simd.cpp", - "src/simd/bit_simd.cpp", - "src/simd/fp16_simd.cpp", - "src/simd/fp32_simd.cpp", - "src/simd/generic.cpp", - "src/simd/int8_simd.cpp", - "src/simd/neon.cpp", - "src/simd/normalize.cpp", - "src/simd/pqfs_simd.cpp", - "src/simd/rabitq_simd.cpp", - "src/simd/simd.cpp", - "src/simd/simd_status.cpp", - "src/simd/sq4_simd.cpp", - "src/simd/sq4_uniform_simd.cpp", - "src/simd/sq8_simd.cpp", - "src/simd/sq8_uniform_simd.cpp", - "src/simd/sse.cpp", - "src/simd/sve.cpp", - "src/storage/footer.cpp", - "src/storage/serialization.cpp", - "src/storage/stream_reader.cpp", - "src/storage/stream_writer.cpp", - "src/utils/linear_congruential_generator.cpp", - "src/utils/lock_strategy.cpp", - "src/utils/prefetch.cpp", - "src/utils/slow_task_timer.cpp", - "src/utils/sparse_vector_transform.cpp", - "src/utils/timer.cpp", - "src/utils/util_functions.cpp", - "src/utils/visited_list.cpp", - "src/utils/window_result_queue.cpp", - "src/vsag.cpp", - ] + select({ - "@platforms//os:emscripten": [ - ], - "//conditions:default": [ - "extern/diskann/DiskANN/src/abstract_data_store.cpp", - "extern/diskann/DiskANN/src/abstract_index.cpp", - "extern/diskann/DiskANN/src/ann_exception.cpp", - "extern/diskann/DiskANN/src/disk_utils.cpp", - "extern/diskann/DiskANN/src/distance.cpp", - "extern/diskann/DiskANN/src/filter_utils.cpp", - "extern/diskann/DiskANN/src/in_mem_data_store.cpp", - "extern/diskann/DiskANN/src/in_mem_graph_store.cpp", - "extern/diskann/DiskANN/src/index.cpp", - "extern/diskann/DiskANN/src/index_factory.cpp", - "extern/diskann/DiskANN/src/local_file_reader.cpp", - "extern/diskann/DiskANN/src/logger.cpp", - "extern/diskann/DiskANN/src/math_utils.cpp", - "extern/diskann/DiskANN/src/memory_mapper.cpp", - "extern/diskann/DiskANN/src/natural_number_map.cpp", - "extern/diskann/DiskANN/src/natural_number_set.cpp", - "extern/diskann/DiskANN/src/partition.cpp", - "extern/diskann/DiskANN/src/pq.cpp", - "extern/diskann/DiskANN/src/pq_flash_index.cpp", - "extern/diskann/DiskANN/src/scratch.cpp", - "extern/diskann/DiskANN/src/utils.cpp", - "src/distances.cpp", - "src/index/diskann.cpp", - "src/index/diskann_zparameters.cpp", - "src/parameter_check.cpp", - "src/parameter_generator.cpp", - "src/vsag_c_api.cpp", - "src/vsag_ext.cpp", - ], - }), - hdrs = glob( - [ - "include/**/*.h", - "include/**/*.hpp", - "src/**/*.h", - "src/**/*.hpp", - "src/**/*.inl", - "extern/diskann/DiskANN/include/**/*.h", - "extern/diskann/DiskANN/include/**/*.hpp", - "extern/antlr4/fc/*.h", - "antlr4-autogen/*.h", - ], - allow_empty = True, - ) + ["version.h"], - copts = ["-std=c++17"] + select({ - "@platforms//os:emscripten": [ - "-pthread", - "-fexceptions", - ], - "//conditions:default": [ - "-Xpreprocessor", - "-fopenmp", - "-iframework", - "__BAZEL_XCODE_SDKROOT__/System/Library/Frameworks/Accelerate.framework/Frameworks", - ], - }), - includes = [ - ".", - "extern/antlr4/fc", - "extern/diskann/DiskANN/include", - "include", - "src", - ], - linkstatic = True, - local_defines = [ - "HAVE_LIBAIO=0", - "NO_LIBAIO=1", - "SPDLOG_FMT_EXTERNAL", - "BOOST_NO_CXX98_FUNCTION_BASE", - ] + select({ - "@platforms//os:emscripten": [ - "VSAG_DISABLE_STATIC_HNSW", - "VSAG_DISABLE_DISKANN", - ], - "//conditions:default": [ - "ENABLE_NEON=1", - "ENABLE_CUSTOM_LOGGER=1", - ], - }), - deps = [ - "@sdk_antlr4//:library", - "@sdk_cpuinfo//:library", - "@sdk_fmt//:library", - "@sdk_nlohmann_json//:library", - "@sdk_roaring//:library", - "@sdk_robin_map//:library", - "@sdk_spdlog//:library", - "@sdk_thread_pool//:library", - ] + select({ - "@platforms//os:emscripten": ["@sdk_openblas//:library"], - "//conditions:default": [ - "@seekdb//bazel/sdk_sources:ios_cblas", - "@sdk_boost//:library", - "@sdk_lapack//:library", - "@sdk_openmp//:library", - ], - }), -) - -filegroup( - name = "licenses", - srcs = ["LICENSE"], -) - -filegroup( - name = "source_metadata", - srcs = ["source.json"], -) diff --git a/bazel/sdk_sources/vsag/ios/cblas.h b/bazel/sdk_sources/vsag/ios/cblas.h deleted file mode 100644 index b7c98ac07a..0000000000 --- a/bazel/sdk_sources/vsag/ios/cblas.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2026 OceanBase. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#pragma once -#include - -// VSAG uses OpenBLAS's LP64 integer spelling with the standard CBLAS API. -typedef int blasint; From dc3ea4a720760d3a5fee68790878d18e1c14ee5d Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 09:41:21 +0800 Subject: [PATCH 36/40] Allow newer compatible Windows MSVC toolsets --- build.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build.py b/build.py index b4b51fdef8..8dc4e8fef7 100755 --- a/build.py +++ b/build.py @@ -22,12 +22,14 @@ class BuildError(RuntimeError): def _check_windows_toolset() -> None: - # Released Windows dependencies were built with the VS 2022 14.44 toolset. + # Released Windows dependencies were built with MSVC 14.44; linking needs + # the same or a newer compatible toolset. version = os.environ.get("VCToolsVersion", "") - if not re.fullmatch(r"14\.44\.\d+", version): + match = re.fullmatch(r"14\.(\d+)\.\d+", version) + if match is None or int(match.group(1)) < 44: raise BuildError( - "Windows builds require the MSVC 14.44 toolset used by seekdb-deps; " - "initialize the VS 2022 x64 developer environment with -vcvars_ver=14.44 " + "Windows builds require MSVC 14.44 or newer compatible 14.x tools; " + "initialize the x64 developer environment with a supported toolset " "(found %s)" % (version or "no active MSVC toolset") ) From da6451bea8780a6dfdfb45326c2b748268d456a5 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 09:52:10 +0800 Subject: [PATCH 37/40] Use system allocator for iOS framework --- MODULE.bazel | 84 +------------------------------ MODULE.bazel.lock | 34 +------------ bazel/BUILD.bazel | 6 --- bazel/cargo_build_script_env.bzl | 47 ------------------ bazel/ios_framework.bzl | 2 - bazel/platforms.bzl | 1 - deps/external/BUILD.bazel | 5 -- deps/external/Cargo.lock | 16 ------ deps/external/Cargo.toml | 10 ---- deps/external/bazel/jemalloc.bzl | 85 ++++++++------------------------ package/ios/BUILD.bazel | 2 +- src/oblib/BUILD.bazel | 1 - src/observer/BUILD.bazel | 1 - 13 files changed, 25 insertions(+), 269 deletions(-) delete mode 100644 bazel/cargo_build_script_env.bzl delete mode 100644 deps/external/Cargo.lock delete mode 100644 deps/external/Cargo.toml diff --git a/MODULE.bazel b/MODULE.bazel index a459aed63a..5bf1095b2d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -34,7 +34,7 @@ crate.render_config( ) crate.annotation( crate = "*", - repositories = ["rust_crates", "external_crates"], + repositories = ["rust_crates"], build_script_env = {"DEBUG": "true", "PROFILE": "release"}, ) crate.annotation( @@ -110,87 +110,7 @@ crate.from_cargo( isolated = False, supported_platform_triples = _RUST_PLATFORMS, ) -crate.annotation( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - build_script_env = { - "MAKEFLAGS": "", - "NUM_JOBS": "4", - }, - extra_aliased_targets = {"jemalloc_build": "build_script_build"}, - build_script_toolchains = ["@seekdb//bazel:windows_build_script_environment"], -) -crate.annotation_select( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - triples = [target for target in _RUST_PLATFORMS if target not in [ - "aarch64-apple-ios", - "aarch64-apple-ios-sim", - "aarch64-linux-android", - "x86_64-pc-windows-msvc", - "aarch64-pc-windows-msvc", - ]], - build_script_env = { - "CFLAGS": "-O2 -fPIC", - "JEMALLOC_SYS_CONFIGURE_ENV": "CPPFLAGS=\nLDFLAGS=", - "JEMALLOC_SYS_CONFIGURE_ARGS": "--with-jemalloc-prefix=je_", - }, -) -crate.annotation_select( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - triples = ["aarch64-apple-ios", "aarch64-apple-ios-sim"], - build_script_env = { - "CFLAGS": "-O2 -fPIC", - "JEMALLOC_SYS_CONFIGURE_ENV": "CPPFLAGS=\nLDFLAGS=", - "JEMALLOC_SYS_CONFIGURE_ARGS": "--with-jemalloc-prefix=je_\n--host=aarch64-apple-ios\n--with-lg-page=14\n--disable-zone-allocator", - }, -) -crate.annotation_select( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - triples = ["aarch64-linux-android"], - build_script_env = { - "CFLAGS": "-O2 -fPIC", - "JEMALLOC_SYS_CONFIGURE_ENV": "CPPFLAGS=\nLDFLAGS=", - "JEMALLOC_SYS_CONFIGURE_ARGS": "--with-jemalloc-prefix=je_\n--host=aarch64-linux-android\n--with-lg-page=14\n--disable-initial-exec-tls", - }, -) -crate.annotation_select( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - triples = ["x86_64-pc-windows-msvc"], - build_script_env = { - "PATH": "$(CARGO_BUILD_SCRIPT_PATH)", - "CFLAGS": "/O2 /MD /D_WIN32_WINNT=0x0A00", - "JEMALLOC_SYS_MAKE": "make", - "JEMALLOC_SYS_CONFIGURE_ENV": "CPPFLAGS=\nLDFLAGS=\nMSYS2_ARG_CONV_EXCL=*", - "JEMALLOC_SYS_CONFIGURE_ARGS": "--with-jemalloc-prefix=je_\n--host=x86_64-w64-mingw32", - }, -) -crate.annotation_select( - crate = "seekdb-jemalloc-sys", - repositories = ["external_crates"], - triples = ["aarch64-pc-windows-msvc"], - build_script_env = { - "PATH": "$(CARGO_BUILD_SCRIPT_PATH)", - "CFLAGS": "/O2 /MD /D_WIN32_WINNT=0x0A00", - "JEMALLOC_SYS_MAKE": "make", - "JEMALLOC_SYS_CONFIGURE_ENV": "CPPFLAGS=\nLDFLAGS=\nMSYS2_ARG_CONV_EXCL=*", - "JEMALLOC_SYS_CONFIGURE_ARGS": "--with-jemalloc-prefix=je_\n--host=aarch64-w64-mingw32", - }, -) -crate.from_cargo( - name = "external_crates", - manifests = ["//deps/external:Cargo.toml"], - cargo_lockfile = "//deps/external:Cargo.lock", - cargo_config = "//bazel:rust_cargo_config.toml", - host_tools = "@rust_native//:BUILD.bazel", - skip_cargo_lockfile_overwrite = True, - isolated = False, - supported_platform_triples = _RUST_PLATFORMS, -) -use_repo(crate, "rust_crates", "cxxbridge_deps", "external_crates") +use_repo(crate, "rust_crates", "cxxbridge_deps") host_tools_repository = use_repo_rule("//bazel:parser.bzl", "host_tools_repository") host_tools_repository(name = "host_tools") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 459c852f2c..3452429104 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -515,7 +515,7 @@ "@@rules_rust+//crate_universe:extensions.bzl%crate": { "general": { "bzlTransitiveDigest": "imkbK4Elrvc9HAhGIIs7HAfIWBgwhVAiaJgxuCBKfp4=", - "usagesDigest": "OBbXWv60V9awUGfccKKkZVz4RdvNmY2mZpINSnCrtWI=", + "usagesDigest": "Hz/wXDGM15cpopFQE7jv4+i+svH3c0684jP8Ksd2evk=", "recordedInputs": [ "ENV:CARGO_BAZEL_DEBUG \\0", "ENV:CARGO_BAZEL_GENERATOR_SHA256 \\0", @@ -527,7 +527,6 @@ "ENV:REPIN \\0", "REPO_MAPPING:,cxxbridge_source +cxxbridge_repository+cxxbridge_source", "REPO_MAPPING:,rust_native +installed_rust_repository+rust_native", - "REPO_MAPPING:,seekdb ", "REPO_MAPPING:bazel_features+,bazel_features_globals bazel_features++version_extension+bazel_features_globals", "REPO_MAPPING:bazel_features+,bazel_features_version bazel_features++version_extension+bazel_features_version", "REPO_MAPPING:rules_cc+,bazel_features bazel_features+", @@ -570,9 +569,7 @@ "FILE:@@//rust/vector-kernels/Cargo.toml 7c0d1258239cd4f0bf02ef0b91a15334bc10228c4c784396d7ebbc2b8d242cf7", "FILE:@@//bazel/prost-codegen/Cargo.toml 56f7456a7300cc576d376ee4cdf81c03e34d4260029f910e8b8ab9f4e2b5703e", "FILE:@@+cxxbridge_repository+cxxbridge_source//Cargo.lock 051ae4d78c8864487f3d49cf50000cd54926b21ca898941ec141e4aa064f3bc2", - "FILE:@@+cxxbridge_repository+cxxbridge_source//Cargo.toml fc22614b5738a85940088e56d7d2211208151ac69af7cb03e31500c88b1493cf", - "FILE:@@//deps/external/Cargo.lock 30e31d86bfbede24b05eddb6760ece50b771cfd676f924053bcb8be9e8136ac3", - "FILE:@@//deps/external/Cargo.toml c9abddd63c6627e8de660b60baf13c8b233aaa06dc721667cf2bd89fb704efd2" + "FILE:@@+cxxbridge_repository+cxxbridge_source//Cargo.toml fc22614b5738a85940088e56d7d2211208151ac69af7cb03e31500c88b1493cf" ], "generatedRepoSpecs": { "rust_crates": { @@ -4149,33 +4146,6 @@ "strip_prefix": "windows-sys-0.61.2", "build_file_content": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\nload(\"@rules_rust//rust:defs.bzl\", \"rust_library\")\n\n# buildifier: disable=bzl-visibility\nload(\"@rules_rust//crate_universe/private:selects.bzl\", \"selects\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\nrust_library(\n name = \"windows_sys\",\n deps = [\n \"@cxxbridge_deps__windows-link-0.2.1//:windows_link\",\n ],\n compile_data = glob(\n allow_empty = True,\n include = [\"**\"],\n exclude = [\n \"**/* *\",\n \".tmp_git_root/**/*\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n ],\n ),\n crate_features = [\n \"Win32\",\n \"Win32_Foundation\",\n \"Win32_Storage\",\n \"Win32_Storage_FileSystem\",\n \"Win32_System\",\n \"Win32_System_Console\",\n \"Win32_System_SystemInformation\",\n \"default\",\n ],\n crate_root = \"src/lib.rs\",\n edition = \"2021\",\n rustc_flags = [\n \"--cap-lints=allow\",\n ],\n srcs = glob(\n allow_empty = True,\n include = [\"**/*.rs\"],\n ),\n tags = [\n \"cargo-bazel\",\n \"crate-name=windows-sys\",\n \"manual\",\n \"noclippy\",\n \"norustfmt\",\n ],\n target_compatible_with = select({\n \"@rules_rust//rust/platform:aarch64-apple-darwin\": [],\n \"@rules_rust//rust/platform:aarch64-apple-ios\": [],\n \"@rules_rust//rust/platform:aarch64-apple-ios-sim\": [],\n \"@rules_rust//rust/platform:aarch64-linux-android\": [],\n \"@rules_rust//rust/platform:aarch64-pc-windows-msvc\": [],\n \"@rules_rust//rust/platform:aarch64-unknown-linux-gnu\": [],\n \"@rules_rust//rust/platform:wasm32-unknown-emscripten\": [],\n \"@rules_rust//rust/platform:x86_64-apple-darwin\": [],\n \"@rules_rust//rust/platform:x86_64-pc-windows-msvc\": [],\n \"@rules_rust//rust/platform:x86_64-unknown-linux-gnu\": [],\n \"//conditions:default\": [\"@platforms//:incompatible\"],\n }),\n version = \"0.61.2\",\n)\n" } - }, - "external_crates": { - "repoRuleId": "@@rules_rust+//crate_universe/private:crates_vendor.bzl%crates_vendor_remote_repository", - "attributes": { - "contents": { - "BUILD.bazel": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files(\n [\n \"cargo-bazel.json\",\n \"crates.bzl\",\n \"defs.bzl\",\n ] + glob(\n allow_empty = True,\n include = [\"*.bazel\"],\n ),\n)\n\nfilegroup(\n name = \"srcs\",\n srcs = glob(\n allow_empty = True,\n include = [\n \"*.bazel\",\n \"*.bzl\",\n ],\n ),\n)\n\n# Workspace Member Dependencies\nalias(\n name = \"seekdb-jemalloc-sys-0.2.3+5.3.1\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:seekdb_jemalloc_sys\",\n tags = [\"manual\"],\n)\n\nalias(\n name = \"seekdb-jemalloc-sys\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:seekdb_jemalloc_sys\",\n tags = [\"manual\"],\n)\n\nalias(\n name = \"jemalloc_build\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:build_script_build\",\n tags = [\"manual\"],\n)\n", - "alias_rules.bzl": "\"\"\"Alias that transitions its target to `compilation_mode=opt`. Use `transition_alias=\"opt\"` to enable.\"\"\"\n\nload(\"@rules_cc//cc:defs.bzl\", \"CcInfo\")\nload(\"@rules_rust//rust:rust_common.bzl\", \"COMMON_PROVIDERS\")\n\ndef _transition_alias_impl(ctx):\n # `ctx.attr.actual` is a list of 1 item due to the transition\n providers = [ctx.attr.actual[0][provider] for provider in COMMON_PROVIDERS]\n if CcInfo in ctx.attr.actual[0]:\n providers.append(ctx.attr.actual[0][CcInfo])\n return providers\n\ndef _change_compilation_mode(compilation_mode):\n def _change_compilation_mode_impl(_settings, _attr):\n return {\n \"//command_line_option:compilation_mode\": compilation_mode,\n }\n\n return transition(\n implementation = _change_compilation_mode_impl,\n inputs = [],\n outputs = [\n \"//command_line_option:compilation_mode\",\n ],\n )\n\ndef _transition_alias_rule(compilation_mode):\n return rule(\n implementation = _transition_alias_impl,\n provides = COMMON_PROVIDERS,\n attrs = {\n \"actual\": attr.label(\n mandatory = True,\n doc = \"`rust_library()` target to transition to `compilation_mode=opt`.\",\n providers = COMMON_PROVIDERS,\n cfg = _change_compilation_mode(compilation_mode),\n ),\n \"_allowlist_function_transition\": attr.label(\n default = \"@bazel_tools//tools/allowlists/function_transition_allowlist\",\n ),\n },\n doc = \"Transitions a Rust library crate to the `compilation_mode=opt`.\",\n )\n\ntransition_alias_dbg = _transition_alias_rule(\"dbg\")\ntransition_alias_fastbuild = _transition_alias_rule(\"fastbuild\")\ntransition_alias_opt = _transition_alias_rule(\"opt\")\n", - "crates.bzl": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\"\"\"\n# `crates_repository` API\n\n- [aliases](#aliases)\n- [crate_edition](#crate_edition)\n- [crate_deps](#crate_deps)\n- [all_crate_deps](#all_crate_deps)\n- [crate_repositories](#crate_repositories)\n\n\"\"\"\n\nload(\"@bazel_tools//tools/build_defs/repo:git.bzl\", \"git_repository\")\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\nload(\"@bazel_tools//tools/build_defs/repo:utils.bzl\", \"maybe\")\nload(\"@bazel_skylib//lib:selects.bzl\", \"selects\")\nload(\"@rules_rust//crate_universe:defs.bzl\", \"crates_vendor_remote_repository\", \"local_crate_mirror\")\n\n###############################################################################\n# MACROS API\n###############################################################################\n\n# An identifier that represent common dependencies (unconditional).\n_COMMON_CONDITION = \"\"\n\ndef _flatten_dependency_maps(all_dependency_maps):\n \"\"\"Flatten a list of dependency maps into one dictionary.\n\n Dependency maps have the following structure:\n\n ```python\n DEPENDENCIES_MAP = {\n # The first key in the map is a Bazel package\n # name of the workspace this file is defined in.\n \"workspace_member_package\": {\n\n # Not all dependencies are supported for all platforms.\n # the condition key is the condition required to be true\n # on the host platform.\n \"condition\": {\n\n # An alias to a crate target. # The label of the crate target the\n # Aliases are only crate names. # package name refers to.\n \"package_name\": \"@full//:label\",\n }\n }\n }\n ```\n\n Args:\n all_dependency_maps (list): A list of dicts as described above\n\n Returns:\n dict: A dictionary as described above\n \"\"\"\n dependencies = {}\n\n for workspace_deps_map in all_dependency_maps:\n for pkg_name, conditional_deps_map in workspace_deps_map.items():\n if pkg_name not in dependencies:\n non_frozen_map = dict()\n for key, values in conditional_deps_map.items():\n non_frozen_map.update({key: dict(values.items())})\n dependencies.setdefault(pkg_name, non_frozen_map)\n continue\n\n for condition, deps_map in conditional_deps_map.items():\n # If the condition has not been recorded, do so and continue\n if condition not in dependencies[pkg_name]:\n dependencies[pkg_name].setdefault(condition, dict(deps_map.items()))\n continue\n\n # Alert on any miss-matched dependencies\n inconsistent_entries = []\n for crate_name, crate_label in deps_map.items():\n existing = dependencies[pkg_name][condition].get(crate_name)\n if existing and existing != crate_label:\n inconsistent_entries.append((crate_name, existing, crate_label))\n dependencies[pkg_name][condition].update({crate_name: crate_label})\n\n return dependencies\n\ndef crate_deps(deps, package_name = None):\n \"\"\"Finds the fully qualified label of the requested crates for the package where this macro is called.\n\n Args:\n deps (list): The desired list of crate targets.\n package_name (str, optional): The package name of the set of dependencies to look up.\n Defaults to `native.package_name()`.\n\n Returns:\n list: A list of labels to generated rust targets (str)\n \"\"\"\n\n if not deps:\n return []\n\n if package_name == None:\n package_name = native.package_name()\n\n # Join both sets of dependencies\n dependencies = _flatten_dependency_maps([\n _NORMAL_DEPENDENCIES,\n _NORMAL_DEV_DEPENDENCIES,\n _PROC_MACRO_DEPENDENCIES,\n _PROC_MACRO_DEV_DEPENDENCIES,\n _BUILD_DEPENDENCIES,\n _BUILD_PROC_MACRO_DEPENDENCIES,\n ]).pop(package_name, {})\n\n # Combine all conditional packages so we can easily index over a flat list\n # TODO: Perhaps this should actually return select statements and maintain\n # the conditionals of the dependencies\n flat_deps = {}\n for deps_set in dependencies.values():\n for crate_name, crate_label in deps_set.items():\n flat_deps.update({crate_name: crate_label})\n\n missing_crates = []\n crate_targets = []\n for crate_target in deps:\n if crate_target not in flat_deps:\n missing_crates.append(crate_target)\n else:\n crate_targets.append(flat_deps[crate_target])\n\n if missing_crates:\n fail(\"Could not find crates `{}` among dependencies of `{}`. Available dependencies were `{}`\".format(\n missing_crates,\n package_name,\n dependencies,\n ))\n\n return crate_targets\n\ndef crate_edition(package_name = None):\n \"\"\"Finds the Rust edition for the package where this macro is called.\n\n Args:\n package_name (str, optional): The package name whose edition should be\n looked up. Defaults to `native.package_name()` when unset.\n\n Returns:\n str: The Rust edition declared by the package's Cargo.toml file.\n \"\"\"\n if package_name == None:\n package_name = native.package_name()\n\n if package_name not in _CRATE_EDITIONS:\n fail(\"Tried to get crate_edition for package \" + package_name + \" but that package had no Cargo.toml file\")\n\n return _CRATE_EDITIONS[package_name]\n\ndef all_crate_deps(\n normal = False, \n normal_dev = False, \n proc_macro = False, \n proc_macro_dev = False,\n build = False,\n build_proc_macro = False,\n package_name = None):\n \"\"\"Finds the fully qualified label of all requested direct crate dependencies \\\n for the package where this macro is called.\n\n If no parameters are set, all normal dependencies are returned. Setting any one flag will\n otherwise impact the contents of the returned list.\n\n Args:\n normal (bool, optional): If True, normal dependencies are included in the\n output list.\n normal_dev (bool, optional): If True, normal dev dependencies will be\n included in the output list.\n proc_macro (bool, optional): If True, proc_macro dependencies are included\n in the output list.\n proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are\n included in the output list.\n build (bool, optional): If True, build dependencies are included\n in the output list.\n build_proc_macro (bool, optional): If True, build proc_macro dependencies are\n included in the output list.\n package_name (str, optional): The package name of the set of dependencies to look up.\n Defaults to `native.package_name()` when unset.\n\n Returns:\n list: A list of labels to generated rust targets (str)\n \"\"\"\n\n if package_name == None:\n package_name = native.package_name()\n\n # Determine the relevant maps to use\n all_dependency_maps = []\n if normal:\n all_dependency_maps.append(_NORMAL_DEPENDENCIES)\n if normal_dev:\n all_dependency_maps.append(_NORMAL_DEV_DEPENDENCIES)\n if proc_macro:\n all_dependency_maps.append(_PROC_MACRO_DEPENDENCIES)\n if proc_macro_dev:\n all_dependency_maps.append(_PROC_MACRO_DEV_DEPENDENCIES)\n if build:\n all_dependency_maps.append(_BUILD_DEPENDENCIES)\n if build_proc_macro:\n all_dependency_maps.append(_BUILD_PROC_MACRO_DEPENDENCIES)\n\n # Default to always using normal dependencies\n if not all_dependency_maps:\n all_dependency_maps.append(_NORMAL_DEPENDENCIES)\n\n dependencies = _flatten_dependency_maps(all_dependency_maps).pop(package_name, None)\n\n if not dependencies:\n if dependencies == None:\n fail(\"Tried to get all_crate_deps for package \" + package_name + \" but that package had no Cargo.toml file\")\n else:\n return []\n\n crate_deps = list(dependencies.pop(_COMMON_CONDITION, {}).values())\n for condition, deps in dependencies.items():\n crate_deps += selects.with_or({\n tuple(_CONDITIONS[condition]): deps.values(),\n \"//conditions:default\": [],\n })\n\n return crate_deps\n\ndef aliases(\n normal = False,\n normal_dev = False,\n proc_macro = False,\n proc_macro_dev = False,\n build = False,\n build_proc_macro = False,\n package_name = None):\n \"\"\"Produces a map of Crate alias names to their original label\n\n If no dependency kinds are specified, `normal` and `proc_macro` are used by default.\n Setting any one flag will otherwise determine the contents of the returned dict.\n\n Args:\n normal (bool, optional): If True, normal dependencies are included in the\n output list.\n normal_dev (bool, optional): If True, normal dev dependencies will be\n included in the output list..\n proc_macro (bool, optional): If True, proc_macro dependencies are included\n in the output list.\n proc_macro_dev (bool, optional): If True, dev proc_macro dependencies are\n included in the output list.\n build (bool, optional): If True, build dependencies are included\n in the output list.\n build_proc_macro (bool, optional): If True, build proc_macro dependencies are\n included in the output list.\n package_name (str, optional): The package name of the set of dependencies to look up.\n Defaults to `native.package_name()` when unset.\n\n Returns:\n dict: The aliases of all associated packages\n \"\"\"\n if package_name == None:\n package_name = native.package_name()\n\n # Determine the relevant maps to use\n all_aliases_maps = []\n if normal:\n all_aliases_maps.append(_NORMAL_ALIASES)\n if normal_dev:\n all_aliases_maps.append(_NORMAL_DEV_ALIASES)\n if proc_macro:\n all_aliases_maps.append(_PROC_MACRO_ALIASES)\n if proc_macro_dev:\n all_aliases_maps.append(_PROC_MACRO_DEV_ALIASES)\n if build:\n all_aliases_maps.append(_BUILD_ALIASES)\n if build_proc_macro:\n all_aliases_maps.append(_BUILD_PROC_MACRO_ALIASES)\n\n # Default to always using normal aliases\n if not all_aliases_maps:\n all_aliases_maps.append(_NORMAL_ALIASES)\n all_aliases_maps.append(_PROC_MACRO_ALIASES)\n\n aliases = _flatten_dependency_maps(all_aliases_maps).pop(package_name, None)\n\n if not aliases:\n return dict()\n\n common_items = aliases.pop(_COMMON_CONDITION, {}).items()\n\n # If there are only common items in the dictionary, immediately return them\n if not len(aliases.keys()) == 1:\n return dict(common_items)\n\n # Build a single select statement where each conditional has accounted for the\n # common set of aliases.\n crate_aliases = {\"//conditions:default\": dict(common_items)}\n for condition, deps in aliases.items():\n condition_triples = _CONDITIONS[condition]\n for triple in condition_triples:\n if triple in crate_aliases:\n crate_aliases[triple].update(deps)\n else:\n crate_aliases.update({triple: dict(deps.items() + common_items)})\n\n return select(crate_aliases)\n\n###############################################################################\n# WORKSPACE MEMBER DEPS, ALIASES, AND EDITIONS\n###############################################################################\n\n_CRATE_EDITIONS = {\n \"deps/external\": \"2021\",\n}\n\n_NORMAL_DEPENDENCIES = {\n \"deps/external\": {\n _COMMON_CONDITION: {\n \"seekdb-jemalloc-sys\": Label(\"@external_crates//seekdb-jemalloc-sys-0.2.3+5.3.1\"),\n },\n },\n}\n\n\n_NORMAL_ALIASES = {\n \"deps/external\": {\n _COMMON_CONDITION: {\n },\n },\n}\n\n\n_NORMAL_DEV_DEPENDENCIES = {\n \"deps/external\": {\n },\n}\n\n\n_NORMAL_DEV_ALIASES = {\n \"deps/external\": {\n },\n}\n\n\n_PROC_MACRO_DEPENDENCIES = {\n \"deps/external\": {\n },\n}\n\n\n_PROC_MACRO_ALIASES = {\n \"deps/external\": {\n },\n}\n\n\n_PROC_MACRO_DEV_DEPENDENCIES = {\n \"deps/external\": {\n },\n}\n\n\n_PROC_MACRO_DEV_ALIASES = {\n \"deps/external\": {\n },\n}\n\n\n_BUILD_DEPENDENCIES = {\n \"deps/external\": {\n },\n}\n\n\n_BUILD_ALIASES = {\n \"deps/external\": {\n },\n}\n\n\n_BUILD_PROC_MACRO_DEPENDENCIES = {\n \"deps/external\": {\n },\n}\n\n\n_BUILD_PROC_MACRO_ALIASES = {\n \"deps/external\": {\n },\n}\n\n\n_CONDITIONS = {\n \"aarch64-apple-darwin\": [\"@rules_rust//rust/platform:aarch64-apple-darwin\"],\n \"aarch64-apple-ios\": [\"@rules_rust//rust/platform:aarch64-apple-ios\"],\n \"aarch64-apple-ios-sim\": [\"@rules_rust//rust/platform:aarch64-apple-ios-sim\"],\n \"aarch64-linux-android\": [\"@rules_rust//rust/platform:aarch64-linux-android\"],\n \"aarch64-pc-windows-msvc\": [\"@rules_rust//rust/platform:aarch64-pc-windows-msvc\"],\n \"aarch64-unknown-linux-gnu\": [\"@rules_rust//rust/platform:aarch64-unknown-linux-gnu\"],\n \"wasm32-unknown-emscripten\": [\"@rules_rust//rust/platform:wasm32-unknown-emscripten\"],\n \"x86_64-apple-darwin\": [\"@rules_rust//rust/platform:x86_64-apple-darwin\"],\n \"x86_64-pc-windows-msvc\": [\"@rules_rust//rust/platform:x86_64-pc-windows-msvc\"],\n \"x86_64-unknown-linux-gnu\": [\"@rules_rust//rust/platform:x86_64-unknown-linux-gnu\"],\n}\n\n###############################################################################\n\ndef crate_repositories():\n \"\"\"A macro for defining repositories for all generated crates.\n\n Returns:\n A list of repos visible to the module through the module extension.\n \"\"\"\n maybe(\n crates_vendor_remote_repository,\n name = \"external_crates\",\n # Lean interface: just point at `crates.bzl`; the repo rule\n # derives the sibling `BUILD.bazel` and `defs.bzl`.\n crates_module = Label(\"@external_crates//external_crates:crates.bzl\"),\n )\n maybe(\n http_archive,\n name = \"external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1\",\n sha256 = \"278734e47d644d7b861744a38d037b7f9847ef59c38d9f45e27e578db9a21ebe\",\n type = \"tar.gz\",\n urls = [\"https://rsproxy.cn/api/v1/crates/seekdb-jemalloc-sys/0.2.3+5.3.1/download\"],\n strip_prefix = \"seekdb-jemalloc-sys-0.2.3+5.3.1\",\n build_file = Label(\"@external_crates//external_crates:BUILD.seekdb-jemalloc-sys-0.2.3+5.3.1.bazel\"),\n )\n\n return [\n struct(repo = \"external_crates\", is_dev_dep = False),\n struct(repo=\"external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1\", is_dev_dep = False),\n ]\n", - "defs.bzl": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\"\"\"Deprecated: re-exports the crate_universe macros from `:crates.bzl`.\"\"\"\n\nload(\n \":crates.bzl\",\n _aliases = \"aliases\",\n _all_crate_deps = \"all_crate_deps\",\n _crate_deps = \"crate_deps\",\n _crate_edition = \"crate_edition\",\n _crate_repositories = \"crate_repositories\",\n)\n\naliases = _aliases\nall_crate_deps = _all_crate_deps\ncrate_deps = _crate_deps\ncrate_edition = _crate_edition\ncrate_repositories = _crate_repositories\n", - "seekdb-jemalloc-sys-0.2.3+5.3.1/BUILD.bazel": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\npackage(default_visibility = [\"//visibility:public\"])\n\nalias(\n name = \"seekdb-jemalloc-sys-0.2.3+5.3.1\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:seekdb_jemalloc_sys\",\n tags = [\"manual\"],\n)\n", - "seekdb-jemalloc-sys/BUILD.bazel": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\npackage(default_visibility = [\"//visibility:public\"])\n\nalias(\n name = \"seekdb-jemalloc-sys\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:seekdb_jemalloc_sys\",\n tags = [\"manual\"],\n)\n", - "jemalloc_build/BUILD.bazel": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\npackage(default_visibility = [\"//visibility:public\"])\n\nalias(\n name = \"jemalloc_build\",\n actual = \"@external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1//:build_script_build\",\n tags = [\"manual\"],\n)\n" - } - } - }, - "external_crates__seekdb-jemalloc-sys-0.2.3-5.3.1": { - "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", - "attributes": { - "remote_patch_strip": 1, - "sha256": "278734e47d644d7b861744a38d037b7f9847ef59c38d9f45e27e578db9a21ebe", - "type": "tar.gz", - "urls": [ - "https://rsproxy.cn/api/v1/crates/seekdb-jemalloc-sys/0.2.3+5.3.1/download" - ], - "strip_prefix": "seekdb-jemalloc-sys-0.2.3+5.3.1", - "build_file_content": "###############################################################################\n# @generated\n# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To \n# regenerate this file, run the following:\n#\n# bazel mod show_repo 'seekdb'\n###############################################################################\n\nload(\n \"@rules_rust//cargo:defs.bzl\",\n \"cargo_build_script\",\n \"cargo_toml_env_vars\",\n)\n\nload(\"@rules_rust//rust:defs.bzl\", \"rust_library\")\n\n# buildifier: disable=bzl-visibility\nload(\"@rules_rust//crate_universe/private:selects.bzl\", \"selects\")\n\npackage(default_visibility = [\"//visibility:public\"])\n\ncargo_toml_env_vars(\n name = \"cargo_toml_env_vars\",\n src = \"Cargo.toml\",\n)\n\nrust_library(\n name = \"seekdb_jemalloc_sys\",\n deps = [\n \":build_script_build\",\n ],\n compile_data = glob(\n allow_empty = True,\n include = [\"**\"],\n exclude = [\n \"**/* *\",\n \".tmp_git_root/**/*\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n ],\n ),\n crate_features = [\n \"default\",\n \"stats\",\n ],\n crate_root = \"src/lib.rs\",\n edition = \"2021\",\n rustc_env_files = [\n \":cargo_toml_env_vars\",\n ],\n rustc_flags = [\n \"--cap-lints=allow\",\n ],\n srcs = glob(\n allow_empty = True,\n include = [\"**/*.rs\"],\n ),\n tags = [\n \"cargo-bazel\",\n \"crate-name=seekdb-jemalloc-sys\",\n \"manual\",\n \"noclippy\",\n \"norustfmt\",\n ],\n target_compatible_with = select({\n \"@rules_rust//rust/platform:aarch64-apple-darwin\": [],\n \"@rules_rust//rust/platform:aarch64-apple-ios\": [],\n \"@rules_rust//rust/platform:aarch64-apple-ios-sim\": [],\n \"@rules_rust//rust/platform:aarch64-linux-android\": [],\n \"@rules_rust//rust/platform:aarch64-pc-windows-msvc\": [],\n \"@rules_rust//rust/platform:aarch64-unknown-linux-gnu\": [],\n \"@rules_rust//rust/platform:wasm32-unknown-emscripten\": [],\n \"@rules_rust//rust/platform:x86_64-apple-darwin\": [],\n \"@rules_rust//rust/platform:x86_64-pc-windows-msvc\": [],\n \"@rules_rust//rust/platform:x86_64-unknown-linux-gnu\": [],\n \"//conditions:default\": [\"@platforms//:incompatible\"],\n }),\n version = \"0.2.3+5.3.1\",\n)\n\ncargo_build_script(\n name = \"_bs\",\n build_script_env = select({\n \"@rules_rust//rust/platform:aarch64-apple-darwin\": {\n \"CFLAGS\": \"-O2 -fPIC\", # aarch64-apple-darwin\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\", # aarch64-apple-darwin\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # aarch64-apple-darwin\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:aarch64-apple-ios\": {\n \"CFLAGS\": \"-O2 -fPIC\", # aarch64-apple-ios\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\\n--host=aarch64-apple-ios\\n--with-lg-page=14\\n--disable-zone-allocator\", # aarch64-apple-ios\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # aarch64-apple-ios\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:aarch64-apple-ios-sim\": {\n \"CFLAGS\": \"-O2 -fPIC\", # aarch64-apple-ios-sim\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\\n--host=aarch64-apple-ios\\n--with-lg-page=14\\n--disable-zone-allocator\", # aarch64-apple-ios-sim\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # aarch64-apple-ios-sim\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:aarch64-linux-android\": {\n \"CFLAGS\": \"-O2 -fPIC\", # aarch64-linux-android\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\\n--host=aarch64-linux-android\\n--with-lg-page=14\\n--disable-initial-exec-tls\", # aarch64-linux-android\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # aarch64-linux-android\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:aarch64-pc-windows-msvc\": {\n \"CFLAGS\": \"/O2 /MD /D_WIN32_WINNT=0x0A00\", # aarch64-pc-windows-msvc\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\\n--host=aarch64-w64-mingw32\", # aarch64-pc-windows-msvc\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\\nMSYS2_ARG_CONV_EXCL=*\", # aarch64-pc-windows-msvc\n \"JEMALLOC_SYS_MAKE\": \"make\", # aarch64-pc-windows-msvc\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PATH\": \"$(CARGO_BUILD_SCRIPT_PATH)\", # aarch64-pc-windows-msvc\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:aarch64-unknown-linux-gnu\": {\n \"CFLAGS\": \"-O2 -fPIC\", # aarch64-unknown-linux-gnu\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\", # aarch64-unknown-linux-gnu\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # aarch64-unknown-linux-gnu\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:wasm32-unknown-emscripten\": {\n \"CFLAGS\": \"-O2 -fPIC\", # wasm32-unknown-emscripten\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\", # wasm32-unknown-emscripten\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # wasm32-unknown-emscripten\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:x86_64-apple-darwin\": {\n \"CFLAGS\": \"-O2 -fPIC\", # x86_64-apple-darwin\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\", # x86_64-apple-darwin\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # x86_64-apple-darwin\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:x86_64-pc-windows-msvc\": {\n \"CFLAGS\": \"/O2 /MD /D_WIN32_WINNT=0x0A00\", # x86_64-pc-windows-msvc\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\\n--host=x86_64-w64-mingw32\", # x86_64-pc-windows-msvc\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\\nMSYS2_ARG_CONV_EXCL=*\", # x86_64-pc-windows-msvc\n \"JEMALLOC_SYS_MAKE\": \"make\", # x86_64-pc-windows-msvc\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PATH\": \"$(CARGO_BUILD_SCRIPT_PATH)\", # x86_64-pc-windows-msvc\n \"PROFILE\": \"release\",\n },\n \"@rules_rust//rust/platform:x86_64-unknown-linux-gnu\": {\n \"CFLAGS\": \"-O2 -fPIC\", # x86_64-unknown-linux-gnu\n \"DEBUG\": \"true\",\n \"JEMALLOC_SYS_CONFIGURE_ARGS\": \"--with-jemalloc-prefix=je_\", # x86_64-unknown-linux-gnu\n \"JEMALLOC_SYS_CONFIGURE_ENV\": \"CPPFLAGS=\\nLDFLAGS=\", # x86_64-unknown-linux-gnu\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n \"//conditions:default\": {\n \"DEBUG\": \"true\",\n \"MAKEFLAGS\": \"\",\n \"NUM_JOBS\": \"4\",\n \"PROFILE\": \"release\",\n },\n }),\n build_script_env_files = [\n \":cargo_toml_env_vars\",\n ],\n compile_data = glob(\n allow_empty = True,\n include = [\"**\"],\n exclude = [\n \"**/* *\",\n \"**/*.rs\",\n \".tmp_git_root/**/*\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n ],\n ),\n crate_features = [\n \"default\",\n \"stats\",\n ],\n crate_name = \"build_script_build\",\n crate_root = \"build.rs\",\n data = glob(\n allow_empty = True,\n include = [\"**\"],\n exclude = [\n \"**/* *\",\n \".tmp_git_root/**/*\",\n \"BUILD\",\n \"BUILD.bazel\",\n \"WORKSPACE\",\n \"WORKSPACE.bazel\",\n ],\n ),\n emit_warnings = False,\n edition = \"2021\",\n links = \"seekdb_jemalloc\",\n pkg_name = \"seekdb-jemalloc-sys\",\n rustc_env_files = [\n \":cargo_toml_env_vars\",\n ],\n rustc_flags = [\n \"--cap-lints=allow\",\n ],\n srcs = glob(\n allow_empty = True,\n include = [\"**/*.rs\"],\n ),\n tags = [\n \"cargo-bazel\",\n \"crate-name=seekdb-jemalloc-sys\",\n \"manual\",\n \"noclippy\",\n \"norustfmt\",\n ],\n toolchains = [\"@@//bazel:windows_build_script_environment\"],\n version = \"0.2.3+5.3.1\",\n visibility = [\"//visibility:private\"],\n)\n\nalias(\n name = \"build_script_build\",\n actual = \":_bs\",\n tags = [\"manual\"],\n)\n" - } } } } diff --git a/bazel/BUILD.bazel b/bazel/BUILD.bazel index a30a3f6e6a..1f2ff2fb52 100644 --- a/bazel/BUILD.bazel +++ b/bazel/BUILD.bazel @@ -1,5 +1,4 @@ load(":build_settings.bzl", "bool_flag") -load(":cargo_build_script_env.bzl", "cargo_build_script_environment") exports_files([ "build_metadata.py", @@ -13,11 +12,6 @@ exports_files([ "final_link.bzl", ]) -cargo_build_script_environment( - name = "windows_build_script_environment", - visibility = ["//visibility:public"], -) - config_setting( name = "ios_simulator", constraint_values = ["@platforms//os:ios", "@apple_support//constraints:simulator"], diff --git a/bazel/cargo_build_script_env.bzl b/bazel/cargo_build_script_env.bzl deleted file mode 100644 index 50280e0c26..0000000000 --- a/bazel/cargo_build_script_env.bzl +++ /dev/null @@ -1,47 +0,0 @@ -"""Expose the native compiler and shell-tool PATH to Cargo build scripts.""" - -load("@rules_cc//cc:action_names.bzl", "CPP_LINK_EXECUTABLE_ACTION_NAME") -load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_ATTRS", "find_cpp_toolchain", "use_cc_toolchain") -load("@rules_cc//cc/common:cc_common.bzl", "cc_common") - -def _cargo_build_script_environment_impl(ctx): - # crate_universe attaches toolchains to every target platform. Only the - # Windows build-script environment references this PATH variable. - if not ctx.target_platform_has_constraint(ctx.attr._windows[platform_common.ConstraintValueInfo]): - return [platform_common.TemplateVariableInfo({})] - - cc_toolchain = find_cpp_toolchain(ctx) - features = cc_common.configure_features( - ctx = ctx, - cc_toolchain = cc_toolchain, - requested_features = ctx.features, - unsupported_features = ctx.disabled_features, - ) - environment = cc_common.get_environment_variables( - feature_configuration = features, - action_name = CPP_LINK_EXECUTABLE_ACTION_NAME, - variables = cc_common.create_link_variables( - cc_toolchain = cc_toolchain, - feature_configuration = features, - is_using_linker = True, - ), - ) - default_environment = ctx.configuration.default_shell_env - paths = [ - environment.get("PATH", environment.get("Path", "")), - default_environment.get("PATH", default_environment.get("Path", "")), - ] - # Keep the native compiler first, then allow configure/make to find tools - # supplied by the invoking process. build.py fixes PATH in --action_env. - return [platform_common.TemplateVariableInfo({ - "CARGO_BUILD_SCRIPT_PATH": ";".join([path for path in paths if path]), - })] - -cargo_build_script_environment = rule( - implementation = _cargo_build_script_environment_impl, - attrs = CC_TOOLCHAIN_ATTRS | { - "_windows": attr.label(default = Label("@platforms//os:windows")), - }, - fragments = ["cpp"], - toolchains = use_cc_toolchain(), -) diff --git a/bazel/ios_framework.bzl b/bazel/ios_framework.bzl index 30497a13cc..367e19b6ed 100644 --- a/bazel/ios_framework.bzl +++ b/bazel/ios_framework.bzl @@ -22,7 +22,6 @@ def ios_framework(): "//src/oblib:oblib_base", "//src/oblib:oblib_io_primitives", "//src/oblib:oblib_rpc", - "//deps/external:jemalloc_headers", "//rust:in_process_headers", "//rust:logger_headers", ], @@ -36,7 +35,6 @@ def ios_framework(): sdk_deps = ["//bazel/sdk_sources:source_sdk", "//bazel/third_party:base_libraries"], ordered_link_files = [ "//rust:archive", - "//deps/external:jemalloc_archive", ], extra_inputs = ["ios/exports.txt"], linkopts = [ diff --git a/bazel/platforms.bzl b/bazel/platforms.bzl index 066ba1f427..d385c01c63 100644 --- a/bazel/platforms.bzl +++ b/bazel/platforms.bzl @@ -63,7 +63,6 @@ def platform_local_defines(): "@platforms//os:ios": [ "_DARWIN_C_SOURCE", "_XOPEN_SOURCE=700", - "OB_HAVE_BUNDLED_JEMALLOC=1", "BOOST_NO_CXX98_FUNCTION_BASE", ], "//conditions:default": [], diff --git a/deps/external/BUILD.bazel b/deps/external/BUILD.bazel index fc7e04d002..b4d89bc4f7 100644 --- a/deps/external/BUILD.bazel +++ b/deps/external/BUILD.bazel @@ -16,11 +16,6 @@ load("//deps/external/bazel:jemalloc.bzl", "jemalloc") package(default_visibility = ["//visibility:private"]) -exports_files([ - "Cargo.toml", - "Cargo.lock", -]) - jemalloc( name = "jemalloc", ) diff --git a/deps/external/Cargo.lock b/deps/external/Cargo.lock deleted file mode 100644 index ff17ff8861..0000000000 --- a/deps/external/Cargo.lock +++ /dev/null @@ -1,16 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "seekdb-external-sources" -version = "0.0.0" -dependencies = [ - "seekdb-jemalloc-sys", -] - -[[package]] -name = "seekdb-jemalloc-sys" -version = "0.2.3+5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278734e47d644d7b861744a38d037b7f9847ef59c38d9f45e27e578db9a21ebe" diff --git a/deps/external/Cargo.toml b/deps/external/Cargo.toml deleted file mode 100644 index 20fb6543ed..0000000000 --- a/deps/external/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "seekdb-external-sources" -version = "0.0.0" -edition = "2021" -publish = false - -[workspace] - -[dependencies] -seekdb-jemalloc-sys = { version = "=0.2.3", features = ["stats"] } diff --git a/deps/external/bazel/jemalloc.bzl b/deps/external/bazel/jemalloc.bzl index 2c219c88e8..232bfd6c01 100644 --- a/deps/external/bazel/jemalloc.bzl +++ b/deps/external/bazel/jemalloc.bzl @@ -12,69 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Expose prebuilt jemalloc, retaining the Rust build for iOS.""" +"""Expose the prebuilt jemalloc archive and headers on supported platforms.""" load("@rules_cc//cc:cc_import.bzl", "cc_import") load("@rules_cc//cc:cc_library.bzl", "cc_library") -load("@rules_rust//rust:rust_common.bzl", "BuildInfo") -def _jemalloc_build_impl(ctx): - archive = ctx.actions.declare_file("jemalloc/lib/libjemalloc_pic.a") - public_header = ctx.actions.declare_file("jemalloc/include/jemalloc/jemalloc.h") - output = ctx.attr.build_script[BuildInfo].out_dir - ctx.actions.run_shell( - inputs = [output], - outputs = [archive, public_header], - arguments = [output.path, archive.path, public_header.path], - command = 'cp "$1/jemalloc-build/lib/libjemalloc_pic.a" "$2" && cp "$1/jemalloc-build/include/jemalloc/jemalloc.h" "$3"', - mnemonic = "JemallocArtifacts", - ) - return [ - DefaultInfo(files = depset([archive, public_header])), - OutputGroupInfo( - jemalloc_archive = depset([archive]), - jemalloc_header = depset([public_header]), - ), - ] - -_jemalloc_build = rule( - implementation = _jemalloc_build_impl, - attrs = { - "build_script": attr.label(default = "@external_crates//:jemalloc_build", providers = [BuildInfo]), - }, -) +_SUPPORTED_PLATFORMS = select({ + "@platforms//os:linux": [], + "@platforms//os:macos": [], + "@platforms//os:android": [], + "@platforms//os:windows": [], + "//conditions:default": ["@platforms//:incompatible"], +}) def jemalloc(name): - """Expose the platform's jemalloc archive and public header to C++.""" - build_target = "_%s_build" % name - rust_archive = "_%s_rust_archive" % name - rust_header = "_%s_rust_header" % name - - _jemalloc_build( - name = build_target, - target_compatible_with = select({ - "@platforms//os:ios": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - ) - - native.filegroup( - name = rust_archive, - srcs = [":" + build_target], - output_group = "jemalloc_archive", - ) - - native.filegroup( - name = rust_header, - srcs = [":" + build_target], - output_group = "jemalloc_header", - ) - - cc_library( - name = "_%s_rust_headers" % name, - hdrs = [":" + rust_header], - strip_include_prefix = "jemalloc/include", - ) + """Expose the platform's prebuilt jemalloc to C++ targets.""" native.filegroup( name = "%s_archive" % name, @@ -83,25 +35,28 @@ def jemalloc(name): "@platforms//os:macos": ["@third_party_native//:lib/libjemalloc_pic.a"], "@platforms//os:android": ["@third_party_android//:lib/libjemalloc_pic.a"], "@platforms//os:windows": ["@third_party_native//:lib/jemalloc.lib"], - "//conditions:default": [":" + rust_archive], + "//conditions:default": [], }), + target_compatible_with = _SUPPORTED_PLATFORMS, visibility = ["//src/observer:__pkg__"], ) - native.alias( + cc_library( name = "%s_headers" % name, - actual = select({ - "@platforms//os:linux": "@third_party_native//:jemalloc_headers", - "@platforms//os:macos": "@third_party_native//:jemalloc_headers", - "@platforms//os:android": "@third_party_android//:jemalloc_headers", - "@platforms//os:windows": "@third_party_native//:jemalloc_headers", - "//conditions:default": ":_%s_rust_headers" % name, + deps = select({ + "@platforms//os:linux": ["@third_party_native//:jemalloc_headers"], + "@platforms//os:macos": ["@third_party_native//:jemalloc_headers"], + "@platforms//os:android": ["@third_party_android//:jemalloc_headers"], + "@platforms//os:windows": ["@third_party_native//:jemalloc_headers"], + "//conditions:default": [], }), + target_compatible_with = _SUPPORTED_PLATFORMS, visibility = ["//src/oblib:__pkg__", "//src/observer:__pkg__"], ) cc_import( name = "%s_library" % name, static_library = ":%s_archive" % name, + target_compatible_with = _SUPPORTED_PLATFORMS, visibility = ["//src/oblib:__pkg__", "//unittest/oblib:__pkg__"], ) diff --git a/package/ios/BUILD.bazel b/package/ios/BUILD.bazel index e5b1de13ca..7d30ebc024 100644 --- a/package/ios/BUILD.bazel +++ b/package/ios/BUILD.bazel @@ -4,7 +4,7 @@ exports_files(["package_framework.py"], visibility = ["//src/observer:__pkg__"]) rust_licenses( name = "rust_licenses", - deps = ["//rust:archive", "@external_crates//:seekdb-jemalloc-sys"], + deps = ["//rust:archive"], manifest = "rust-licenses.json", visibility = ["//src/observer:__pkg__"], ) diff --git a/src/oblib/BUILD.bazel b/src/oblib/BUILD.bazel index 41ec3a2411..23d81c142e 100644 --- a/src/oblib/BUILD.bazel +++ b/src/oblib/BUILD.bazel @@ -717,7 +717,6 @@ cc_library( name = "_jemalloc_headers", deps = select({ "//bazel:sanity_enabled": ["//deps/external:jemalloc_headers"], - "@platforms//os:ios": ["//deps/external:jemalloc_headers"], "//conditions:default": [], }), ) diff --git a/src/observer/BUILD.bazel b/src/observer/BUILD.bazel index 7ee94b564f..dd829b2e9d 100644 --- a/src/observer/BUILD.bazel +++ b/src/observer/BUILD.bazel @@ -521,7 +521,6 @@ cc_library( "//src/oblib:oblib_base", "//src/oblib:oblib_io_primitives", "//src/oblib:oblib_rpc", - "//deps/external:jemalloc_headers", "//rust:in_process_headers", "//rust:logger_headers", ], From 0413eb6574f0bc254a03e0d9bdd49fe8df277564 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 10:01:26 +0800 Subject: [PATCH 38/40] Centralize Rust download defaults for GitHub Actions --- .github/workflows/codeql.yml | 5 ----- .github/workflows/dependency-platform-checks.yml | 6 ------ .github/workflows/rust-checks.yml | 5 ----- build.py | 5 +++-- deps/init/prepare.py | 6 ++++-- 5 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index da793dc564..03b5b490b9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,11 +4,6 @@ on: schedule: - cron: "0 0 * * 1" # every Monday -env: - RUSTUP_DIST_SERVER: https://static.rust-lang.org - RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup - RUSTUP_INIT_URL: https://sh.rustup.rs - jobs: codeql: runs-on: ubuntu-22.04 diff --git a/.github/workflows/dependency-platform-checks.yml b/.github/workflows/dependency-platform-checks.yml index 12cfb3e89d..7c978fdb3f 100644 --- a/.github/workflows/dependency-platform-checks.yml +++ b/.github/workflows/dependency-platform-checks.yml @@ -32,9 +32,6 @@ jobs: runs-on: ubuntu-24.04-arm timeout-minutes: 360 env: - RUSTUP_DIST_SERVER: https://static.rust-lang.org - RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup - RUSTUP_INIT_URL: https://sh.rustup.rs SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' steps: - uses: actions/checkout@v4 @@ -63,9 +60,6 @@ jobs: init: '--ios --simulator' config: '--config=ios-simulator' env: - RUSTUP_DIST_SERVER: https://static.rust-lang.org - RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup - RUSTUP_INIT_URL: https://sh.rustup.rs SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml index 69a3895571..e3fb67f54d 100644 --- a/.github/workflows/rust-checks.yml +++ b/.github/workflows/rust-checks.yml @@ -39,11 +39,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - RUSTUP_DIST_SERVER: https://static.rust-lang.org - RUSTUP_UPDATE_ROOT: https://static.rust-lang.org/rustup - RUSTUP_INIT_URL: https://sh.rustup.rs - jobs: clippy-and-audit: runs-on: ubuntu-latest diff --git a/build.py b/build.py index 8dc4e8fef7..37ba5c9042 100755 --- a/build.py +++ b/build.py @@ -208,8 +208,9 @@ def _normalize_cxxbridge_lockfile_paths(root: Path, output_base: Path) -> None: def main(arguments: List[str]) -> int: root = Path(__file__).resolve().parent - os.environ.setdefault("RUSTUP_DIST_SERVER", "https://rsproxy.cn") - os.environ.setdefault("RUSTUP_UPDATE_ROOT", "https://rsproxy.cn/rustup") + if os.environ.get("GITHUB_ACTIONS") != "true": + os.environ.setdefault("RUSTUP_DIST_SERVER", "https://rsproxy.cn") + os.environ.setdefault("RUSTUP_UPDATE_ROOT", "https://rsproxy.cn/rustup") cargo_bin = str((Path(os.environ.get("CARGO_HOME", Path.home() / ".cargo")) / "bin").expanduser().resolve()) path = os.environ.get("PATH", os.defpath) if cargo_bin not in path.split(os.pathsep): diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 3101caf793..9d0820048e 100644 --- a/deps/init/prepare.py +++ b/deps/init/prepare.py @@ -373,11 +373,13 @@ def prepare_rust(target=None): if os.name == "nt": arch = {"amd64": "x86_64", "x86_64": "x86_64", "arm64": "aarch64", "aarch64": "aarch64"}[platform.machine().lower()] installer = Path(directory) / "rustup-init.exe" - url = os.environ["RUSTUP_UPDATE_ROOT"].rstrip("/") + "/dist/" + arch + "-pc-windows-msvc/rustup-init.exe" + root = os.environ.get("RUSTUP_UPDATE_ROOT", "https://static.rust-lang.org/rustup") + url = root.rstrip("/") + "/dist/" + arch + "-pc-windows-msvc/rustup-init.exe" command = [str(installer)] else: installer = Path(directory) / "rustup-init.sh" - url = "https://rsproxy.cn/rustup-init.sh" + url = ("https://sh.rustup.rs" if os.environ.get("GITHUB_ACTIONS") == "true" + else "https://rsproxy.cn/rustup-init.sh") command = ["sh", str(installer)] print("Installing rustup", flush=True) download(os.environ.get("RUSTUP_INIT_URL", url), installer) From 08e8bbf19b7f2fc4b8b1972323ec0a383296238b Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 10:02:25 +0800 Subject: [PATCH 39/40] Remove deferred platform build workflow --- .../workflows/dependency-platform-checks.yml | 71 ------------------- 1 file changed, 71 deletions(-) delete mode 100644 .github/workflows/dependency-platform-checks.yml diff --git a/.github/workflows/dependency-platform-checks.yml b/.github/workflows/dependency-platform-checks.yml deleted file mode 100644 index 7c978fdb3f..0000000000 --- a/.github/workflows/dependency-platform-checks.yml +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 2025 OceanBase. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -name: dependency-platform-checks - -on: - pull_request: - paths: - - 'deps.lock.json' - - 'deps/init/**' - - 'deps/external/**' - - 'bazel/third_party/**' - - 'bazel/sdk_sources/**' - - '.github/workflows/dependency-platform-checks.yml' - -permissions: - contents: read - -jobs: - linux-arm64: - runs-on: ubuntu-24.04-arm - timeout-minutes: 360 - env: - SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' - steps: - - uses: actions/checkout@v4 - - name: Show build environment - run: uname -a; df -h . - - name: Initialize dependencies - run: python3 build.py init - - name: Build seekdb - run: python3 build.py build --jobs=2 seekdb - - apple: - name: ${{ matrix.platform }} - runs-on: macos-15 - timeout-minutes: 360 - strategy: - fail-fast: false - matrix: - include: - - platform: macos-arm64 - init: '' - config: '' - - platform: ios-arm64 - init: '--ios' - config: '--config=ios' - - platform: ios-simulator-arm64 - init: '--ios --simulator' - config: '--config=ios-simulator' - env: - SEEKDB_DEPS_GITHUB_PROXY_PREFIX: '' - steps: - - uses: actions/checkout@v4 - - name: Show build environment - run: uname -a; xcodebuild -version; df -h . - - name: Initialize dependencies - run: python3 build.py init ${{ matrix.init }} - - name: Build seekdb - run: python3 build.py build ${{ matrix.config }} --jobs=2 seekdb From adab64abd1aed34fe249de0a29f0eee7b7d84691 Mon Sep 17 00:00:00 2001 From: "wangyunlai.wyl" Date: Tue, 17 Nov 2026 10:31:03 +0800 Subject: [PATCH 40/40] Update VSAG Wasm package to corrected release --- deps.lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.lock.json b/deps.lock.json index 46ab33ea88..08193568ed 100644 --- a/deps.lock.json +++ b/deps.lock.json @@ -62,8 +62,8 @@ }, "wasm32-emscripten": { "vsag": { - "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261116T070344%2B0000-97588f036a3a.tar.gz", - "sha256": "9d7996cc0564c0646da9e1f4c31bd093dd045084d5f556e6d49c901cf76d8e2b" + "url": "https://github.com/oceanbase/seekdb-deps/releases/download/vsag-0.16.20/vsag-0.16.20-bin-wasm32-emscripten-20261117T020514%2B0000-696998510ad2.tar.gz", + "sha256": "bed161ba48217216dea31d3750abc992302457f2e3b69e0b5fd076d3a81ec3a2" } }, "windows-x86_64-md": {