From 14b4708018ee7fe3236e1d965ba589530a3374b6 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Sun, 23 Nov 2025 01:23:16 +0200 Subject: [PATCH] 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. --- crates/loader/src/loader.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/crates/loader/src/loader.rs b/crates/loader/src/loader.rs index 3234abee..ddfbc617 100644 --- a/crates/loader/src/loader.rs +++ b/crates/loader/src/loader.rs @@ -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(()) }