Skip to content

fix(ruby): lock linux and macos platforms when running mise lock on Windows - #14529

Merged
jdx merged 1 commit into
mainfrom
fix/ruby-windows-lock-other-platforms
Oct 16, 2026
Merged

jdx merged 1 commit into
mainfrom
fix/ruby-windows-lock-other-platforms

Conversation

@jdx

@jdx jdx commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

https://entire.io/gh/jdx/mise/trails/782

Follows #14520. On a Windows host, mise lock recorded nothing for ruby on linux-* and macos-* platforms, so refreshing a shared lockfile from Windows still dropped those entries and mise install --locked failed on them. With this change a Windows host produces the same entries a Linux host does:

> mise lock --platform linux-x64,windows-x64   # ruby = "4.0.7"
[[tools.ruby]]
version = "4.0.7"
backend = "core:ruby"
specifiers = ["4.0.7"]

[tools.ruby.options]
compile = "false"
precompiled_url = "jdx/ruby"
ruby_build_repo = "https://github.com/rbenv/ruby-build.git"
ruby_install = "false"

[tools.ruby."platforms.linux-x64"]
checksum = "sha256:..."
url = "https://github.com/jdx/ruby/releases/download/4.0.7-2/ruby-4.0.7.x86_64_linux.tar.gz"
provenance = "github-attestations"

Windows builds compile ruby_windows.rs instead of ruby.rs, so the logic that picks the precompiled archive, verifies its attestation, falls back to the source tarball and computes the lock options only existed in ruby.rs. That logic now lives in a new ruby_lock.rs that both files use; ruby.rs behaves as before. Settings::ruby_compile is no longer Windows-excluded because the shared code reads it.

Together with #14520 this completes #14517.

Tested: the existing ruby unit tests pass on Linux (40), clippy with -D warnings is clean, and cargo check --lib --tests --target x86_64-pc-windows-gnu compiles. A new Windows-only unit test checks the Linux lock options and the empty Windows options from a Windows host. I could not run mise lock on a Windows machine from here.

Fixes #14517.

AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.

🤖 Generated with Claude Code


Note

Medium Risk
Changes cross-platform lockfile generation and Ruby download/attestation resolution paths used during mise lock; behavior on Unix should be a refactor, but Windows lock output for other platforms is newly exercised.

Overview
Windows hosts can now write the same ruby lockfile entries for Linux and macOS that Unix hosts already produced, so refreshing a shared lockfile on Windows no longer drops non-Windows platform blocks and breaks mise install --locked elsewhere.

Lock resolution for precompiled GitHub assets, source tarballs from cache.ruby-lang.org, attestation checks, and lock options (compile, precompiled_url, ruby-build settings, etc.) is extracted into a new ruby_lock module compiled on all platforms. The Unix ruby.rs backend delegates resolve_lockfile_options / resolve_lock_info to shared lock_options / lock_info; ruby_windows.rs does the same instead of returning empty PlatformInfo for non-Windows targets.

Settings::ruby_compile is no longer gated with #[cfg(not(windows))], so the shared lock path can read compile/precompiled settings when locking from Windows.

A Windows-only unit test asserts Linux lock options are populated while Windows targets still get an empty options map.

Reviewed by Cursor Bugbot for commit 6bfa19a. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Improvements
    • Ruby installation lockfiles now resolve platform-appropriate install details across Windows and other supported platforms.
    • Where available, precompiled Ruby packages are selected; source builds can use Ruby source archives with checksum information.
    • Ruby package attestation checks follow the configured verification settings, and enabled checks can report failures.

…indows

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Entire-Checkpoint: 01M52CCJVXBCYCYTX74RSXS7HJ
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2357d380-ab22-4ddb-b021-aaa783afd958
📥 Commits

Reviewing files that changed from the base of the PR and between 530e8d0 and 6bfa19a.

📒 Files selected for processing: 5
  • src/config/settings.rs
  • src/plugins/core/mod.rs
  • src/plugins/core/ruby.rs
  • src/plugins/core/ruby_lock.rs
  • src/plugins/core/ruby_windows.rs
💤 Files with no reviewable changes: 1
  • src/config/settings.rs

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

📝 Walkthrough

Ruby lockfile resolution is moved into a shared module. The Ruby compile setting is available on Windows. The resolver now provides platform-specific lock options and lock info for Windows and other targets, including source archives, precompiled assets, and attestation checks.

Changes: Ruby lockfile resolution

Layer / File(s) Summary
Lock inputs and target selection
src/config/settings.rs, src/plugins/core/mod.rs, src/plugins/core/ruby.rs, src/plugins/core/ruby_lock.rs
The Ruby compile setting is available on all platforms. The new module adds source-index lookup, precompiled selection, platform mapping, and build-revision parsing.
Precompiled artifact resolution
src/plugins/core/ruby.rs, src/plugins/core/ruby_lock.rs
Precompiled release lookup, URL resolution, and GitHub attestation verification are moved into the shared module.
Platform lock integration
src/plugins/core/ruby.rs, src/plugins/core/ruby_lock.rs, src/plugins/core/ruby_windows.rs
Lock-option and lock-info methods delegate to the shared helpers. Windows uses RubyInstaller2 lock info and returns empty lock options. A test checks Linux and Windows lock options.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: risu729, marukome0743

Merge Risk: ⚪ Minimal · up to 6bfa1

