Compare commits

..
8 Commits
6 changed files with 92 additions and 35 deletions
+17 -11
View File
@@ -33,14 +33,17 @@ jobs:
- name: build compiler - name: build compiler
run: | run: |
ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first" ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first"
- name: ridk version (mingw) - name: gcc and ridk version (mingw)
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
run: | run: |
$abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ') $abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ')
if (($abi -ge '2.4') -and $plat.Contains('mingw')) { if ($plat.Contains('mingw')) {
ridk version gcc --version
} else { if ($abi -ge '2.4') {
echo 'ridk is unavailable' ridk version
} else {
echo 'ridk is unavailable'
}
} }
- name: Subprocess test - name: Subprocess test
run: ruby test_subprocess.rb run: ruby test_subprocess.rb
@@ -87,14 +90,17 @@ jobs:
- name: build compiler - name: build compiler
run: | run: |
ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first" ruby -e "puts 'build compiler: ' + RbConfig::CONFIG.fetch('CC_VERSION_MESSAGE', 'unknown').lines.first"
- name: ridk version (mingw) - name: gcc and ridk version (mingw)
if: startsWith(matrix.cfg.os, 'windows') if: startsWith(matrix.os, 'windows')
run: | run: |
$abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ') $abi, $plat = $(ruby -e "STDOUT.write RbConfig::CONFIG['ruby_version'] + ' ' + RUBY_PLATFORM").split(' ')
if (($abi -ge '2.4') -and $plat.Contains('mingw')) { if ($plat.Contains('mingw')) {
ridk version gcc --version
} else { if ($abi -ge '2.4') {
echo 'ridk is unavailable' ridk version
} else {
echo 'ridk is unavailable'
}
} }
- name: Subprocess test - name: Subprocess test
run: ruby test_subprocess.rb run: ruby test_subprocess.rb
+8 -4
View File
@@ -18,15 +18,18 @@ This action currently supports these versions of MRI, JRuby and TruffleRuby:
| Interpreter | Versions | | Interpreter | Versions |
| ----------- | -------- | | ----------- | -------- |
| Ruby | 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head, mingw, mswin | | Ruby | 2.2, 2.3.0 - 2.3.8, 2.4.0 - 2.4.9, 2.5.0 - 2.5.7, 2.6.0 - 2.6.5, 2.7.0, head, mingw, mswin |
| JRuby | 9.1.17.0, 9.2.9.0 - 9.2.11.0, head | | JRuby | 9.1.17.0, 9.2.9.0 - 9.2.11.1, head |
| TruffleRuby | 19.3.0 - 20.0.0, head | | TruffleRuby | 19.3.0 - 20.0.0, head |
| Rubinius | 4.14 | | Rubinius | 4.14 |
On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively. On Windows, `mingw` and `mswin` are `ruby-head` builds using the MSYS2/MinGW and the MSVC toolchains respectively.
Ruby 2.2 resolves to 2.2.6 on Windows (last build from RubyInstaller) and 2.2.10 otherwise.
Ruby 2.3 on Windows only has builds for 2.3.0, 2.3.1 and 2.3.3 (same as RubyInstaller).
Note that Ruby ≤ 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life, Note that Ruby ≤ 2.3 and the OpenSSL version it needs (1.0.2) are both end-of-life,
which means Ruby ≤ 2.3 is unmaintained and considered insecure. which means Ruby ≤ 2.3 is unmaintained and considered insecure.
On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained. On Windows, Ruby 2.4 uses OpenSSL 1.0.2, which is no longer maintained.
Ruby 2.2 resolves to 2.2.6 on Windows (last build from RubyInstaller) and 2.2.10 otherwise.
### Supported Platforms ### Supported Platforms
@@ -140,7 +143,8 @@ It is recommended to first get your build working on Ubuntu and macOS before try
* The default shell on Windows is not Bash but [PowerShell](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell). * The default shell on Windows is not Bash but [PowerShell](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#using-a-specific-shell).
This can lead issues such as multi-line scripts [not working as expected](https://github.com/ruby/setup-ruby/issues/13). This can lead issues such as multi-line scripts [not working as expected](https://github.com/ruby/setup-ruby/issues/13).
* The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where.exe` to debug which tool is used. * The `PATH` contains [multiple compiler toolchains](https://github.com/ruby/setup-ruby/issues/19). Use `where.exe` to debug which tool is used.
* MSYS2 is prepended to the `PATH`, similar to what RubyInstaller2 does. * For Ruby ≥ 2.4, MSYS2 is prepended to the `Path`, similar to what RubyInstaller2 does.
* For Ruby < 2.4, the DevKit MSYS tools are installed and prepended to the `Path`.
* JRuby on Windows has a known bug that `bundle exec rake` [fails](https://github.com/ruby/setup-ruby/issues/18). * JRuby on Windows has a known bug that `bundle exec rake` [fails](https://github.com/ruby/setup-ruby/issues/18).
## Limitations ## Limitations
Generated Vendored
+35 -10
View File
@@ -951,8 +951,11 @@ module.exports = require("os");
/***/ }), /***/ }),
/***/ 104: /***/ 104:
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) { /***/ (function(__unusedmodule, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "run", function() { return run; });
const os = __webpack_require__(87) const os = __webpack_require__(87)
const fs = __webpack_require__(747) const fs = __webpack_require__(747)
const path = __webpack_require__(622) const path = __webpack_require__(622)
@@ -1076,7 +1079,7 @@ function findUbuntuVersion() {
} }
} }
run() if (__filename.endsWith('index.js')) { run() }
/***/ }), /***/ }),
@@ -1394,7 +1397,7 @@ function getVersions(platform) {
], ],
"jruby": [ "jruby": [
"9.1.17.0", "9.1.17.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1",
"head" "head"
], ],
"truffleruby": [ "truffleruby": [
@@ -4807,10 +4810,15 @@ const rubyInstallerVersions = __webpack_require__(471).versions
// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows // needed for 2.2, 2.3, and mswin, cert file used by Git for Windows
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
// standard MSYS2 location, found by 'devkit' // standard MSYS2 location, found by 'devkit.rb'
const msys2 = 'C:\\msys64' const msys2 = 'C:\\msys64'
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3
const msys = 'C:\\DevKit64'
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
`${msys}\\mingw\\bin`, `${msys}\\bin`]
function getAvailableVersions(platform, engine) { function getAvailableVersions(platform, engine) {
if (engine === 'ruby') { if (engine === 'ruby') {
return Object.keys(rubyInstallerVersions) return Object.keys(rubyInstallerVersions)
@@ -4863,14 +4871,31 @@ async function symLinkToEmbeddedMSYS2() {
async function setupMingw(version) { async function setupMingw(version) {
if (version.startsWith('2.2') || version.startsWith('2.3')) { if (version.startsWith('2.2') || version.startsWith('2.3')) {
core.exportVariable('SSL_CERT_FILE', certFile) core.exportVariable('SSL_CERT_FILE', certFile)
} await installMSYS(version)
// Remove when Actions Windows image contains MSYS2 install return msysPathEntries
if (!fs.existsSync(msys2)) { } else {
await symLinkToEmbeddedMSYS2() // Remove when Actions Windows image contains MSYS2 install
} if (!fs.existsSync(msys2)) {
await symLinkToEmbeddedMSYS2()
}
return msys2PathEntries return msys2PathEntries
}
}
// Ruby 2.2 and 2.3
async function installMSYS(version) {
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
const downloadPath = await tc.downloadTool(url)
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
// below are set in the old devkit.rb file ?
core.exportVariable('RI_DEVKIT', msys)
core.exportVariable('CC' , 'gcc')
core.exportVariable('CXX', 'g++')
core.exportVariable('CPP', 'cpp')
core.info(`Installed RubyInstaller DevKit for Ruby ${version}`)
} }
async function setupMSWin() { async function setupMSWin() {
+2 -2
View File
@@ -3,7 +3,7 @@ const fs = require('fs')
const path = require('path') const path = require('path')
const core = require('@actions/core') const core = require('@actions/core')
async function run() { export async function run() {
try { try {
const platform = getVirtualEnvironmentName() const platform = getVirtualEnvironmentName()
const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version')) const [engine, version] = parseRubyEngineAndVersion(core.getInput('ruby-version'))
@@ -121,4 +121,4 @@ function findUbuntuVersion() {
} }
} }
run() if (__filename.endsWith('index.js')) { run() }
+1 -1
View File
@@ -11,7 +11,7 @@ export function getVersions(platform) {
], ],
"jruby": [ "jruby": [
"9.1.17.0", "9.1.17.0",
"9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.9.0", "9.2.10.0", "9.2.11.0", "9.2.11.1",
"head" "head"
], ],
"truffleruby": [ "truffleruby": [
+29 -7
View File
@@ -11,10 +11,15 @@ const rubyInstallerVersions = require('./windows-versions').versions
// needed for 2.2, 2.3, and mswin, cert file used by Git for Windows // needed for 2.2, 2.3, and mswin, cert file used by Git for Windows
const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem' const certFile = 'C:\\Program Files\\Git\\mingw64\\ssl\\cert.pem'
// standard MSYS2 location, found by 'devkit' // standard MSYS2 location, found by 'devkit.rb'
const msys2 = 'C:\\msys64' const msys2 = 'C:\\msys64'
const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`] const msys2PathEntries = [`${msys2}\\mingw64\\bin`, `${msys2}\\usr\\bin`]
// location & path for old RubyInstaller DevKit (MSYS), Ruby 2.2 and 2.3
const msys = 'C:\\DevKit64'
const msysPathEntries = [`${msys}\\mingw\\x86_64-w64-mingw32\\bin`,
`${msys}\\mingw\\bin`, `${msys}\\bin`]
export function getAvailableVersions(platform, engine) { export function getAvailableVersions(platform, engine) {
if (engine === 'ruby') { if (engine === 'ruby') {
return Object.keys(rubyInstallerVersions) return Object.keys(rubyInstallerVersions)
@@ -67,14 +72,31 @@ async function symLinkToEmbeddedMSYS2() {
async function setupMingw(version) { async function setupMingw(version) {
if (version.startsWith('2.2') || version.startsWith('2.3')) { if (version.startsWith('2.2') || version.startsWith('2.3')) {
core.exportVariable('SSL_CERT_FILE', certFile) core.exportVariable('SSL_CERT_FILE', certFile)
} await installMSYS(version)
// Remove when Actions Windows image contains MSYS2 install return msysPathEntries
if (!fs.existsSync(msys2)) { } else {
await symLinkToEmbeddedMSYS2() // Remove when Actions Windows image contains MSYS2 install
} if (!fs.existsSync(msys2)) {
await symLinkToEmbeddedMSYS2()
}
return msys2PathEntries return msys2PathEntries
}
}
// Ruby 2.2 and 2.3
async function installMSYS(version) {
const url = 'https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe'
const downloadPath = await tc.downloadTool(url)
await exec.exec('7z', ['x', downloadPath, `-o${msys}`], { silent: true })
// below are set in the old devkit.rb file ?
core.exportVariable('RI_DEVKIT', msys)
core.exportVariable('CC' , 'gcc')
core.exportVariable('CXX', 'g++')
core.exportVariable('CPP', 'cpp')
core.info(`Installed RubyInstaller DevKit for Ruby ${version}`)
} }
async function setupMSWin() { async function setupMSWin() {