Repository navigation
Add mswin release builds as mswin-X.Y and mswin-head #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,8 @@ const PATH_ENV_VAR = windows ? 'Path' : 'PATH' | |
|
|
||
| export const inputs = { | ||
| selfHosted: undefined, | ||
| token: undefined | ||
| token: undefined, | ||
| mswin: undefined | ||
| } | ||
|
|
||
| export function partition(string, separator) { | ||
|
|
@@ -70,7 +71,7 @@ export async function time(name, block) { | |
|
|
||
| export function isHeadVersion(rubyVersion) { | ||
| // asan-release counts as "head" because the version cannot be selected -- you can only get whatever's latest | ||
| return ['head', 'debug', 'mingw', 'mswin', 'ucrt', 'asan', 'asan-release'].includes(rubyVersion) | ||
| return ['head', 'debug', 'mingw', 'ucrt', 'asan', 'asan-release'].includes(rubyVersion) | ||
| } | ||
|
|
||
| export function isStableVersion(engine, rubyVersion) { | ||
|
|
@@ -292,7 +293,8 @@ function findWindowsVersion() { | |
| } | ||
|
|
||
| export function shouldUseToolCache(engine, version) { | ||
| return (engine === 'ruby' && !isHeadVersion(version)) || isSelfHostedRunner() | ||
| // The tool cache of runners holds RubyInstaller builds under the same Ruby/<version> names as mswin | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this comment, especially the |
||
| return (engine === 'ruby' && !isHeadVersion(version) && !inputs.mswin) || isSelfHostedRunner() | ||
| } | ||
|
|
||
| export function getToolCachePath() { | ||
|
|
||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,11 +51,14 @@ export async function setupRuby(options = {}) { | |
| process.chdir(inputs['working-directory']) | ||
|
|
||
| const platform = common.getOSNameVersion() | ||
| const [engine, parsedVersion] = parseRubyEngineAndVersion(inputs['ruby-version']) | ||
| const [engine, parsedVersion, mswin] = parseRubyEngineAndVersion(inputs['ruby-version']) | ||
| common.inputs.mswin = mswin | ||
|
|
||
| let installer | ||
| if (platform.startsWith('windows-') && engine === 'ruby' && !common.isSelfHostedRunner()) { | ||
| installer = require('./windows') | ||
| } else if (mswin) { | ||
| throw new Error('mswin is only available on GitHub-hosted Windows runners') | ||
| } else { | ||
| installer = require('./ruby-builder') | ||
| } | ||
|
|
@@ -147,13 +150,24 @@ function parseRubyEngineAndVersion(rubyVersion) { | |
| [engine, version] = common.partition(rubyVersion, '-') | ||
| } | ||
|
|
||
| return [engine, version] | ||
| // mswin is CRuby built with MSVC, so it stays the ruby engine and only selects other builds | ||
| const mswin = engine === 'mswin' || rubyVersion === 'ruby-mswin' | ||
| if (mswin) { | ||
| engine = 'ruby' | ||
| // mswin and ruby-mswin keep installing the master build until their known users move to mswin-head | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is reasonable & pragmatic, once we have made PRs to all public repos using |
||
| if (version === '' || version === 'mswin') { | ||
| version = 'head' | ||
| } | ||
| } | ||
|
|
||
| return [engine, version, mswin] | ||
| } | ||
|
|
||
| function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVersion) { | ||
| if (!engineVersions) { | ||
| throw new Error(`Unknown engine ${engine} on ${platform}`) | ||
| } | ||
| const name = common.inputs.mswin ? 'mswin' : engine | ||
|
|
||
| let version = parsedVersion | ||
| if (!engineVersions.includes(parsedVersion)) { | ||
|
|
@@ -168,8 +182,8 @@ function validateRubyEngineAndVersion(platform, engineVersions, engine, parsedVe | |
| if (found) { | ||
| version = found | ||
| } else { | ||
| throw new Error(`Unknown version ${parsedVersion} for ${engine} on ${platform} | ||
| Available versions for ${engine} on ${platform}: ${engineVersions.join(', ')} | ||
| throw new Error(`Unknown version ${parsedVersion} for ${name} on ${platform} | ||
| Available versions for ${name} on ${platform}: ${engineVersions.join(', ')} | ||
| Make sure you use the latest version of the action with - uses: ruby/setup-ruby@v1`) | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "3.4.11": { | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "3.4.12": { | ||
| "arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-arm64-windows.7z", | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "3.4.13": { | ||
| "arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-arm64-windows.7z", | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "4.0.7": { | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "4.0.8": { | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "4.0.9": { | ||
| "arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-arm64-windows.7z", | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "4.0.10": { | ||
| "arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-arm64-windows.7z", | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| }, | ||
| "head": { | ||
| "arm64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-arm64-windows.7z", | ||
| "x64": "https://github.com/ruby/setup-msys2-gcc/releases/latest/download/vcpkg-x64-windows.7z" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "3.4.11": { | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-3.4.11-x64-mswin64_140.zip" | ||
| }, | ||
| "3.4.12": { | ||
| "arm64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-3.4.12-arm64-mswin64_140.zip", | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-3.4.12-x64-mswin64_140.zip" | ||
| }, | ||
| "3.4.13": { | ||
| "arm64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-3.4.13-arm64-mswin64_140.zip", | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-3.4.13-x64-mswin64_140.zip" | ||
| }, | ||
| "4.0.7": { | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.7-x64-mswin64_140.zip" | ||
| }, | ||
| "4.0.8": { | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.8-x64-mswin64_140.zip" | ||
| }, | ||
| "4.0.9": { | ||
| "arm64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.9-arm64-mswin64_140.zip", | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.9-x64-mswin64_140.zip" | ||
| }, | ||
| "4.0.10": { | ||
| "arm64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.10-arm64-mswin64_140.zip", | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/ruby-4.0.10-x64-mswin64_140.zip" | ||
| }, | ||
| "head": { | ||
| "arm64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/dev/ruby-head-arm64-mswin64_140.zip", | ||
| "x64": "https://cache.ruby-lang.org/pub/ruby/binaries/mswin64/dev/ruby-head-x64-mswin64_140.zip" | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be easier to understand, if we add another row to the table naming
mswinand a rough overview of the available versions, instead of most of the text below. Technically mswin is the same cruby interpreter, but it has a very different ecosystem.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to explore the idea I posted in the earlier and see what's everyone's thought: #971 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep
mswinhere, as it selects a platform build of CRuby rather than a VM variant like GraalVM. A common syntax for CRuby variants would also renameruby-asanandruby-debug, so I think it fits better in a separate issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shortened the paragraph and moved the version overview into its first sentence. I kept mswin out of the table, since its rows are interpreters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also a variant, using a different toolchain. I do think it'd be nice to generalize the concept of variants, for example we have
asan-releasecurrently and it's not so nice,ruby+asan/ruby+asan-headseems better.We kind of need to decide this now, because it decides whether it's
ruby+mswin-3.4ormswin-3.4.Though maybe the
ruby+prefix could be implicit, likeruby-currently, not sure how easy/hard that is though.