Skip to content

fix(brew): add rust + pkgconf as build-time deps in formula template#49

Merged
lukeocodes merged 1 commit intomainfrom
fix/template-rust-build-dep
May 1, 2026
Merged

fix(brew): add rust + pkgconf as build-time deps in formula template#49
lukeocodes merged 1 commit intomainfrom
fix/template-rust-build-dep

Conversation

@lukeocodes
Copy link
Copy Markdown
Member

Summary

Companion to the live-formula fix in deepgram/homebrew-tap. Adds the same two build-time deps to the formula template here, so the next root `v*` release's auto-bump preserves the fix instead of regressing.

What's broken

`brew install deepgram/tap/deepgram` is currently failing for every user during the `cryptography` and `pydantic_core` source builds. Both packages compile Rust extensions via `maturin`, and Homebrew's `Language::Python::Virtualenv` defaults to `--no-binary :all:` (forces source builds for security/reproducibility), so the precompiled PyPI wheels are bypassed and the Rust toolchain has to be available during the build.

The companion tap PR fixes the live formula. Without this template change, the next time `scripts/bump_brew_formula.py` regenerates the formula (i.e. on the next deepctl release), it would wipe the `depends_on "rust"` lines and re-break every install.

Fix

Two new lines in `scripts/templates/deepgram.rb.template`:

depends_on \"pkgconf\" => :build
depends_on \"rust\" => :build

Matches the exact pattern `homebrew-core`'s Aider uses (Aider is the closest precedent — same `Language::Python::Virtualenv` pattern, same `pydantic-core` resource). Several other homebrew-core formulas (ansible, azure-cli, aws-elasticbeanstalk, etc.) use the same fix.

Both deps are `=> :build` — build-time only, not runtime. No install bloat for end users.

Verification

$ python scripts/bump_brew_formula.py --version 0.2.18 --dry-run | grep depends_on | head -10
  depends_on \"pkgconf\" => :build
  depends_on \"rust\" => :build
  depends_on \"ffmpeg\"
  depends_on \"portaudio\"
  depends_on \"python@3.13\"

The dry-run output now includes both build deps in the right alphabetical position (build deps before runtime deps, alphabetical within each section per `brew style`).

The full diff against the live tap formula is larger than just these two lines because PyPI churn since the original generation has bumped several transitive dep versions (deepctl-core 0.2.8 → 0.2.9 with the plugin warning shipped in v0.2.19, listen 0.0.9 → 0.0.10, mcp 0.1.12 → 0.1.13, typer 0.25.0 → 0.25.1, plus a new deepgram-mcp resource). All of those will land naturally on the next auto-bump and are unrelated to this fix.

Pre-existing comments / docstrings

The new comment block above `depends_on "pkgconf"` is necessary — without it, a future "lean dependencies" refactor would correctly think "there's no Rust code in this Python project, why is rust here?" and remove the lines. Same silent-breakage failure mode as the auto-generated banner. Matches every other `depends_on` in the template which already has rationale comments.

Fixes brew install deepgram/tap/deepgram failing during the cryptography
and pydantic_core source builds. Both packages compile Rust extensions
via maturin during install, but Language::Python::Virtualenv defaults
to --no-binary :all: so the precompiled wheels are bypassed and the
Rust toolchain has to be available during the build.

Adds the same two build-time deps homebrew-core's Python virtualenv
formulas use for this exact case (Aider, ansible, azure-cli, etc.):

  depends_on "pkgconf" => :build
  depends_on "rust" => :build

This is the template change. The live formula in deepgram/homebrew-tap
is patched in a companion PR to fix users today; this template change
ensures that on the next root v* release, the auto-bump regenerates
the formula with the rust + pkgconf deps still present (the live fix
would otherwise be wiped by the next regeneration).

Verified via 'python scripts/bump_brew_formula.py --version 0.2.18
--dry-run': new depends_on lines appear at lines 19-20, in the right
alphabetical position before the runtime ffmpeg/portaudio/python@3.13
entries.
@lukeocodes lukeocodes merged commit 82dd473 into main May 1, 2026
38 checks passed
@lukeocodes lukeocodes deleted the fix/template-rust-build-dep branch May 1, 2026 23:37
@github-actions github-actions Bot mentioned this pull request May 1, 2026
lukeocodes added a commit that referenced this pull request May 2, 2026
## Summary

