//scripts:scripts_test and //scripts/check-versions:check-versions_test drop their host-tools/no-remote-exec/no-remote-cache tags and run on the rbe-west workers like every other target (the worker image ships bash, git, python3, jq, yq, curl, openssl, unzip and coreutils; a missing tool fails the test under Bazel rather than skipping it). Go comes in hermetically as the registered SDK; check-versions.sh's `go build` is stood in for by the Bazel-built checker. The tests that walked the source checkout now get it as data: tools/bazel/go_srcs.py keeps a managed `repo_files` filegroup in every package and aggregates them into //:repo_files (exactly the tracked files Bazel can see; make bazel-sync-check fails on a package without one). scripts_test and docsync_test take it instead of hand-listed filegroups, and every TEST_SRCDIR/IsBazel skip and go-test-only block in them is gone. The release formula under .bazelignore'd .beads/ comes in through a @beads_formulas local repository; npm-package/ and .claude/ are visible to Bazel again (only their node_modules/worktrees stay ignored), so the npm manifest release check and the AGENTS.md skill links run under Bazel too. TestZZStdioNotLeaked falls back to TestMain's pre-run streams instead of skipping in a shard without its baseline. tools/bazel/equivalence_allowlist.txt shrinks from 20 skip entries to the two cmd/bd tests of plain go test's own bd build fallback, which Bazel never takes; pr-preflight-platforms now runs them on Linux, macOS and Windows. The scripts-go-checks scripts-test and allowlisted legs, their scripts (scripts-go-test.sh, allowlisted-go-tests.sh, run_allowlisted_go_tests.py) and main.yml's --compile-only warm for them are removed. The vet leg stays (ga-96smfk.18). Refs: ga-96smfk.16 Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
93 lines
4.2 KiB
Python
93 lines
4.2 KiB
Python
module(
|
|
name = "beads",
|
|
version = "0.0.0",
|
|
)
|
|
|
|
bazel_dep(name = "platforms", version = "1.1.0")
|
|
bazel_dep(name = "rules_go", version = "0.63.0")
|
|
bazel_dep(name = "gazelle", version = "0.53.0")
|
|
bazel_dep(name = "rules_shell", version = "0.6.1")
|
|
|
|
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
|
|
go_sdk.download(
|
|
name = "go_sdk",
|
|
version = "1.26.7",
|
|
)
|
|
use_repo(go_sdk, "go_sdk")
|
|
|
|
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
|
|
go_deps.from_file(go_mod = "//:go.mod")
|
|
|
|
# beads builds go-mysql-server with its stdlib-regex backend (ICU policy):
|
|
# gazelle must see gms_pure_go as satisfied so it selects regex_pure.go and
|
|
# drops the go-icu-regex (libicu, cgo) edge entirely.
|
|
go_deps.gazelle_override(
|
|
directives = [
|
|
"gazelle:build_tags gms_pure_go",
|
|
"gazelle:exclude internal/regex/regex_cgo.go",
|
|
],
|
|
path = "github.com/dolthub/go-mysql-server",
|
|
)
|
|
go_deps.module_override(
|
|
patch_strip = 1,
|
|
patches = ["//third_party/patches:eventsapi_schema_build.patch"],
|
|
path = "github.com/dolthub/eventsapi_schema",
|
|
)
|
|
go_deps.module_override(
|
|
patch_strip = 1,
|
|
patches = ["//third_party/patches:flatbuffers_v23_importpath.patch"],
|
|
path = "github.com/dolthub/flatbuffers/v23",
|
|
)
|
|
go_deps.module_override(
|
|
patch_strip = 1,
|
|
patches = ["//third_party/patches:dolt_go_serial.patch"],
|
|
path = "github.com/dolthub/dolt/go",
|
|
)
|
|
|
|
# Pure-Go stubs so --config=pure can compile dolt's store/nbs (see the patch).
|
|
go_deps.module_override(
|
|
patch_strip = 1,
|
|
patches = ["//third_party/patches:gozstd_nocgo.patch"],
|
|
path = "github.com/dolthub/gozstd",
|
|
)
|
|
use_repo(go_deps, "com_github_anthropics_anthropic_sdk_go", "com_github_burntsushi_toml", "com_github_cenkalti_backoff_v4", "com_github_charmbracelet_x_ansi", "com_github_data_dog_go_sqlmock", "com_github_dolthub_dolt_go", "com_github_dolthub_driver_v2", "com_github_dolthub_eventkit", "com_github_dolthub_go_mysql_server", "com_github_dolthub_vitess", "com_github_go_sql_driver_mysql", "com_github_google_uuid", "com_github_gowebpki_jcs", "com_github_invopop_jsonschema", "com_github_johanneskaufmann_html_to_markdown_v2", "com_github_mattn_go_sqlite3", "com_github_microcosm_cc_bluemonday", "com_github_oapi_codegen_oapi_codegen_v2", "com_github_olebedev_when", "com_github_spf13_cobra", "com_github_spf13_pflag", "com_github_spf13_viper", "com_github_stretchr_testify", "com_github_subosito_gotenv", "com_github_testcontainers_testcontainers_go", "com_github_testcontainers_testcontainers_go_modules_dolt", "com_github_yuin_goldmark", "in_gopkg_yaml_v3", "io_opentelemetry_go_otel", "io_opentelemetry_go_otel_exporters_otlp_otlpmetric_otlpmetrichttp", "io_opentelemetry_go_otel_exporters_stdout_stdoutmetric", "io_opentelemetry_go_otel_exporters_stdout_stdouttrace", "io_opentelemetry_go_otel_metric", "io_opentelemetry_go_otel_sdk", "io_opentelemetry_go_otel_sdk_metric", "io_opentelemetry_go_otel_trace", "io_rsc_script", "land_charm_glamour_v2", "land_charm_huh_v2", "land_charm_lipgloss_v2", "org_golang_x_mod", "org_golang_x_net", "org_golang_x_sync", "org_golang_x_sys", "org_golang_x_term")
|
|
|
|
# Hermetic Dolt CLI for tests (tools/bazel/dolt.bzl pins the release to
|
|
# scripts/ci/install-dolt.sh). //tools/bazel:dolt selects the repository for
|
|
# the execution platform, so only that tarball is downloaded.
|
|
dolt_release = use_repo_rule("//tools/bazel:dolt.bzl", "dolt_release")
|
|
|
|
dolt_release(
|
|
name = "dolt_linux_amd64",
|
|
platform = "linux-amd64",
|
|
)
|
|
|
|
dolt_release(
|
|
name = "dolt_linux_arm64",
|
|
platform = "linux-arm64",
|
|
)
|
|
|
|
dolt_release(
|
|
name = "dolt_darwin_amd64",
|
|
platform = "darwin-amd64",
|
|
)
|
|
|
|
dolt_release(
|
|
name = "dolt_darwin_arm64",
|
|
platform = "darwin-arm64",
|
|
)
|
|
|
|
# The tracked release formula, for //scripts:scripts_test. .beads/ also holds
|
|
# live bd data and is in .bazelignore, so no main-repo target can declare the
|
|
# formula; this local repository exposes only .beads/formulas.
|
|
new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
|
|
|
|
new_local_repository(
|
|
name = "beads_formulas",
|
|
build_file_content = """exports_files(
|
|
glob(["*.formula.toml"]),
|
|
visibility = ["@@//scripts:__pkg__"],
|
|
)
|
|
""",
|
|
path = ".beads/formulas",
|
|
)
|