Skip to content

fix(self-update): add missing functions to self_update stub#6502

Merged
jdx merged 2 commits into
mainfrom
fix/self-update-stub-missing-functions
Oct 1, 2025
Merged

fix(self-update): add missing functions to self_update stub#6502
jdx merged 2 commits into
mainfrom
fix/self-update-stub-missing-functions

Conversation

@jdx

@jdx jdx commented Oct 1, 2025

Copy link
Copy Markdown
Owner

Summary

  • Add upgrade_instructions_text() and append_self_update_instructions() to the self_update stub module
  • Fixes compilation errors when building without the self_update feature

Problem

MacPorts builds mise with:

cargo install mise --no-default-features --features native-tls,vfox/vendored-lua

This fails with compilation errors because the stub file src/cli/self_update_stub.rs was missing functions that are called from other parts of the codebase:

  • src/cli/doctor/mod.rs:192
  • src/cli/version.rs:129
  • src/config/mod.rs:489
  • src/config/mod.rs:498

Solution

Added the missing functions to the stub implementation:

  • upgrade_instructions_text() - returns None (no upgrade instructions)
  • append_self_update_instructions() - returns the message unchanged (no-op)

Test plan

  • Verified compilation succeeds with cargo check --no-default-features --features native-tls,vfox/vendored-lua
  • Build completes successfully (only warnings about unused statics, which is expected)

🤖 Generated with Claude Code


Note

Adds upgrade_instructions_text and append_self_update_instructions to the self-update stub, including TOML-based instruction parsing from env::MISE_SELF_UPDATE_INSTRUCTIONS.

  • CLI — src/cli/self_update_stub.rs:
    • Add upgrade_instructions_text() to read upgrade instructions from env::MISE_SELF_UPDATE_INSTRUCTIONS (TOML parsed via read_instructions_file).
      • Introduce InstructionsToml and read_instructions_file() to parse message or first command from the TOML.
    • Add append_self_update_instructions(message) to append retrieved instructions to a message.
    • Keep SelfUpdate::is_available() returning false.

Written by Cursor Bugbot for commit 47b687f. This will update automatically on new commits. Configure here.

Add `upgrade_instructions_text()` and `append_self_update_instructions()`
to the self_update stub module to fix compilation errors when building
without the self_update feature.

This fixes the MacPorts build which uses:
`cargo install mise --no-default-features --features native-tls,vfox/vendored-lua`

Fixes compilation errors in:
- src/cli/doctor/mod.rs:192
- src/cli/version.rs:129
- src/config/mod.rs:489
- src/config/mod.rs:498

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings October 1, 2025 12:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Fixes compilation errors when building mise without the self_update feature by adding missing function stubs. This ensures MacPorts and other builds that exclude self-update functionality can compile successfully.

  • Add upgrade_instructions_text() stub function that returns None
  • Add append_self_update_instructions() stub function that returns the input message unchanged

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Update the stub to properly read upgrade instructions from TOML file
even when self_update feature is disabled. This ensures package managers
like MacPorts can still provide custom upgrade instructions to users.

Changes:
- Moved InstructionsToml struct and read_instructions_file() to stub
- Implemented full logic for upgrade_instructions_text()
- Updated append_self_update_instructions() to append instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
}
}
None
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Stub Function Performs Unnecessary I/O Operations

The upgrade_instructions_text() function in the self_update_stub module reads and parses a TOML file. As a stub for a disabled feature, it's expected to be a no-op and return None directly. This current behavior introduces unnecessary file I/O and TOML parsing dependencies, potentially leading to runtime errors when the self_update feature is not enabled.

Fix in Cursor Fix in Web

@jdx jdx changed the title fix(cli): add missing functions to self_update stub fix(self-update): add missing functions to self_update stub Oct 1, 2025
@jdx jdx enabled auto-merge (squash) October 1, 2025 12:05
@github-actions

github-actions Bot commented Oct 1, 2025

Copy link
Copy Markdown

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.9.25 x -- echo 19.4 ± 0.2 19.0 21.8 1.11 ± 0.02
mise x -- echo 17.5 ± 0.3 17.1 19.1 1.00
✅ Performance improvement for x -- echo is 11%

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.9.25 env 18.9 ± 0.3 18.4 21.4 1.11 ± 0.03
mise env 17.1 ± 0.4 16.5 21.1 1.00
✅ Performance improvement for env is 11%

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.9.25 hook-env 18.5 ± 0.2 18.1 19.4 1.11 ± 0.03
mise hook-env 16.7 ± 0.4 16.2 21.1 1.00
✅ Performance improvement for hook-env is 11%

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.9.25 ls 16.6 ± 0.2 16.1 17.6 1.13 ± 0.04
mise ls 14.7 ± 0.5 14.1 21.1 1.00
✅ Performance improvement for ls is 13%

xtasks/test/perf

Command mise-2025.9.25 mise Variance
install (cached) 166ms ✅ 102ms +62%
ls (cached) 64ms 63ms +1%
bin-paths (cached) 70ms 69ms +1%
task-ls (cached) 463ms 474ms -2%

✅ Performance improvement: install cached is 62%

@jdx jdx disabled auto-merge October 1, 2025 12:19
@jdx jdx merged commit 3a49472 into main Oct 1, 2025
26 of 27 checks passed
@jdx jdx deleted the fix/self-update-stub-missing-functions branch October 1, 2025 12:19
@jdx jdx mentioned this pull request Oct 1, 2025
jdx added a commit that referenced this pull request Oct 1, 2025
### 📦 Registry

- add code by @TyceHerrman in
[#6492](#6492)

### 🚀 Features

- change idiomatic_version_file to default disabled by @jdx in
[#6501](#6501)

### 🐛 Bug Fixes

- **(self-update)** add missing functions to self_update stub by @jdx in
[#6502](#6502)
- **(set)** allow --prompt flag to work with `mise set` by @jdx in
[#6485](#6485)

### 📚 Documentation

- **(hooks)** clarify pre/post-install hooks description. by @minusfive
in [#6497](#6497)
- remove link to issue by @jdx in
[e13d980](e13d980)

### 🧪 Testing

- **(e2e)** remove deprecated MISE_LEGACY_VERSION_FILE assertions by
@jdx in [#6505](#6505)

### New Contributors

- @minusfive made their first contribution in
[#6497](#6497)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Bumps project to v2025.10.0, updates changelog, packaging/docs, and
completion spec filenames.
> 
> - **Release/Versioning**:
> - Bump version to `2025.10.0` in `Cargo.toml`, `Cargo.lock`,
`default.nix`, `packaging/rpm/mise.spec`.
> - **Documentation**:
>   - Update `README.md` quickstart version output.
> - Add `2025.10.0` entry to `CHANGELOG.md` with registry, features,
fixes, docs, tests, and contributors.
> - **Shell Completions**:
> - Update cached spec filenames to
`usage__usage_spec_mise_2025_10_0.spec` in `completions/_mise`,
`completions/mise.bash`, `completions/mise.fish`.}
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
28930cf. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <release@mise.jdx.dev>
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.

2 participants