Running mise lock on Windows should now record Linux and macOS Ruby entries alongside the Windows entry, so shared lockfiles no longer lose Ruby platform data. No concrete defect was found, and Ruby behavior on other platforms is unchanged. The change appears ready to merge; a quick mise lock run on a Windows machine would confirm it end to end.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 28 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: enabling Ruby Linux and macOS platform entries when running mise lock on Windows.
Linked Issues check Passed Issue #14517 requires Windows mise lock to write Ruby entries for windows-x64 and requested non-Windows targets. src/plugins/core/ruby_lock.rs contains shared target-aware resolution for precomp…
Out of Scope Changes check Passed The changes stay within issue #14517. The new ruby_lock module extracts Ruby lockfile resolution for reuse, the Windows backend uses it for requested targets, Settings::ruby_compile is available t…
Full details: Linked Issues check

Explanation

Issue #14517 requires Windows mise lock to write Ruby entries for windows-x64 and requested non-Windows targets. src/plugins/core/ruby_lock.rs contains shared target-aware resolution for precompiled assets, source archives, checksums, provenance, and lock options. src/plugins/core/ruby_windows.rs delegates both lock methods to this shared implementation. The Windows target keeps empty Ruby build options, while Linux and macOS targets receive the shared options and platform metadata. The added Windows-only test verifies Linux options and empty Windows options. These changes address the issue coding requirements.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #14517. The new ruby_lock module extracts Ruby lockfile resolution for reuse, the Windows backend uses it for requested targets, Settings::ruby_compile is available to the shared Windows lock path, and the tests cover the new behavior. No unrelated change is demonstrated.

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Shares Ruby lockfile code between the Unix and Windows backends. Windows hosts can now record Linux and macOS archives instead of returning empty platform details.

  • Windows lock runs now include Ruby entries for Linux and macOS targets.

Reviews (1) · Last reviewed commit: "fix(ruby): lock linux and macos platform..." · Reviewed by Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Instruction counts

Nothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does.

New, nothing to compare against: env on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, hook-env on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, ls on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, registry on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143, startup on jdx-perf-v1-ubuntu24.04-x64-mise-rust1.97.1-img5263c143

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

6bfa19a9a999 vs 530e8d085dbf · measured on the runner, not pushed to the history.

@jdx
jdx merged commit bd825ed into main Oct 16, 2026
52 of 55 checks passed
@jdx
jdx deleted the fix/ruby-windows-lock-other-platforms branch October 16, 2026 14:08
jdx pushed a commit that referenced this pull request Oct 17, 2026
<!-- entire-trail-link-start -->
https://entire.io/gh/jdx/mise/trails/781
<!-- entire-trail-link-end -->

### 🚀 Features

- **(bootstrap)** template repo url and ref, add clone options by @jdx
in [#14548](#14548)
- **(ls-remote)** list every version range of a registry tool by @jdx in
[#14544](#14544)
- **(registry)** let one backend carry different options per version
range by @jdx in [#14543](#14543)
- **(vfox)** allow a headers table in the PreInstall result by @jdx in
[#14531](#14531)

### 🐛 Bug Fixes

- **(ci)** install zipsign with --locked by @fang2hou in
[#14551](#14551)
- **(github)** install each version with its own request options by
@JamBalaya56562 in [#14537](#14537)
- **(hooks)** run task hooks with mise instead of the initiating tool
shim by @jdx in [#14550](#14550)
- **(install)** keep lockfile resolution when a linked version doesn't
match the request by @jdx in
[#14539](#14539)
- **(java)** skip the catalog fetch when installing a locked build by
@jdx in [#14534](#14534)
- **(lock)** keep other platforms' option variants when mise link
rewrites mise.lock by @jdx in
[#14519](#14519)
- **(ruby)** lock windows platforms when running mise lock on Windows by
@jdx in [#14520](#14520)
- **(ruby)** lock linux and macos platforms when running mise lock on
Windows by @jdx in [#14529](#14529)
- **(rust)** restore the components a toolchain's profile requires by
@JamBalaya56562 in [#14525](#14525)
- **(shim)** keep task lazy tool shims when a task installs another tool
by @jdx in [#14533](#14533)
- **(task)** avoid deadlock when parallel tasks install the same tool by
@jdx in [#14536](#14536)
- **(watch)** exit quietly when watchexec is interrupted with Ctrl+C by
@jdx in [#14541](#14541)

### 📚 Documentation

- say OpenTelemetry export and spinel installs need experimental by
@ZainnQureshii in [#14552](#14552)

### ◀️ Revert

- Revert "chore(deps): pin zipsign-api to 0.2.1" by @jdx in
[baafe33](baafe33)

### 📦️ Dependency Updates

- pin zipsign-api to 0.2.1 by @jdx in
[6d1bd25](6d1bd25)
- rerun providers when mise recreates the venv by @halms in
[#14532](#14532)

### 📦 Registry

- prefer signed xcsift releases and enable Linux by @jdx in
[#14540](#14540)
- install protoc-gen-connect-go v2 from its /v2 module path by @jdx in
[#14545](#14545)

### Chore

- **(release)** pin zipsign install to 0.2.1 by @jdx in
[d5ef6f9](d5ef6f9)

### Security

- **(config)** ignore [settings] from untrusted project configs by @jdx
in [#14538](#14538)

### New Contributors

- @ZainnQureshii made their first contribution in
[#14552](#14552)
- @fang2hou made their first contribution in
[#14551](#14551)
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.

mise lock on Windows writes no platform entries for core:ruby

1 participant