Skip to content

ci: analyze dead code with the pinned DuckDB build tag - #536

Merged
vishr merged 1 commit into
mainfrom
ci/deadcode-static-lib-tag
Dec 3, 2026
Merged

vishr merged 1 commit into
mainfrom
ci/deadcode-static-lib-tag

Conversation

@vishr

@vishr vishr commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

What changed

The Go dead-code check now analyzes the same build every other job compiles.

deadcode passes its own empty -tags to go list. A command-line flag overrides GOFLAGS, so the duckdb_use_static_lib tag that scripts/with-duckdb.sh exports was dropped. The check analyzed a build nothing else compiles. On Linux that build needs one single-threaded ld link against the DuckDB static archives, cached only when the Static checks job happens to save the shared Go cache.

Since go.sum changed on 2026-12-01 the cache has not held that link, and go-deadcode went from 14 seconds to between 5 and 9 minutes in CI. That made Static checks the slowest job, at 10 to 16 minutes.

scripts/go-deadcode.mjs now passes -tags=duckdb_use_static_lib.

Verification

  • Linux container (golang:1.27.4, 4 CPUs, empty Go cache): go tool deadcode took 681 s before and 6 s after, with the same single allowlisted finding.

  • bun test scripts/dead-code-gates.test.ts: 15 pass.

  • node scripts/go-deadcode.mjs: passes locally.

  • just check

  • just test-race when auth, API, ingest, query, MCP, or agent paths changed

  • User-facing behavior and configuration docs are current

  • No credentials, private telemetry, host details, or enterprise-only source are included

  • API, migration, ingest, MCP/AG-UI, or release-contract changes are called out

  • Breaking or batch-format changes carry ! in the title, for the release's upgrade notes

just check was not run in full locally; CI runs it.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated the configuration used for dead-code analysis to include the DuckDB static-library build tag. Analysis now uses the same relevant build setting as Linux linking, improving consistency in the results.

deadcode passes its own empty -tags to go list, which overrides the
duckdb_use_static_lib tag that scripts/with-duckdb.sh exports in GOFLAGS.
The check therefore analyzed a build no other job compiles, and on Linux
that build needs a single-threaded link against the DuckDB static
archives. When the shared Go cache lacked that link the check took 5 to
11 minutes instead of seconds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Deadcode Build Tags

Layer / File(s) Summary
Set deadcode build tag
scripts/go-deadcode.mjs
The command explicitly passes -tags=duckdb_use_static_lib. Comments document how the command’s tags interact with the wrapper’s GOFLAGS tags.

Change: Bug fix

Merge Risk: Minimal · up to 96780

This change makes the dead-code check analyze the same DuckDB static-library build that other jobs compile, which avoids a very slow link on Linux. No concrete merge-blocking risk was identified.

Architecture risk: Low · up to 96780

The deadcode wrapper now explicitly selects the DuckDB static-library build tag, rather than relying on tags inherited through GOFLAGS.

The wrapper now supplies the DuckDB static-library tag to the deadcode command, which uses that command-local tag even when wrapper GOFLAGS contains other tags.

Changed areas: scripts

Review details

Systems and components

  • observed — 1 changed file mapped to scripts.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db48b62e-0ca4-440c-9424-d4216066c665
Commits

Reviewing files that changed from the base of the PR and between 39b5fa8 and 96780b0.

Files selected for processing: 1

  • scripts/go-deadcode.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@vishr
vishr enabled auto-merge December 3, 2026 16:50
@vishr vishr closed this Dec 3, 2026
auto-merge was automatically disabled December 3, 2026 17:08

Pull request was closed

@vishr vishr reopened this Dec 3, 2026
@vishr
vishr enabled auto-merge December 3, 2026 17:10
@vishr
vishr added this pull request to the merge queue Dec 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2026
@vishr
vishr added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 3fde06b Dec 3, 2026
60 checks passed
@vishr
vishr deleted the ci/deadcode-static-lib-tag branch December 3, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant