From ec87400463f34744adb82b76bc785220daadca6c Mon Sep 17 00:00:00 2001 From: "tbhb.dev Agent" Date: Mon, 23 Nov 2026 04:43:19 -0500 Subject: [PATCH] ci(go): compile the Go analysis driver Generated-by: LLM harness=codex;model=openai:gpt-6.2-sol Generated-by: LLM effort=high;harness=codex:0.171.0;model=openai:gpt-6.2-sol;session=sha-256-64:0cf977f160699318;surface=exec --- .github/renovate.json5 | 4 +--- .github/workflows/ci.yml | 5 +++++ go/e2e/smoke/BUILD.bazel | 7 +++++++ go/tests/BUILD.bazel | 7 +++++++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 47dce2c9..e30af377 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -60,9 +60,7 @@ enabled: false, }, { - // rules_go 0.65.0 compiles nogo against the shared x/tools. - // v0.53.0 changed facts.NewDecoder. Lift this rule once a rules_go - // release supports it. + // Rule: Lift this cap when rules_go ships nogo support for x/tools 0.53. description: "golang.org/x/tools stays below v0.53 until rules_go supports it", matchManagers: ["gomod"], matchPackageNames: ["golang.org/x/tools"], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d70db355..929ef7a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -262,6 +262,11 @@ jobs: sysctl kern.maxfiles kern.maxfilesperproc 2>&1 || true ulimit -a || true + - name: Build the Go nogo smoke target + if: matrix.workspace.id == 'go-smoke' + working-directory: ${{ matrix.workspace.dir }} + run: bazelisk build --config=ci //:nogo_smoke + - name: Test working-directory: ${{ matrix.workspace.dir }} run: | diff --git a/go/e2e/smoke/BUILD.bazel b/go/e2e/smoke/BUILD.bazel index ec46305f..a9def8e0 100644 --- a/go/e2e/smoke/BUILD.bazel +++ b/go/e2e/smoke/BUILD.bazel @@ -3,6 +3,7 @@ load("@bazel_skylib//rules:diff_test.bzl", "diff_test") load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "nogo") load("@tbhb_rules//format:defs.bzl", "format_test") load("@tbhb_rules//repo:defs.bzl", "repo_files") load("@tbhb_rules//testing:defs.bzl", "expect_failure_test") @@ -28,6 +29,12 @@ gazelle(name = "gazelle") repo_files() +# Compile the rules_go nogo driver against the shared x/tools version. +nogo( + name = "nogo_smoke", + deps = ["@tbhb_rules_go//tests:nogo_inspect"], +) + exports_files([ ".golangci.yml", "go.mod", diff --git a/go/tests/BUILD.bazel b/go/tests/BUILD.bazel index ac6f2c78..0e3d3117 100644 --- a/go/tests/BUILD.bazel +++ b/go/tests/BUILD.bazel @@ -4,3 +4,10 @@ load("@tbhb_rules//repo:defs.bzl", "repo_files") repo_files() + +# The smoke consumer uses the analyzer from this module's Go dependency graph. +alias( + name = "nogo_inspect", + actual = "@org_golang_x_tools//go/analysis/passes/inspect", + visibility = ["//visibility:public"], +)