From 18485596cf6d572c146c193afad97091b6ef1d66 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Tue, 23 Nov 2021 03:11:29 -0600 Subject: [PATCH] Windows - Rename 3rd party OpenSSL SYSTEM32 dll's --- windows.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/windows.js b/windows.js index d8ee6bc..162a6ab 100644 --- a/windows.js +++ b/windows.js @@ -134,6 +134,11 @@ async function downloadAndExtract(engine, version, url, base, rubyPrefix) { async function setupMingw(version) { core.exportVariable('MAKE', 'make.exe') + // rename these to avoid confusion when Ruby is using OpenSSL 1.0.2 + // most current extconf files look for 1.1.x dll files first, which is the + // version of the renamed files + if (common.floatVersion(version) <= 2.4) { renameSystem32Dlls() } + if (common.floatVersion(version) <= 2.3) { core.exportVariable('SSL_CERT_FILE', certFile) await common.measure('Installing MSYS', async () => installMSYS(version)) @@ -219,6 +224,17 @@ export function addVCVARSEnv() { return newPathEntries } +// ssl files cause issues with non RI2 Rubies (<2.4) and ruby/ruby's CI from +// build folder due to dll resolution +function renameSystem32Dlls() { + const sys32 = 'C:\\Windows\\System32\\' + const badFiles = ['libcrypto-1_1-x64.dll', 'libssl-1_1-x64.dll'] + badFiles.forEach( (bad) => { + let fn = `${sys32}${bad}` + if (fs.existsSync(fn)) { fs.renameSync(fn, `${fn}_`) } + }) +} + // Sets MSYS2 ENV variables set from running `ridk enable` // function addRidkEnv(ridk) {