From d3943db4369ed81ed18730d11f63c22a9ab6db6f Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 28 Aug 2025 08:15:04 +0200 Subject: [PATCH 1/2] Trim quoted paths in bsc args --- server/src/incrementalCompilation.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index d9226b6bf..b12c6886d 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -595,13 +595,15 @@ async function figureOutBscArgs(entry: IncrementallyCompiledFileInfo) { buildArgs.forEach(([key, value]: Array) => { if (key === "-I") { if (isBsb) { - /*build.ninja could have quoted paths on Windows + // On Windows, the value could be wrapped in quotes. + value = value.startsWith('"') && value.endsWith('"') ? value.substring(1, value.length - 1) : value; + /*build.ninja could have quoted full paths Example: rule mij command = "C:\Users\moi\Projects\my-project\node_modules\rescript\win32\bsc.exe" -I src -I "C:\Users\moi\Projects\my-project\node_modules\@rescript\core\lib\ocaml" -open RescriptCore -uncurried -bs-package-name rewindow -bs-package-output esmodule:$in_d:.res.mjs -bs-v $g_finger $i */ - if (isWindows && value.startsWith('"') && value.endsWith('"')) { - callArgs.push("-I", value.substring(1, value.length - 1)); + if (isWindows && value.includes(":\\")) { + callArgs.push("-I", value); } else { callArgs.push( "-I", From b3b7af8906044c32d2d59e1badcfb88dbe803b5d Mon Sep 17 00:00:00 2001 From: nojaf Date: Thu, 28 Aug 2025 08:17:22 +0200 Subject: [PATCH 2/2] fmt --- server/src/incrementalCompilation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/incrementalCompilation.ts b/server/src/incrementalCompilation.ts index b12c6886d..1f1a13ed1 100644 --- a/server/src/incrementalCompilation.ts +++ b/server/src/incrementalCompilation.ts @@ -596,7 +596,10 @@ async function figureOutBscArgs(entry: IncrementallyCompiledFileInfo) { if (key === "-I") { if (isBsb) { // On Windows, the value could be wrapped in quotes. - value = value.startsWith('"') && value.endsWith('"') ? value.substring(1, value.length - 1) : value; + value = + value.startsWith('"') && value.endsWith('"') + ? value.substring(1, value.length - 1) + : value; /*build.ninja could have quoted full paths Example: rule mij