Windows JRuby - install MinGW tools, typo

This commit is contained in:
MSP-Greg
2022-01-13 19:25:34 +01:00
committed by Benoit Daloze
parent 3b96304b91
commit 24d6deea38
2 changed files with 16 additions and 2 deletions
+7
View File
@@ -51,6 +51,13 @@ export async function setupRuby(options = {}) {
createGemRC(engine, version)
envPreInstall()
// JRuby can use compiled extension code, so make sure gcc exists.
// As of Jan-2022, JRuby compiles against msvcrt.
if (platform.startsWith('windows') && (engine === 'jruby') &&
!fs.existsSync('C:\\msys64\\mingw64\\bin\\gcc.exe')) {
await require('./windows').installJRubyTools()
}
const rubyPrefix = await installer.install(platform, engine, version)
// When setup-ruby is used by other actions, this allows code in them to run
+9 -2
View File
@@ -63,7 +63,7 @@ export async function install(platform, engine, version) {
// install msys2 tools for all Ruby versions, only install mingw or ucrt for Rubies >= 2.4
if (!['windows-2019', 'windows-2016'].includes(virtualEnv)) {
await installMSY2Tools()
await installMSYS2Tools()
}
if ((( winMSYS2Type === 'ucrt64') || !['windows-2019', 'windows-2016'].includes(virtualEnv)) &&
@@ -95,7 +95,7 @@ async function installGCCTools(type) {
// Actions windows-2022 image does not contain any MSYS2 build tools. Install tools for it.
// A subset of the MSYS2 base-devel group
async function installMSY2Tools() {
async function installMSYS2Tools() {
const downloadPath = await common.measure(`Downloading msys2 build tools`, async () => {
let url = `https://github.com/MSP-Greg/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/msys2.7z`
console.log(url)
@@ -111,6 +111,13 @@ async function installMSY2Tools() {
exec.exec('7z', ['x', downloadPath, '-aoa', '-bd', `-o${msys2BasePath}`], { silent: true }))
}
// Windows JRuby can install gems that require compile tools, only needed for
// windows-2022 image
export async function installJRubyTools() {
await installMSYS2Tools()
await installGCCTools('mingw64')
}
async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
const parentDir = path.dirname(rubyPrefix)