fix(loader): write Wasm lib directly to lib dir
Problem: `fs::rename` fails if the parser directory and the Tree-sitter library directory are on different file systems. Solution: Write the library file directly to the final directory.
This commit is contained in:
parent
dcef0cc0ee
commit
14b4708018
1 changed files with 1 additions and 6 deletions
|
|
@ -1306,11 +1306,10 @@ impl Loader {
|
|||
) -> LoaderResult<()> {
|
||||
let clang_executable = self.ensure_wasi_sdk_exists()?;
|
||||
|
||||
let output_name = "output.wasm";
|
||||
let mut command = Command::new(&clang_executable);
|
||||
command.current_dir(src_path).args([
|
||||
"-o",
|
||||
output_name,
|
||||
output_path.to_str().unwrap(),
|
||||
"-fPIC",
|
||||
"-shared",
|
||||
if self.debug_build { "-g" } else { "-Os" },
|
||||
|
|
@ -1337,10 +1336,6 @@ impl Loader {
|
|||
));
|
||||
}
|
||||
|
||||
let current_path = src_path.join(output_name);
|
||||
fs::rename(¤t_path, output_path)
|
||||
.map_err(|e| LoaderError::IO(IoError::new(e, Some(current_path.as_path()))))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue