Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
ce1b6df
feat: Add C ABI for embedded seekdb (multi‑language SDKs)
dengfuping Jan 28, 2026
01a9b14
refactor(seekdb): remove seekdb_row_free API and align row lifetime w…
dengfuping Jan 29, 2026
3a47572
fix(build): only create the seekdb library in BUILD_EMBED_MODE
dengfuping Jan 28, 2026
19cf0ec
improve(include): libseekdb support macos build
dengfuping Jan 28, 2026
4b8ca2f
fix(build): specify DPYTHON_VERSION to build libseekdb
dengfuping Jan 28, 2026
d80c2fc
fix(ci): make seekdb => make libseekdb
dengfuping Jan 29, 2026
bbfd6ac
fix(ci): build cache should work
dengfuping Jan 29, 2026
58be1aa
improve(include): generate macOS export list from seekdb.h and fix te…
dengfuping Jan 29, 2026
5e5ea84
fix(embed): VARBINARY_ID param binding and fix parameterized query re…
dengfuping Jan 29, 2026
74feed2
fix(embed): return VECTOR column as JSON string without rounding (e.g…
dengfuping Jan 29, 2026
ac57a17
improve(ci): use build_debug for libseekdb
dengfuping Jan 29, 2026
68f3c2f
fix(include): remove unimplemented API declarations from seekdb.h
dengfuping Jan 29, 2026
a4f8d52
fix(embed): suppress "successfully init log writer" by redirecting st…
dengfuping Jan 30, 2026
be07d23
feat(embedded): support 100KB document; LOB in-row via session var; f…
dengfuping Jan 30, 2026
2968178
c-api: improve LOB and metadata handling for embedded mode
dengfuping Jan 30, 2026
dca48a3
feat(package): add libseekdb build script and zip packaging
dengfuping Jan 30, 2026
7a53af1
feat(ci): Add build-libseekdb.yml
dengfuping Jan 30, 2026
1bd1cb2
ci(libseekdb): multi-platform build, S3 upload, CentOS 7/macOS 11+ co…
dengfuping Jan 30, 2026
fee1009
ci(libseekdb): switch macOS runner from macos-13 to macos-14, update …
dengfuping Jan 30, 2026
985a640
ci(libseekdb): add git safe.directory in Linux container to fix dubio…
dengfuping Jan 30, 2026
dae2642
ci(libseekdb): fix make receiving -D options by dropping --make, run …
dengfuping Jan 30, 2026
dc93cb6
ci(libseekdb): add ccache cache for Linux and macOS builds
dengfuping Jan 30, 2026
d4223c6
ci(libseekdb): detect runner Python first, install if not usable; set…
dengfuping Jan 30, 2026
5f42517
ci(libseekdb): fix macOS/Linux ccache and Linux wget for manylinux build
dengfuping Jan 30, 2026
2c75910
ci(libseekdb): update build-libseekdb workflow
dengfuping Jan 30, 2026
bd13837
ci(libseekdb): install pybind11 via brew for macOS embed build
dengfuping Jan 30, 2026
512b612
ci(libseekdb): checkout PR head, restore darwin-x64; Env.cmake fix ma…
dengfuping Jan 30, 2026
3be118d
ci(libseekdb): save deps/ccache cache on failure (if: always())
dengfuping Jan 30, 2026
dad7d50
fix(libseekdb): Linux pack path; disable QPL on macOS
dengfuping Jan 30, 2026
2288133
ci(libseekdb): add macOS Homebrew deps (utf8proc, thrift, re2, brotli…
dengfuping Jan 31, 2026
eaeb90e
ci(libseekdb): remove macOS x64 (darwin-x64) build and related adapt …
dengfuping Jan 31, 2026
0d1371b
ci(libseekdb): fix Linux ccache symlink same-file error, resolve ccac…
dengfuping Jan 31, 2026
f32478c
fix(buildbase): build libseekdb in build_release not build_debug for …
dengfuping Jan 31, 2026
456c89b
feat(embed): absolute path reuse and DDL visibility refresh for listC…
dengfuping Feb 2, 2026
b2e3791
ci(libseekdb): tune ccache (CCACHE_COMPILERCHECK=content, CCACHE_NOHA…
dengfuping Feb 2, 2026
3cc0442
fix(embed): align log and stdout redirect with Python embed
dengfuping Feb 3, 2026
3ee2772
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 3, 2026
a613e1d
fix(embed): align schema refresh with MySQL protocol (check-and-refre…
dengfuping Feb 3, 2026
ca0b4cd
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 3, 2026
dc7cc9a
ci(libseekdb): use merge-multiple for artifacts, upload S3 without ex…
dengfuping Feb 4, 2026
6dd301a
test(bindings): run full suite with absolute path (second run), add t…
dengfuping Feb 4, 2026
d6172a9
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
f76b250
ci(libseekdb): fix cache keys for deps/ccache so second run hits
dengfuping Feb 4, 2026
c067fdd
package(libseekdb): improve macOS dylib bundle and @loader_path restore
dengfuping Feb 4, 2026
079c2cb
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
eff01a9
ci(buildbase): use system compiler for node-gyp N-API to avoid bits/l…
dengfuping Feb 4, 2026
a503822
fix(embed): suppress LOG_STDOUT (successfully init log writer) via RA…
dengfuping Feb 4, 2026
8cb64ff
Merge branch 'feat/embedded-mode' of github.com:dengfuping/seekdb int…
dengfuping Feb 4, 2026
71aa7ed
fix(nodejs_napi): npm audit fix for brace-expansion and tar vulnerabi…
dengfuping Feb 4, 2026
e876e7f
fix(ci): use actual built commit sha for libseekdb run-name and S3 paths
dengfuping Feb 5, 2026
2e91bc6
improve(ci): libseekdb workflow manual run and trigger on workflow fi…
dengfuping Feb 11, 2026
b6d6fed
Merge branch, resolve zlib_lite deletion conflict
dengfuping Feb 11, 2026
862e027
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Feb 13, 2026
7fc68ae
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Feb 24, 2026
af84c4b
fix(storage): add explicit instantiation of build_range_array<ObStore…
dengfuping Feb 24, 2026
d6cb94b
fix(embed): recognize cleanup segfaults after close and reinstall SIG…
dengfuping Feb 25, 2026
ea10c8b
ci(libseekdb): add macOS code signing with Developer ID, entitlements…
dengfuping Feb 25, 2026
ea9e274
ci(libseekdb): run binding tests in each build job, trigger on all br…
dengfuping Feb 27, 2026
9169c43
ci(buildbase): restore debug-only build and remove ccache restore-keys
dengfuping Feb 27, 2026
da76ee8
fix(ci): avoid env context in workflow top-level to fix Unrecognized …
dengfuping Feb 27, 2026
7190df3
map ObObjType to SEEKDB_TYPE in result set field metadata for C API c…
dengfuping Feb 28, 2026
4edd75e
fix(ci): skip macOS cert import when empty, fallback to ad-hoc signing
dengfuping Feb 28, 2026
e56d81c
ci(compile): remove Node.js, Rust, Go setup and python3-pip from ubun…
dengfuping Mar 2, 2026
1b25036
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 2, 2026
2bd8454
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 5, 2026
449b889
Add Java JNI binding for libseekdb embedded mode
dengfuping Mar 5, 2026
58efc37
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 6, 2026
7f4681a
Add SIGABRT handler for graceful exit during embedded DB cleanup on m…
dengfuping Mar 9, 2026
f7004a6
Move Java setup step after Go setup in build-libseekdb workflow
dengfuping Mar 9, 2026
0b59f8f
Add SIGBUS handler for graceful exit during embedded DB cleanup on macOS
dengfuping Mar 11, 2026
c1a508a
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 11, 2026
9bfd905
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Mar 25, 2026
f8021ec
chore(merge): Merge master branch and fix conflicts
dengfuping Mar 29, 2026
a92963f
feat(android): add libseekdb arm64-v8a CI, NDK toolchain glob, and pa…
dengfuping Mar 29, 2026
7ac6f56
fix(ci): use r27d for setup-ndk to avoid NDK download 404
dengfuping Mar 29, 2026
ab6ae23
fix(build): resolve cmake from devtools or PATH on Linux for Android CI
dengfuping Mar 29, 2026
73e1d23
fix(deps): suppress GNU tar unknown PAX header warnings when unpacking
dengfuping Mar 29, 2026
1eff8b7
fix(build): fall back to PATH for ccache when devtools has none
dengfuping Mar 30, 2026
cdf03fc
fix(android): guard TMPFS_MAGIC for NDK headers; run libseekdb CI on …
dengfuping Mar 30, 2026
f6704b1
fix(android): use NDK llvm-strip for libseekdb when host strip cannot…
dengfuping Mar 30, 2026
e47c9c1
fix(android): embed-safe CPU and signal handling, skip RS tablet repo…
dengfuping Apr 16, 2026
38e67f6
fix(android): rollback orphan inner transaction state before seekdb_b…
dengfuping Apr 16, 2026
d30feb0
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Apr 26, 2026
5bae035
feat(libseekdb): add Windows DLL link, packaging, CI jobs and PS bind…
dengfuping Apr 23, 2026
b31d5a7
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Apr 26, 2026
4c94261
test(libseekdb): clarify Windows post-Python binding steps; skip flus…
dengfuping Apr 26, 2026
e6891c3
ci(libseekdb): scope push to long-lived branches to avoid duplicate P…
dengfuping Apr 26, 2026
0d783e6
fix(libseekdb): Windows libseekdb binding — split CI & timeouts, in-p…
dengfuping Apr 30, 2026
767c79d
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 13, 2026
a83fd30
fix(libseekdb): Windows DLL discovery, embed Python without Python3::…
dengfuping May 15, 2026
23a56e4
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 15, 2026
d60d645
fix(thread,sql,objit,libseekdb): embed parquet/Win JIT stub; Android …
dengfuping May 15, 2026
4987cfb
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 18, 2026
b62eebd
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping May 19, 2026
301433f
fix(build): macOS GTest linking, thread destroy_stack ifdef, libseekd…
dengfuping May 19, 2026
d3e0aab
fix: create LOB aux tables after hybrid vec index adds LOB columns
May 14, 2026
5e1eb79
revert disable vsag in embedded mode
hnwyllmm May 20, 2026
33faaf5
fix(embed): enable async change stream indexing, vsag, and C API stri…
dengfuping May 21, 2026
3309beb
gitignore: ignore local CodeGraph index directory
dengfuping May 21, 2026
7215152
Merge branch 'release/1.3.0' of github.com:oceanbase/seekdb into feat…
dengfuping May 21, 2026
40a683f
fix(libseekdb): Windows DLL discovery, embed Python without Python3::…
dengfuping May 15, 2026
e64513c
fix(libseekdb): bundle seekdb.dll runtime deps and fix Windows Python…
dengfuping May 22, 2026
7b67b66
fix(tests): start npm via npm.cmd on Windows for binding install
dengfuping May 22, 2026
6520e47
fix(embedded): STRING/JSON bind escaping and string cell materialization
dengfuping May 22, 2026
d88aaf9
ci(libseekdb): add post-pack zip smoke test and scope ccache by commit
dengfuping May 23, 2026
8c215e5
ci(libseekdb): add seekdb-js pack smoke, diagnose, and pin macOS brew…
dengfuping May 24, 2026
e2ecce9
ci(libseekdb): harden macOS brew deps install for GHA runners
dengfuping May 24, 2026
58fb769
ci(libseekdb): install thrift 0.22 on GHA via brew extract fallback
dengfuping May 24, 2026
94d359d
ci(libseekdb): vendored thrift@0.22 tap for GHA macOS brew install
dengfuping May 24, 2026
f0ad199
ci(libseekdb): install vendored thrift@0.22 via brew install --formula
dengfuping May 24, 2026
bf5bb1d
ci(libseekdb): load vendored thrift@0.22 via brew tap-new --no-git
dengfuping May 24, 2026
08f10d5
ci(libseekdb): use macos-15 runner for macOS and Android builds
dengfuping May 25, 2026
7cdd3bc
fix(libseekdb): pack Windows runtime DLLs into libs/ for standalone z…
dengfuping May 25, 2026
e3b7bfe
ci(libseekdb): use macos-15 runner for macOS and Android builds
dengfuping May 25, 2026
83548c7
fix(libseekdb): pack Windows runtime DLLs into libs/ for standalone z…
dengfuping May 25, 2026
47bbca6
fix(embedded): surface real OB error/warning in execute_update/query …
dengfuping May 31, 2026
252658b
fix(embedded): surface real OB error/warning in execute_update/query …
dengfuping May 31, 2026
11bfd66
Merge branch 'feat/embedded-mode-1.3.0' of github.com:oceanbase/seekd…
dengfuping Jul 17, 2026
3dcdc38
Merge branch 'feat/embedded-mode-1.3.0' into feat/embedded-mode
dengfuping Jul 17, 2026
f6a309f
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Jul 17, 2026
8f7395c
[seekdb][build] fix macOS embedded mode build after master merge
dengfuping Jul 20, 2026
4ed9479
[seekdb][build] merge master into feat/embedded-mode
dengfuping Jul 20, 2026
c5465d0
[seekdb][build] fix embedded mode session APIs after master merge
dengfuping Jul 20, 2026
ff98204
[seekdb][build] restore embed mode defines and fix libseekdb CI packa…
dengfuping Jul 20, 2026
a71603d
[seekdb][change_stream] fix embed LS API usage after single-tenant re…
dengfuping Jul 20, 2026
28858e3
[seekdb][build] define uint on Windows for utility.h embed build
dengfuping Jul 20, 2026
768221a
[seekdb][build] fix Windows type_name.c token regex for digit zero
dengfuping Jul 20, 2026
1bfc8f5
[seekdb][build] use ob_usleep instead of unistd.h on Windows
dengfuping Jul 20, 2026
737aed0
[seekdb][build] merge master into feat/embedded-mode
dengfuping Jul 21, 2026
c2d8b82
fix(embedded): align fork table DDL wait with post-merge APIs
dengfuping Jul 21, 2026
1cfc0d9
fix(embedded): use 64-bit literal for timestamp prealloc range on Win…
dengfuping Jul 22, 2026
8343f99
fix(libseekdb): set Linux rpath when linking smoke-loader seekdb.node
dengfuping Jul 22, 2026
338695e
fix(embedded): merge master into feat/embedded-mode
dengfuping Jul 22, 2026
222d0d1
fix(embedded): stabilize FFI binding and libseekdb CI with exit probe…
dengfuping Jul 27, 2026
43a73e0
fix(embedded): merge master into feat/embedded-mode
dengfuping Jul 27, 2026
ed98672
fix(embedded): fix embed build after master merge API removals
dengfuping Jul 28, 2026
a81137f
chore(libseekdb): remove pack-metadata and diagnose packaging scripts
dengfuping Jul 28, 2026
047e51b
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Jul 28, 2026
8c9f306
fix(embedded): merge master into feat/embedded-mode
dengfuping Jul 30, 2026
bd6648c
fix(embedded): fix embed build after master merge API removals
dengfuping Jul 31, 2026
5cfc8f9
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Jul 31, 2026
617eb74
fix(embedded): remove stale win32_unwind_stubs from libseekdb cmake
dengfuping Jul 31, 2026
825336f
fix(embedded): merge master into feat/embedded-mode
dengfuping Jul 31, 2026
59b0ffa
fix(embedded): adapt seekdb to inner SQL guard API after pool removal
dengfuping Jul 31, 2026
5fbcc80
fix(embedded): skip unsupported ffp-contract flag on Windows clang-cl
dengfuping Jul 31, 2026
f0f753a
fix(embedded): merge master into feat/embedded-mode
dengfuping Aug 3, 2026
5a66145
fix(embedded): unify fork_table executor with master dispatch path
dengfuping Aug 5, 2026
6dc9148
Merge branch 'master' of github.com:oceanbase/seekdb into feat/embedd…
dengfuping Aug 6, 2026
8c2bd70
fix(embedded): cross-compile sql-nio for Android and fix libseekdb CI
dengfuping Aug 13, 2026
67bc090
Merge master into feat/embedded-mode
dengfuping Aug 13, 2026
587f5bb
fix(rust): commit Cargo.lock so --locked CI passes
dengfuping Aug 14, 2026
d086188
fix(build): restore seekdb embedded-mode build and public CI
dengfuping Aug 17, 2026
e4f221f
Merge remote-tracking branch 'origin/master' into feat/embedded-mode
dengfuping Aug 17, 2026
aa3e780
fix(embed): restore master-merge regressions in embedded build
dengfuping Aug 19, 2026
6e133f9
ci(libseekdb): unify multi-platform build jobs, add Windows zip smoke…
dengfuping Aug 19, 2026
bb34552
Merge remote-tracking branch 'origin/master' into feat/embedded-mode
dengfuping Aug 19, 2026
f48b48e
fix(log): release leaked MPSC ring entries and self-heal stale busy head
dengfuping Aug 20, 2026
04f558f
fix(embedded): materialize out-row LOB cells via LOB manager
dengfuping Aug 21, 2026
4d9e857
fix(embedded): materialize LOB cells whose header flag is unset
dengfuping Aug 21, 2026
590d9f9
fix(embedded): pre-size output buffer before read_lob_to_buffer
dengfuping Aug 21, 2026
59fcdc3
fix(embedded): avoid OB_FAIL macro in seekdb_read_outrow_lob
dengfuping Aug 21, 2026
9547448
fix(log): rate-limit alloc_log_item stderr flood and fix force-releas…
dengfuping Aug 24, 2026
b67dd36
fix(embedded): default log level WARN, override via SEEKDB_LOG_LEVEL
dengfuping Aug 24, 2026
cd77bed
refactor(embedded): drop redundant INFO set_log_level before override
dengfuping Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 7 additions & 48 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,60 +34,19 @@ runs:
steps:
- name: Install Rust toolchain
shell: bash
working-directory: ${{ github.workspace }}/rust
env:
SEEKDB_REPO_ROOT: ${{ github.workspace }}
SEEKDB_CARGO_RSProxy_MIRROR: ${{ inputs.crates-mirror }}
run: |
set -euo pipefail

if ! command -v rustup >/dev/null 2>&1 || ! command -v cargo >/dev/null 2>&1; then
install_root="${RUNNER_TEMP:-${TMPDIR:-/tmp}}/seekdb-rust"
export CARGO_HOME="${CARGO_HOME:-$install_root/cargo}"
export RUSTUP_HOME="${RUSTUP_HOME:-$install_root/rustup}"
export PATH="$CARGO_HOME/bin:$PATH"
mkdir -p "$install_root" "$CARGO_HOME" "$RUSTUP_HOME"

rustup_init="$install_root/rustup-init.sh"
rustup_init_url="${RUSTUP_INIT_URL:-https://sh.rustup.rs}"
if command -v curl >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 --retry 3 --fail --silent \
--show-error --location "$rustup_init_url" --output "$rustup_init"
elif command -v wget >/dev/null 2>&1; then
wget --tries=3 --quiet -O "$rustup_init" "$rustup_init_url"
else
echo "setup-rust: curl or wget is required" >&2
exit 1
fi
sh "$rustup_init" -y --profile minimal --default-toolchain none \
--no-modify-path

fi

# Export the homes unconditionally so later steps (mirror config,
# registry cache) can rely on them even when rustup pre-existed.
export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}"
# shellcheck source=/dev/null
source "${{ github.workspace }}/.github/script/install-rust.sh"
{
echo "CARGO_HOME=$CARGO_HOME"
echo "RUSTUP_HOME=$RUSTUP_HOME"
echo "CARGO_HOME=${CARGO_HOME}"
echo "RUSTUP_HOME=${RUSTUP_HOME}"
} >> "$GITHUB_ENV"

rustup_bin_dir="$(dirname "$(command -v rustup)")"
export PATH="$rustup_bin_dir:$PATH"
echo "$rustup_bin_dir" >> "$GITHUB_PATH"
RUSTUP_AUTO_INSTALL=1 cargo --version
rustc --version

- name: Route cargo through the rsproxy crates mirror
if: inputs.crates-mirror == 'true'
shell: bash
run: |
set -euo pipefail
mkdir -p "$CARGO_HOME"
cat >> "$CARGO_HOME/config.toml" <<'EOF'
[source.crates-io]
replace-with = "rsproxy-sparse"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
EOF

# NOTE: needs a node20-capable runner (same constraint as the ccache action
# pin in buildbase); disable via `cache: 'false'` on runners that cannot.
Expand Down
68 changes: 68 additions & 0 deletions .github/script/install-rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
# Install the Rust toolchain required by the seekdb build (see rust/rust-toolchain.toml).
# Used by .github/actions/setup-rust and CI jobs that run inside Docker containers.
set -euo pipefail

repo_root="${SEEKDB_REPO_ROOT:-${GITHUB_WORKSPACE:-}}"
if [[ -z "$repo_root" ]]; then
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
fi

install_root="${SEEKDB_RUST_INSTALL_ROOT:-${RUNNER_TEMP:-${TMPDIR:-/tmp}}/seekdb-rust}"
export CARGO_HOME="${CARGO_HOME:-$install_root/cargo}"
export RUSTUP_HOME="${RUSTUP_HOME:-$install_root/rustup}"

if ! command -v rustup >/dev/null 2>&1 || ! command -v cargo >/dev/null 2>&1; then
mkdir -p "$install_root" "$CARGO_HOME" "$RUSTUP_HOME"
export PATH="$CARGO_HOME/bin:$PATH"

rustup_init="$install_root/rustup-init.sh"
rustup_init_url="${RUSTUP_INIT_URL:-https://sh.rustup.rs}"
if command -v curl >/dev/null 2>&1; then
curl --proto '=https' --tlsv1.2 --retry 3 --fail --silent \
--show-error --location "$rustup_init_url" --output "$rustup_init"
elif command -v wget >/dev/null 2>&1; then
wget --tries=3 --quiet -O "$rustup_init" "$rustup_init_url"
else
echo "install-rust: curl or wget is required" >&2
exit 1
fi
sh "$rustup_init" -y --profile minimal --default-toolchain none --no-modify-path
fi

export CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"
export RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}"
rustup_bin_dir="$(dirname "$(command -v rustup)")"
export PATH="$rustup_bin_dir:$PATH"

if [[ "${SEEKDB_CARGO_RSProxy_MIRROR:-}" == "true" ]]; then
mkdir -p "$CARGO_HOME"
cat >> "$CARGO_HOME/config.toml" <<'EOF'
[source.crates-io]
replace-with = "rsproxy-sparse"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
EOF
fi

# The version check triggers rustup's auto-install of the pinned toolchain
# (rust-toolchain.toml). Run it in a subshell: this script is sourced by CI
# steps that call `bash build.sh ...` right afterwards, and the cd must not
# leak into the caller's working directory.
(
cd "$repo_root/rust"
RUSTUP_AUTO_INSTALL=1 cargo --version
rustc --version
)

# Binding-test crates (e.g. unittest/include/rust) have no rust-toolchain.toml
# in their ancestor chain, so with --default-toolchain none (above) a bare
# `cargo` there fails: "no default is configured". Pin the default to the
# workspace's pinned channel, read from rust-toolchain.toml so the version
# stays in one place.
pinned_channel="$(sed -n 's/^channel = "\(.*\)"/\1/p' "$repo_root/rust/rust-toolchain.toml" | head -n 1)"
if [[ -z "$pinned_channel" ]]; then
echo "install-rust: failed to read channel from $repo_root/rust/rust-toolchain.toml" >&2
exit 1
fi
rustup default "$pinned_channel"
Loading
Loading