diff --git a/.github/workflows/ci.generate.ts b/.github/workflows/ci.generate.ts
index c1f1eef6b4..44fd3c47c7 100755
--- a/.github/workflows/ci.generate.ts
+++ b/.github/workflows/ci.generate.ts
@@ -17,7 +17,7 @@ const Runners = (() => {
})();
// bump the number at the start when you want to purge the cache
const prCacheKeyPrefix =
- "29-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-";
+ "31-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-";
const installPkgsCommand =
"sudo apt-get install --no-install-recommends debootstrap clang-15 lld-15";
@@ -480,7 +480,7 @@ const ci = {
"~/.cargo/git/db",
].join("\n"),
key:
- "29-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}",
+ "31-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}",
},
},
{
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c78791ee5b..97219b4d0c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -293,7 +293,7 @@ jobs:
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
- key: '29-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
+ key: '31-cargo-home-${{ matrix.os }}-${{ hashFiles(''Cargo.lock'') }}'
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr)'
- name: Restore cache build output (PR)
uses: actions/cache/restore@v3
@@ -305,7 +305,7 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: never_saved
- restore-keys: '29-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
+ restore-keys: '31-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-'
- name: Apply and update mtime cache
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (!startsWith(github.ref, ''refs/tags/''))'
uses: ./.github/mtime_cache
@@ -589,7 +589,7 @@ jobs:
!./target/*/gn_out
!./target/*/*.zip
!./target/*/*.tar.gz
- key: '29-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
+ key: '31-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
publish-canary:
name: publish canary
runs-on: ubuntu-22.04
diff --git a/cli/napi/env.rs b/cli/napi/env.rs
index 114c43026f..decdd59d6f 100644
--- a/cli/napi/env.rs
+++ b/cli/napi/env.rs
@@ -136,9 +136,10 @@ fn node_api_get_module_file_name(
#[napi_sym::napi_sym]
fn napi_module_register(module: *const NapiModule) -> napi_status {
- MODULE.with(|cell| {
+ MODULE_TO_REGISTER.with(|cell| {
let mut slot = cell.borrow_mut();
- slot.replace(module);
+ let prev = slot.replace(module);
+ assert!(prev.is_none());
});
napi_ok
}
diff --git a/ext/napi/lib.rs b/ext/napi/lib.rs
index 32f8c52fc5..22d86e4a9b 100644
--- a/ext/napi/lib.rs
+++ b/ext/napi/lib.rs
@@ -81,9 +81,7 @@ pub const napi_would_deadlock: napi_status = 21;
pub const NAPI_AUTO_LENGTH: usize = usize::MAX;
thread_local! {
- pub static MODULE: RefCell