Skip to content

Commit

Permalink
Windows JRuby - install MinGW tools, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Jan 3, 2022
1 parent 4179dc2 commit 71078e8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
17 changes: 15 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export async function setupRuby(options = {}) {
createGemRC(engine, version)
envPreInstall()

// 1st conditional may need to change...
if (platform.startsWith('windows-202') && engine === 'jruby') {
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
Expand Down
11 changes: 9 additions & 2 deletions windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) &&
Expand Down Expand Up @@ -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)
Expand All @@ -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 and later images
export async function installJRubyTools() {
await installMSYS2Tools()
await installGCCTools('mingw64')
}

async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
const parentDir = path.dirname(rubyPrefix)

Expand Down

0 comments on commit 71078e8

Please sign in to comment.