Skip to content

Use the mswin master build from cache.ruby-lang.org - #971

Open
hsbt wants to merge 4 commits into
masterfrom
claude/mswin-build-binaries-53f9a3
Open

hsbt wants to merge 4 commits into
masterfrom
claude/mswin-build-binaries-53f9a3

Conversation

@hsbt

@hsbt hsbt commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

ruby-version: mswin installs the mswin build of ruby-loco, which has not been updated since 2026-10-14 (see #972). The stale build already gets in the way: rb_len_t landed in master in November, and nobu's PRs updating ruby/openssl, ruby/date and ruby/zlib for it cannot be tested on mswin, because their CI still gets the October build.

This PR keeps mswin as the master build and only changes where it comes from: the daily builds at https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/, which I maintain as the official mswin builds of https://bugs.ruby-lang.org/issues/22180. The newest one is published as ruby-head-<platform>.zip under a stable URL, and arm64 is available too. As larskanis noted in #972, mswin has always been a development build, so the switch needs no deprecation period. The download token is now sent only to github.com, so it does not reach cache.ruby-lang.org.

Release versions such as mswin-4.0 are left for a separate PR.

Generated with Claude Code

@hsbt
hsbt force-pushed the claude/mswin-build-binaries-53f9a3 branch from 423acc9 to db08eaf Compare November 11, 2026 04:24
@ntkme

ntkme commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

I wonder if it will be better to make a breaking change and have mswin points to latest stable release just like ruby points to latest stable release if we are adding mswin-head.

@hsbt

hsbt commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

I agree. As it is a breaking change, I'd like to hear from @eregon before changing it in this PR.

Comment thread generate-windows-versions.rb Resolved
Comment thread generate-windows-versions.rb Resolved
Comment thread windows.js Resolved
hsbt added a commit that referenced this pull request Nov 11, 2026
A missing bundle now fails the setup, so it is reported there rather than as a certificate error later. The bundle is found on every runner image, windows-11-arm included.

#971 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ntkme
ntkme requested a review from eregon November 12, 2026 18:17
Comment thread common.js Outdated

export function isBundler1Default(engine, rubyVersion) {
if (engine === 'ruby') {
if (isCRuby(engine)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is quite error-prone as engine === 'ruby' has always been used and might be in the future.
Not sure what's a good solution though.

@ntkme ntkme Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Another approach I can think of that is potentially less error-prone is to make this more object oriented. E.g. introduce a class RubyVersion. If we only pass the object around, and only call the instance method provided by the class, so there is less chance to have errors?

class RubyVersion {
  constructor(rubyVersion) {
    ...
  }
  get engine() {
    ...
  }
  get isCRuby() {
    ...
  }
  get version() {
    ...
  }
  get floatVersion() {
    ...
  }
}

@eregon

eregon commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

I'll think a bit about this.

I agree if we add those names that it would be natural for mswin to be the last release (because mswin becomes an engine, it was a version before).
It's not great that we'd change the meaning of mswin though, both in what version it resolves though and where it pulls builds from, users might not expect that.
There are rather few public usages.

I would like to know more about the longer-term plans for those builds.
For example it seems https://www.ruby-lang.org/en/documentation/installation/ doesn't mention them.
Is the goal they become the recommended way to install on Windows?
To always keep 2 options with RubyInstaller & these builds?
What would be the advantages of using these builds over RubyInstaller which is the best-established builds on Windows?

I'm unsure it's worth having 2 variants of builds on Windows.

Comment thread README.md Outdated
| ----------- | -------- |
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 4.1.0-preview1, head, debug, mingw, mswin, ucrt |
| `ruby` | 1.9.3, 2.0.0, 2.1.9, 2.2, all versions from 2.3.0 until 4.1.0-preview1, head, debug, mingw, ucrt |
| `mswin` | 3.4.11 - 4.0.9, head (Windows only) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mswin isn't really an interpreter so this reads a bit strange.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The updated PR is not changing the symbolic meaning for now, so this is a question for later. - I wonder if we should standardize the way to specify variants of CRuby. I like the truffleruby+graalvm naming pattern so maybe something like:

  • ruby+mswin
  • ruby+mswin-head
  • ruby+mswin-4.1
  • ruby+asan
  • ruby+asan-head
  • ruby+debug-head

@eregon

eregon commented Nov 13, 2026

Copy link
Copy Markdown
Member

Relevant ticket: https://bugs.ruby-lang.org/issues/22180

@hsbt
hsbt force-pushed the claude/mswin-build-binaries-53f9a3 branch from 0b0e3f0 to 56f33e1 Compare November 15, 2026 20:14
@hsbt hsbt changed the title Add mswin engine with builds from cache.ruby-lang.org Use the mswin master build from cache.ruby-lang.org Nov 15, 2026
@hsbt

hsbt commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

I narrowed this PR to switching where mswin comes from, since it is stuck on the 2026-10-14 master and blocks testing the rb_len_t changes on mswin. It leaves mingw, ucrt and the future of ruby-loco in #972 untouched, and release versions are no longer part of it.

@hsbt
hsbt requested review from larskanis and ntkme November 15, 2026 20:21
@hsbt

hsbt commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@ntkme Thanks for the commits you pushed here. They are kept on a branch for the follow-up PR with the release versions, where I'll also consider your RubyVersion idea.

@larskanis larskanis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks all good to me.

@ntkme ntkme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall looks good to me. Only a small nit pick:

Currently for really old rubies, the SSL_CERT_FILE is part of msys1 (devkit) setup, rather than the ruby setup itself, meaning with windows-toolchain: none option, the SSL_CERT_FILE is not configured.

I'm not sure whether that behavior is good or bad and I have no preference over one or the other, but still we should make the SSL_CERT_FILE behavior consistent between the old and the new rubies.

@eregon eregon left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Replacing the outdated mswin build sound good.

I think the logic is extra complicated though, and we should have a stable URL with the latest build instead.
The CI is broken on master, I'm fixing that (#974).

Comment thread windows.js Outdated
let response
for (let attempt = 1; attempt <= 3; attempt++) {
try {
response = await fetch(indexURL, { signal: AbortSignal.timeout(30000) })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A 30s timeout seems long

Comment thread windows.js Outdated
}

// mswin master builds are published daily under dated names, so pick the latest one from the index
async function getLatestMswinURL(indexURL) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't really like this approach which gets a pretty big file (seems like it'll only get bigger with time), then has to parse JSON to get a URL.
The multiple attempts and long timeout make it sound like it doesn't always work reliably.

I think the best would actually be to have a stable URL with the latest mswin build, can that be done? (it's how all other head builds are done and it avoids lots of code here, and is more convenient for other users too)
Does cache.ruby-lang.org have a CDN to be reasonably fast from anywhere? (If not it should probably be stored on GitHub somewhere)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, switched to a stable URL. The daily build now also publishes ruby-head-<platform>.zip on cache.ruby-lang.org, which is served by Fastly, so the index lookup and its retries are gone.

hsbt and others added 3 commits November 17, 2026 09:37
The mswin builds are downloaded from cache.ruby-lang.org, which does not take the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mswin build of ruby-loco has not been updated since 2026-10-14. cache.ruby-lang.org publishes the newest daily build for x64 and arm64 as ruby-head-<platform>.zip. Their OpenSSL looks for certificates in a directory that does not exist on runners, so SSL_CERT_FILE points at the bundle of Git for Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DevKit Rubies got it only from the DevKit setup, so `windows-toolchain: none` left them without CA certificates while mswin had them. It is their OpenSSL that needs the certificates, not the toolchain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hsbt
hsbt force-pushed the claude/mswin-build-binaries-53f9a3 branch from fb7550a to 891ae9c Compare November 17, 2026 00:38

@ntkme ntkme left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@hsbt Thank you. This is a new great start.

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.

4 participants