Skip to content

Commit 1848559

Browse files
MSP-Gregeregon
authored andcommitted
Windows - Rename 3rd party OpenSSL SYSTEM32 dll's
1 parent 70ec766 commit 1848559

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

windows.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) {
134134
async function setupMingw(version) {
135135
core.exportVariable('MAKE', 'make.exe')
136136

137+
// rename these to avoid confusion when Ruby is using OpenSSL 1.0.2
138+
// most current extconf files look for 1.1.x dll files first, which is the
139+
// version of the renamed files
140+
if (common.floatVersion(version) <= 2.4) { renameSystem32Dlls() }
141+
137142
if (common.floatVersion(version) <= 2.3) {
138143
core.exportVariable('SSL_CERT_FILE', certFile)
139144
await common.measure('Installing MSYS', async () => installMSYS(version))
@@ -219,6 +224,17 @@ export function addVCVARSEnv() {
219224
return newPathEntries
220225
}
221226

227+
// ssl files cause issues with non RI2 Rubies (<2.4) and ruby/ruby's CI from
228+
// build folder due to dll resolution
229+
function renameSystem32Dlls() {
230+
const sys32 = 'C:\\Windows\\System32\\'
231+
const badFiles = ['libcrypto-1_1-x64.dll', 'libssl-1_1-x64.dll']
232+
badFiles.forEach( (bad) => {
233+
let fn = `${sys32}${bad}`
234+
if (fs.existsSync(fn)) { fs.renameSync(fn, `${fn}_`) }
235+
})
236+
}
237+
222238
// Sets MSYS2 ENV variables set from running `ridk enable`
223239
//
224240
function addRidkEnv(ridk) {

0 commit comments

Comments
 (0)