From 7f292a0e2dcd3c91a11b52eb25711750567403e3 Mon Sep 17 00:00:00 2001 From: Roch Devost Date: Mon, 25 Nov 2024 20:13:43 -0500 Subject: [PATCH 1/2] fix oracledb ci job using a node version incompatible with container (#4943) --- .github/workflows/plugins.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index b9b4b387e4a..5e1c3ac3017 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -802,7 +802,11 @@ jobs: # TODO: Figure out why nyc stopped working with EACCESS errors. oracledb: runs-on: ubuntu-latest - container: bengl/node-12-with-oracle-client + container: + image: bengl/node-12-with-oracle-client + volumes: + - /node20217:/node20217:rw,rshared + - /node20217:/__e/node20:ro,rshared services: oracledb: image: gvenzl/oracle-xe:18-slim @@ -827,6 +831,11 @@ jobs: # Needed to fix issue with `actions/checkout@v3: https://github.com/actions/checkout/issues/1590 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: + # https://github.com/actions/runner/issues/2906#issuecomment-2109514798 + - name: Install Node for runner (with glibc 2.17 compatibility) + run: | + curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz + tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: From 66f115c953861c1a180ba8f49d673f5f0167dc01 Mon Sep 17 00:00:00 2001 From: Roch Devost Date: Mon, 25 Nov 2024 21:06:59 -0500 Subject: [PATCH 2/2] fix race condition in initialization file on latest node (#4942) --- initialize.mjs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/initialize.mjs b/initialize.mjs index 104e253d22d..b7303848430 100644 --- a/initialize.mjs +++ b/initialize.mjs @@ -12,6 +12,7 @@ import { isMainThread } from 'worker_threads' +import * as Module from 'node:module' import { fileURLToPath } from 'node:url' import { load as origLoad, @@ -49,12 +50,9 @@ export async function getSource (...args) { } if (isMainThread) { - // Need this IIFE for versions of Node.js without top-level await. - (async () => { - await import('./init.js') - const { register } = await import('node:module') - if (register) { - register('./loader-hook.mjs', import.meta.url) - } - })() + const require = Module.createRequire(import.meta.url) + require('./init.js') + if (Module.register) { + Module.register('./loader-hook.mjs', import.meta.url) + } }