Skip to content

Commit

Permalink
Checking GLIBC version rather than openssl version
Browse files Browse the repository at this point in the history
  • Loading branch information
DomPeliniAerospike committed Jan 13, 2024
1 parent 6f9142f commit 5e3b0c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/prebuiltBinding.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const os = require('node:os')
const fs = require('fs')
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const rename = util.promisify(fs.rename)
const rm = util.promisify(fs.rm)

Expand Down Expand Up @@ -44,7 +45,17 @@ const rm = util.promisify(fs.rm)
rm('lib/binding/node-v115-darwin-x64', { recursive: true, force: true })
rm('lib/binding/node-v108-darwin-x64', { recursive: true, force: true })

const openssl = process.versions.openssl.at(0)
const output = await exec('ldd --version | awk 'NR==1{print $NF}'')
const version = Number(output)

let openssl
if(version < 2.33){
openssl = 1
}
else{
openssl = 3
}
console.log(openssl)

if (arch === 'x64') {
await rename('lib/binding/openssl@' + openssl + '/node-v120-linux-x64', 'lib/binding/node-v120-linux-x64')
Expand Down

0 comments on commit 5e3b0c6

Please sign in to comment.