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 diff --git a/.gitignore b/.gitignore index 5f31724974..3976496283 100644 --- a/.gitignore +++ b/.gitignore @@ -210,6 +210,7 @@ src/oblib/grpc/*.pb.cpp !src/oblib/grpc/standbyservice.grpc.pb.h !src/oblib/grpc/standbyservice.grpc.pb.cc deps/3rd +/deps/prebuilt/ deps/ios/ deps/3rd_party deps/usr diff --git a/MODULE.bazel b/MODULE.bazel index a4dd8f065a..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") @@ -252,19 +172,6 @@ use_repo( sdk_sources, "sdk_abseil", "sdk_roaring", - "sdk_vsag_ios", - "sdk_vsag_wasm", - "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..3452429104 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" } } } @@ -622,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", @@ -634,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+", @@ -677,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": { @@ -4256,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 e0c07ca86f..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 = [ @@ -84,6 +82,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 +101,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/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/bazel/sdk_sources/BUILD.bazel b/bazel/sdk_sources/BUILD.bazel index 1562ecbeac..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({ @@ -40,28 +30,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/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/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/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; diff --git a/bazel/third_party/repositories.bzl b/bazel/third_party/repositories.bzl index b66cf34611..38fa2502d7 100644 --- a/bazel/third_party/repositories.bzl +++ b/bazel/third_party/repositories.bzl @@ -1,11 +1,24 @@ """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 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" + 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 for name, path in headers.items(): # Boost comes from the pinned @sdk_boost source repository on every # platform; leaving the installed SDK copy here would mix its version. @@ -26,15 +39,21 @@ 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", - "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") + 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)") @@ -66,6 +85,15 @@ 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/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", @@ -77,6 +105,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) @@ -88,13 +121,28 @@ 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) 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 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..008c63398e 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"]}, } @@ -77,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 = { @@ -101,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"]), @@ -122,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]} @@ -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/build.py b/build.py index 61cd1699c3..37ba5c9042 100755 --- a/build.py +++ b/build.py @@ -21,6 +21,19 @@ class BuildError(RuntimeError): """The seekdb build environment could not be prepared.""" +def _check_windows_toolset() -> None: + # Released Windows dependencies were built with MSVC 14.44; linking needs + # the same or a newer compatible toolset. + version = os.environ.get("VCToolsVersion", "") + match = re.fullmatch(r"14\.(\d+)\.\d+", version) + if match is None or int(match.group(1)) < 44: + raise BuildError( + "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") + ) + + def _host_platform() -> str: system = {"Linux": "linux", "Darwin": "darwin", "Windows": "windows"}.get( platform.system() @@ -195,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): @@ -225,6 +239,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 new file mode 100644 index 0000000000..08193568ed --- /dev/null +++ b/deps.lock.json @@ -0,0 +1,80 @@ +{ + "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-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-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-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e708ec65aecaea1ed45e799990fa08147b12ea97f399d241192405c358ac9908" + } + }, + "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-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e30183e23d29f477936c1ee5f3ef92467003ee62e0ce42195e082e3744b0033c" + } + }, + "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-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "d9b9d2d7f6122d6e4a2e60c46afa2ec7d3e3858db42c194687d234fd4f086a53" + } + }, + "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-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-20261117T020514%2B0000-696998510ad2.tar.gz", + "sha256": "bed161ba48217216dea31d3750abc992302457f2e3b69e0b5fd076d3a81ec3a2" + } + }, + "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-20261116T070344%2B0000-97588f036a3a.tar.gz", + "sha256": "e1f27d782f614caad7a24ae19a2fcb40f64a63405b1ae9ea1cfd427b7c8191aa" + } + } + } +} 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 1f2dc6ab41..232bfd6c01 100644 --- a/deps/external/bazel/jemalloc.bzl +++ b/deps/external/bazel/jemalloc.bzl @@ -12,82 +12,51 @@ # 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 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") -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) - 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"', - mnemonic = "JemallocArtifacts", - use_default_shell_env = windows, - ) - 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]), - } | PLATFORM_ATTRS, -) +_SUPPORTED_PLATFORMS = select({ + "@platforms//os:linux": [], + "@platforms//os:macos": [], + "@platforms//os:android": [], + "@platforms//os:windows": [], + "//conditions:default": ["@platforms//:incompatible"], +}) def jemalloc(name): - """Expose the native outputs of the rules_rust build script to C++.""" - build_target = "_%s_build" % name - public_header_target = "%s_public_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"], - }), - ) + """Expose the platform's prebuilt jemalloc to C++ targets.""" native.filegroup( name = "%s_archive" % name, - srcs = [":" + build_target], - output_group = "jemalloc_archive", + 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"], + "@platforms//os:windows": ["@third_party_native//:lib/jemalloc.lib"], + "//conditions:default": [], + }), + target_compatible_with = _SUPPORTED_PLATFORMS, visibility = ["//src/observer:__pkg__"], ) - native.filegroup( - name = public_header_target, - srcs = [":" + build_target], - output_group = "jemalloc_header", - ) - cc_library( name = "%s_headers" % name, - hdrs = [":" + public_header_target], - strip_include_prefix = "jemalloc/include", + 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/deps/init/oceanbase.al8.aarch64.deps b/deps/init/oceanbase.al8.aarch64.deps index c3e8a83d99..df7556fc2e 100644 --- a/deps/init/oceanbase.al8.aarch64.deps +++ b/deps/init/oceanbase.al8.aarch64.deps @@ -9,14 +9,12 @@ 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-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 f292d07ccb..99deb7cf59 100644 --- a/deps/init/oceanbase.al8.x86_64.deps +++ b/deps/init/oceanbase.al8.x86_64.deps @@ -9,14 +9,12 @@ 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-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 5b8a64b38f..c954eadb05 100644 --- a/deps/init/oceanbase.el7.aarch64.deps +++ b/deps/init/oceanbase.el7.aarch64.deps @@ -10,14 +10,12 @@ 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-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 80acefbf3b..9c5c02e837 100644 --- a/deps/init/oceanbase.el7.x86_64.deps +++ b/deps/init/oceanbase.el7.x86_64.deps @@ -11,14 +11,12 @@ 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-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 3cd65b1e43..ef310f6f36 100644 --- a/deps/init/oceanbase.el8.aarch64.deps +++ b/deps/init/oceanbase.el8.aarch64.deps @@ -10,14 +10,12 @@ 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-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 9586562780..f8c9ae13d5 100644 --- a/deps/init/oceanbase.el8.x86_64.deps +++ b/deps/init/oceanbase.el8.x86_64.deps @@ -10,14 +10,12 @@ 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-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 e7b9ce936e..10efcfb52b 100644 --- a/deps/init/oceanbase.el9.aarch64.deps +++ b/deps/init/oceanbase.el9.aarch64.deps @@ -15,14 +15,12 @@ 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-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 db46705ffe..35b0dc8b52 100644 --- a/deps/init/oceanbase.el9.x86_64.deps +++ b/deps/init/oceanbase.el9.x86_64.deps @@ -15,14 +15,12 @@ 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-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/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 diff --git a/deps/init/prepare.py b/deps/init/prepare.py index 360a0dbb3d..9d0820048e 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,8 +102,72 @@ 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")) + platforms = lock.get("platforms", {}) + if not isinstance(platforms, dict): + raise ValueError("Invalid dependency lock platforms: " + str(lock_file)) + platform_name = { + "Darwin": "macos", "Windows": "windows", + "iOSDevice": "ios", "iOSSimulator": "ios", + }.get(system, system.lower()) + prefix = "%s-%s" % (platform_name, architecture) + pattern = None + version = None + if system == "Linux": + libc = platform.libc_ver()[1] + 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": + 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": + 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 + "wasm32-emscripten" if system == "Wasm" 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) + + 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): - 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) @@ -112,10 +177,104 @@ def download(url, archive): partial.unlink() -def unpack(archive, destination): +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: + for block in iter(lambda: source.read(1024 * 1024), b""): + digest.update(block) + 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", "") + 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"))) + + archive_directory.mkdir(parents=True, exist_ok=True) + 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=".package.", suffix=".tmp", dir=archive_directory) + os.close(descriptor) + temporary = Path(temporary_name) + try: + download(locked_download_url(url), temporary) + 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 + + +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: @@ -138,29 +297,32 @@ 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(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) - 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) + populate_profile(profile, stage, archive_directory) (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): + key = hashlib.sha256(profile.read_bytes()).hexdigest() if ready(destination, key): print("Dependencies ready: " + str(destination), flush=True) return @@ -182,17 +344,42 @@ def install(profile, destination, cache_directory=None): 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 = 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() + for package in packages: + archive = locked_archive(package, archive_directory) + 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: 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) @@ -227,22 +414,38 @@ 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 = 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" 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 - install(profile, ROOT / "deps/3rd", Path(cache).expanduser().resolve() if cache 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 if os.name != "nt" else None) + 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) + 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") + install(PROFILES / "oceanbase.android.arm64.deps", ROOT / "deps/android", None) + install_locked(ROOT / "deps.lock.json", ROOT / "deps/prebuilt/android", cache_directory, + "Android", "arm64") if options.ios: 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/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/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), 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", ], 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"] 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; 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",