GeezerVison is showing github.com — doc: clarify `useCodeCache` setting for cross-platform SEA generation · nodejs/node@4021215
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/single-executable-applications.md +7Lines changed: 7 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -190,6 +190,13 @@ If the paths are not absolute, Node.js will use the path relative to the |
190 | 190 | current working directory. The version of the Node.js binary used to produce |
191 | 191 | the blob must be the same as the one to which the blob will be injected. |
192 | 192 |
|
| 193 | +Note: When generating cross-platform SEAs (e.g., generating a SEA |
| 194 | +for `linux-x64` on `darwin-arm64`), `useCodeCache` and `useSnapshot` |
| 195 | +must be set to false to avoid generating incompatible executables. |
| 196 | +Since code cache and snapshots can only be loaded on the same platform |
| 197 | +where they are compiled, the generated executable might crash on startup when |
| 198 | +trying to load code cache or snapshots built on a different platform. |
| 199 | +
|
193 | 200 | ### Assets |
194 | 201 |
|
195 | 202 | Users can include assets by adding a key-path dictionary to the configuration |
|