Rewrite ruby/setup-msys2-gcc

This commit is contained in:
なつき
2025-05-16 14:21:30 +02:00
committed by Benoit Daloze
parent 84684c07c1
commit a8713082c2
8 changed files with 615 additions and 488 deletions
+8 -1
View File
@@ -46,8 +46,15 @@ export async function install(platform, engine, version) {
rubyPrefix = path.join(os.homedir(), '.rubies', `${engine}-${version}`)
}
const paths = [path.join(rubyPrefix, 'bin')]
// JRuby can use compiled extension code via ffi, so make sure gcc exists.
if (platform.startsWith('windows') && engine === 'jruby') {
paths.push(...await require('./windows').installJRubyTools())
}
// Set the PATH now, so the MSYS2 'tar' is in Path on Windows
common.setupPath([path.join(rubyPrefix, 'bin')])
common.setupPath(paths)
if (!inToolCache) {
await io.mkdirP(rubyPrefix)