mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-13 22:26:53 +00:00
Package the standalone lancedb CLI with every stable and beta GitHub release. Publish archives for Linux x86_64, Linux ARM64, and Apple Silicon macOS, along with SHA-256 checksums, licenses, and third-party notices. Synchronize the CLI version with the SDKs and validate that release tags match both manifests. Add PR and manual packaging dry runs, runtime compatibility checks, and smoke tests of extracted executables. GitHub release creation now waits for all three archives to pass validation; SDK registry publishing remains independent. Update installation instructions and the release checklist. Linux binaries target glibc 2.28, retaining existing x86_64 CPU requirements; macOS binaries target macOS 14 or newer.
66 lines
2.3 KiB
Python
66 lines
2.3 KiB
Python
import os
|
|
import subprocess
|
|
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
SCRIPT = Path(__file__).resolve().parents[1] / "build_cli_linux.sh"
|
|
|
|
|
|
class BuildCliLinuxTest(unittest.TestCase):
|
|
def test_toolchain_failures_stop_before_downloads_and_cargo(self):
|
|
# Start with controlled tools so the host's compilers cannot mask a
|
|
# missing container dependency. No command can download or build code.
|
|
for failed_tool, exit_code in (
|
|
("dnf", 42),
|
|
("clang", 127),
|
|
("clang++", 127),
|
|
("ld.lld", 127),
|
|
):
|
|
with (
|
|
self.subTest(failed_tool=failed_tool),
|
|
tempfile.TemporaryDirectory() as tmp,
|
|
):
|
|
workdir = Path(tmp)
|
|
bin_dir = workdir / "bin"
|
|
bin_dir.mkdir()
|
|
log = workdir / "commands.log"
|
|
for name in (
|
|
"dnf",
|
|
"clang",
|
|
"clang++",
|
|
"ld.lld",
|
|
"git",
|
|
"curl",
|
|
"cargo",
|
|
):
|
|
status = exit_code if name == failed_tool else 0
|
|
if name in ("git", "curl", "cargo"):
|
|
status = 99
|
|
command = bin_dir / name
|
|
command.write_text(
|
|
f'#!/bin/sh\necho "{name}" >> "$CLI_TEST_LOG"\nexit {status}\n'
|
|
)
|
|
command.chmod(0o755)
|
|
env = dict(os.environ, PATH=str(bin_dir), CLI_TEST_LOG=str(log))
|
|
result = subprocess.run(
|
|
["/bin/bash", str(SCRIPT)],
|
|
check=False,
|
|
cwd=workdir,
|
|
env=env,
|
|
capture_output=True,
|
|
text=True,
|
|
timeout=10,
|
|
)
|
|
self.assertEqual(result.returncode, exit_code, result.stderr)
|
|
commands = log.read_text().splitlines()
|
|
self.assertEqual(commands[0], "dnf")
|
|
self.assertEqual(commands[-1], failed_tool)
|
|
self.assertNotIn("git", commands)
|
|
self.assertNotIn("curl", commands)
|
|
self.assertNotIn("cargo", commands)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|