Four workflows in this repo (\`sweep.yml\`,
\`auto-close-duplicates.yml\`, \`backfill-duplicate-comments.yml\`,
\`issue-lifecycle-comment.yml\`) were copied from
[anthropics/claude-code](https://github.com/anthropics/claude-code) but
**without their backing scripts**. The workflows have been silently
failing on every run with \`error: Module not found './scripts/<X>.ts'\`
(or the bun equivalent).

This PR adds the missing scripts.

## What lands

| File | Source | Localization |
|---|---|---|
| \`scripts/sweep.ts\` |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/sweep.ts)
| \`NEW_ISSUE\` points at \`deepgram/cli/issues/new/choose\` |
| \`scripts/auto-close-duplicates.ts\` |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/auto-close-duplicates.ts)
| Default owner/repo fall back to \`deepgram/cli\`; removed \"Generated
with Claude Code\" attribution from the auto-close comment (it's a
workflow, not a model-generated message) |
| \`scripts/backfill-duplicate-comments.ts\` |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/backfill-duplicate-comments.ts)
| **Real fix**: replaced hardcoded \`owner='anthropics' /
repo='claude-code'\` with parsing from \`GITHUB_REPOSITORY\` env var
(auto-set by Actions). Upstream was implicitly assuming the script only
ever runs in their repo. |
| \`scripts/lifecycle-comment.ts\` |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/lifecycle-comment.ts)
| Verbatim |
| \`scripts/issue-lifecycle.ts\` (helper) |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/issue-lifecycle.ts)
| \"Claude Code\" → \"Deepgram CLI\"; support URL repointed to
\`developers.deepgram.com\`; \`claude --version\` → \`dg --version\` |
| \`scripts/gh.sh\` (helper) |
[upstream](https://github.com/anthropics/claude-code/blob/main/scripts/gh.sh)
| Error message example updated to \`deepgram/cli\` |

## Workflow drift check (per the CTO's request)

All four workflow YAMLs in \`.github/workflows/\` are **byte-identical
to their upstream counterparts** except for intentional security
hardening — actions are pinned to specific commit SHAs
(\`actions/checkout@34e1148... # v4\`) instead of version tags. No other
drift, no other changes needed in the workflow YAMLs themselves as part
of this PR.

| Workflow | Drift |
|---|---|
| \`sweep.yml\` | SHA pinning only |
| \`auto-close-duplicates.yml\` | SHA pinning only |
| \`backfill-duplicate-comments.yml\` | SHA pinning only |
| \`issue-lifecycle-comment.yml\` | SHA pinning only |

## Verification

- \`bun build --target=bun\` compiles all 5 \`.ts\` files cleanly (no
type errors, no syntax errors)
- \`bash -n scripts/gh.sh\` passes
- \`gh.sh\` marked executable (\`mode 100755\`)
- Imports resolve correctly: \`sweep.ts\` and \`lifecycle-comment.ts\`
import from \`./issue-lifecycle.ts\` ✓

## Things to call out

1. **Labels expected by the scripts** — these scripts read/write the
labels \`invalid\`, \`needs-repro\`, \`needs-info\`, \`stale\`,
\`autoclose\`, and \`duplicate\`. If any are missing from this repo, the
corresponding code path silently no-ops (GitHub API accepts unknown
labels in queries, returns no matches). The existing
\`claude-issue-triage.yml\` and \`claude-dedupe-issues.yml\` workflows
in this repo presumably already use them, but worth verifying once on a
real triage run.

2. **\`STATSIG_API_KEY\` env var in \`auto-close-duplicates.yml\`** —
present in both the local workflow and upstream, but the script doesn't
actually read it. Inherited claude-code-internal noise. I left the
workflow untouched since you asked for a drift check, not a workflow
refactor; happy to drop the line in a follow-up if you want.

3. **Provenance comments** — \`scripts/issue-lifecycle.ts\` carries a
3-line header noting it was borrowed from \`anthropics/claude-code\`.
Other scripts inherit upstream's existing comments verbatim. Strategy:
minimize divergence so future re-borrows are easy diffs.

## Unrelated to the homebrew work

This PR is independent of:
-
[\`deepgram/homebrew-tap#2\`](deepgram/homebrew-tap#2)
(rust + pkgconf build deps fix)
- [\`#49\`](#49)
(template companion to the above)

Those can merge in any order, and this scripts PR is gated only on its
own review.
lukeocodes pushed a commit that referenced this pull request May 3, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>0.2.20</summary>

## [0.2.20](v0.2.19...v0.2.20)
(2026-05-02)


### Bug Fixes

* **brew:** add rust + pkgconf as build-time deps in formula template
([#49](#49))
([82dd473](82dd473))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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