You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compile cache may cause Node to crash if it was generated from a Node build where os.arch() does not match.
I experienced that recently with Node 16 on an Apple M1 machine. I was debugging an issue with yarn and eventually tracked the issue to v8-compile-cache. yarn had been used with a non-native Node build (os.arch() reported x86), then when a native M1 build of the same node version was installed (os.arch() reported arm64) Node would crash when invoking yarn.
We determined that a compile cache had been generated, but because the compile cache matched independent of the architecture it was incompatible when used across Node binaries —both valid and running on the same machine without issue— and would cause Node to crash.
We were able to resolve the issue by:
Invoking yarn with the environment variable as follows: DISABLE_V8_COMPILE_CACHE=1 yarn
Finding and removing the generated temporary directories that look like v8-compile-cache*
I believe an appropriate solution would be to add os.arch() to the cache directories around here:
The compile cache may cause Node to crash if it was generated from a Node build where
os.arch()
does not match.I experienced that recently with Node 16 on an Apple M1 machine. I was debugging an issue with
yarn
and eventually tracked the issue tov8-compile-cache
.yarn
had been used with a non-native Node build (os.arch()
reportedx86
), then when a native M1 build of the same node version was installed (os.arch()
reportedarm64
) Node would crash when invokingyarn
.We determined that a compile cache had been generated, but because the compile cache matched independent of the architecture it was incompatible when used across Node binaries —both valid and running on the same machine without issue— and would cause Node to crash.
We were able to resolve the issue by:
yarn
with the environment variable as follows:DISABLE_V8_COMPILE_CACHE=1 yarn
v8-compile-cache*
I believe an appropriate solution would be to add
os.arch()
to the cache directories around here:v8-compile-cache/v8-compile-cache.js
Lines 322 to 327 in 454af0b
The text was updated successfully, but these errors were encountered: