Adding jcode to official Homebrew Core: support build feature to disable self-updates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 19.9k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 30
Description
Hi @1jehuang,
I'm currently preparing a Pull Request to submit jcode to official [Homebrew Core](https://github.com/Homebrew/homebrew-core).
Homebrew's acceptance policy requires that CLI tools packaged in Core do not attempt to self-update (neither via background auto-updates nor manual update commands), as package managers handle binary integrity, sandboxing, and version upgrades directly via brew upgrade.
Current Workaround in the Formula
In our formula, we currently apply two small inreplace patches during the build step:
- Disable default background auto-update (
src/cli/args.rs):
// Changes default_value from "true" to "false"
#[arg(long, global = true, default_value = "false")]
pub(crate) auto_update: bool,
- Redirect manual
jcode updateto Homebrew (src/cli/dispatch.rs):
// Prints a notice instead of downloading binaries
eprintln!("Please update jcode using: brew upgrade jcode");
Proposed Upstream Solutions
To make packaging cleaner and avoid source patches across downstream package managers (Homebrew, Arch AUR, Nixpkgs, Alpine, etc.), would you be open to introducing an upstream compile-time switch?
A few common approaches:
- Option 1: A Cargo feature (Recommended)
Makeself-updatea default feature inCargo.toml:
[features]
default = ["pdf", "embeddings", "bedrock", "self-update"]
self-update = []
When self-update is disabled:
-
--auto-updatedefaults tofalse. -
jcode updateinforms the user that updates are managed by their package manager. -
Option 2: A compile-time environment variable
Checkoption_env!("JCODE_DISABLE_SELF_UPDATE")during compilation.
This is a standard pattern used by tools in Homebrew Core (such as mise, pixi, and rustup).
Thanks for building jcode! Let me know what you think.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Cargo.toml, src/cli/args.rs, and src/cli/dispatch.rs to understand the existing feature configuration, auto-update default, and update command. Resolve which compile-time switch the project will support, then verify that disabling it prevents self-updates and directs users to their package manager.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100