feat(compile): support for ffi and node native addons (#28934)

This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.

Additionally, this will not work when run on readonly file systems.
This commit is contained in:
David Sherret 2025-04-17 16:01:12 -04:00 committed by GitHub
parent 0cb2ec22a4
commit 16d305449d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 417 additions and 16 deletions

View file

@ -87,6 +87,7 @@ impl CliCjsCodeAnalyzer {
source: &str,
esm_analysis_mode: EsmAnalysisMode,
) -> Result<CliCjsAnalysis, JsErrorBox> {
let source = source.strip_prefix('\u{FEFF}').unwrap_or(source); // strip BOM
let source_hash = CacheDBHash::from_hashable(source);
if let Some(analysis) =
self.cache.get_cjs_analysis(specifier.as_str(), source_hash)