Skip to content

feat(cli): add auto-update Cargo feature#675

Open
salim-b wants to merge 1 commit intostakpak:mainfrom
salim-b:toggle-auto-update
Open

feat(cli): add auto-update Cargo feature#675
salim-b wants to merge 1 commit intostakpak:mainfrom
salim-b:toggle-auto-update

Conversation

@salim-b
Copy link
Copy Markdown

@salim-b salim-b commented Mar 28, 2026

Add a new auto-update Cargo feature (default enabled) that controls whether the stakpak update subcommand and all auto-update behavior is compiled. When disabled, the update subcommand is removed from the CLI entirely, startup auto-update prompts are skipped, and forced auto-update in ACP mode is disabled.

This allows to cleanly disable stakpak's self-update mechanism at build time for distribution channels where the feature is not wanted or can't possibly work.

Usage

# Default (auto-update enabled, unchanged behavior)
cargo build

# Disable the auto-update feature
cargo build --no-default-features --features bedrock

Co-authored-by: Copilot copilot@github.com

@salim-b salim-b changed the title feat: add auto-update Cargo feature feat(cli): add auto-update Cargo feature Mar 28, 2026
@shehab299
Copy link
Copy Markdown
Collaborator

shehab299 commented Apr 8, 2026

So did you actually check if this PR works in the first place? because It doesn't
you clearly didn't test it so I will close it and you open it when you work on it

@shehab299 shehab299 closed this Apr 8, 2026
@shehab299 shehab299 reopened this Apr 8, 2026
@shehab299 shehab299 closed this Apr 8, 2026
@salim-b
Copy link
Copy Markdown
Author

salim-b commented Apr 8, 2026

So did you actually check if this PR works in the first place?

Yes, I've tested that it a) successfully builds both with the new auto-update feature enabled and disabled and b) that stakpak update continues to work when it was enabled during build.

because It doesn't

Could you elaborate a bit more on what exactly is broken by this PR?

so I will close it and you open it when you work on it

I don't have the rights to reopen the PR.

@salim-b
Copy link
Copy Markdown
Author

salim-b commented Apr 18, 2026

@shehab299 My comment above still stands. Could we re-open this?

@shehab299 shehab299 reopened this Apr 18, 2026
@shehab299
Copy link
Copy Markdown
Collaborator

I have built it myself and tested it still the ui for autoupdate shows up and it actually tries to update because the feature flag isn't applied to all places

Add a new `auto-update` Cargo feature (default enabled) that controls
whether the `stakpak update` subcommand and all auto-update behavior
is compiled. When disabled, the `update` subcommand is removed from the
CLI entirely, startup auto-update prompts are skipped, and forced
auto-update in ACP mode is disabled.

Co-authored-by: Copilot <copilot@github.com>
@salim-b salim-b force-pushed the toggle-auto-update branch from 7c5e3a4 to 62b521e Compare April 18, 2026 11:07
@salim-b
Copy link
Copy Markdown
Author

salim-b commented Apr 18, 2026

I have built it myself and tested it still the ui for autoupdate shows up and it actually tries to update because the feature flag isn't applied to all places

I've rebased onto latest main and tested again: It works as supposed for me and I think all the relevant places are gated by the feature flag.

To test with the auto-update feature enabled I've built/installed with:

cargo install --locked --no-track --bins --features jemalloc --path cli

To test with the feature disabled I've built/installed with:

cargo install --locked --no-track --bins --no-default-features --features bedrock,jemalloc --path cli

stakpak update seems to properly work in the first build. And stakpak update is not available in the second build (but it doesn't fail with an "unknown subcommand" error or the like and instead just starts the initial onboarding TUI – same as when we run e.g. stakpak notarealsubcmd).

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.

3 participants