From 923195b624ad918188a6b8776a40d24f3ceef043 Mon Sep 17 00:00:00 2001 From: Yelim Koo <46446403+debbs061@users.noreply.github.com> Date: Wed, 31 Jul 2024 18:01:38 +0900 Subject: [PATCH] doc: clarify `useCodeCache` setting for cross-platform SEA generation PR-URL: https://github.com/nodejs/node/pull/53994 Reviewed-By: James M Snell Reviewed-By: Joyee Cheung Reviewed-By: Luigi Pinca Reviewed-By: Chengzhong Wu --- doc/api/single-executable-applications.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/api/single-executable-applications.md b/doc/api/single-executable-applications.md index f70020ef48c96e..1e4db62bbd04ea 100644 --- a/doc/api/single-executable-applications.md +++ b/doc/api/single-executable-applications.md @@ -190,6 +190,13 @@ If the paths are not absolute, Node.js will use the path relative to the current working directory. The version of the Node.js binary used to produce the blob must be the same as the one to which the blob will be injected. +Note: When generating cross-platform SEAs (e.g., generating a SEA +for `linux-x64` on `darwin-arm64`), `useCodeCache` and `useSnapshot` +must be set to false to avoid generating incompatible executables. +Since code cache and snapshots can only be loaded on the same platform +where they are compiled, the generated executable might crash on startup when +trying to load code cache or snapshots built on a different platform. + ### Assets Users can include assets by adding a key-path dictionary to the configuration