Skip to content

Commit

Permalink
fix(apply): fix regression where only hoisted linker was used
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 24, 2023
1 parent f01ed09 commit 78f4120
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions crates/node-maintainer/src/maintainer.rs
Expand Up @@ -306,7 +306,7 @@ impl NodeMaintainerOptions {
resolver.graph[node].root = node;
let (graph, _actual_tree) = resolver.run_resolver(lockfile).await?;
#[cfg(not(target_arch = "wasm32"))]
let linker = Linker::hoisted(LinkerOptions {
let linker_opts = LinkerOptions {
actual_tree: _actual_tree,
concurrency: self.concurrency,
script_concurrency: self.script_concurrency,
Expand All @@ -318,10 +318,20 @@ impl NodeMaintainerOptions {
on_extract_progress: self.on_extract_progress,
on_script_start: self.on_script_start,
on_script_line: self.on_script_line,
});
};
#[cfg(target_arch = "wasm32")]
let linker = Linker::null();
let nm = NodeMaintainer { graph, linker };
let nm = NodeMaintainer {
graph,
#[cfg(target_arch = "wasm32")]
linker: Linker::null(),
#[cfg(not(target_arch = "wasm32"))]
linker: if self.hoisted {
Linker::hoisted(linker_opts)
} else {
Linker::isolated(linker_opts)
},
};
#[cfg(debug_assertions)]
nm.graph.validate()?;
Ok(nm)
Expand Down

0 comments on commit 78f4120

Please sign in to comment.