You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better way to resolve binary path when node_modules/ doesn't exist #1170
Native Deno project, where packages are only installed into Deno's global cache and no node_modules/ compatibility directory is exposed.
Yarn-berry project in PnP mode (pnpm also supports this setup) where all dependencies are installed into Yarn's global cache as ZIP archives and they are resolved using a JS loader file at project root.
The user might want to use rescript/rewatch binary packaged by a downstream distribution (.e.g Nixpkgs)
Setting a custom value for settings.platformPath / settings.binaryPath is undesirable since the parent directory of the binary might not be obvious (in case 2 and 3 above).
Suggestion
We could have special logic to deal with Deno and PnP cases, and optionally search the user's PATH for the binary if they want to.
PS: I would imagine a rescript build also doesn't quite work in these scenarios.
If they do, do they provide a valid lib/bs/compiler-info.json file?
rescript build is usually invoked as a npm/yarn/pnpm/deno script target, so the package manager already takes care of prepending the package's bin/ directory to the user's PATH. The lack of node_modules/ directory is not an issue in this case.
Though, being able to run the custom binary from the system (.e.g in /usr/bin/) instead of the package's pre-built binaries is a bit more complex. In this situation, I'll have to mask all optional dependencies.
rescript build is usually invoked as a npm/yarn/pnpm/deno script target, so the package manager already takes care of prepending the package's bin/ directory to the user's PATH. The lack of node_modules/ directory is not an issue in this case.
It is a bit more complex than that.
The rescript script needs to find the runtime and bsc.exe binary before it invokes the rust (rewatch) binary. So, I'm wondering if all that even worked out.
Activity
nojaf commentedon Dec 26, 2025
I'm quite skeptical to add more logic for these cases.
From the maintainer's point of view: where does it end?
I think taking some absolute paths for
bsc.exeandrescript-editor-analysis.exein configuration would be reasonable first step.PS: I would imagine a
rescript buildalso doesn't quite work in these scenarios.If they do, do they provide a valid
lib/bs/compiler-info.jsonfile?folliehiyuki commentedon Dec 26, 2025
rescript buildis usually invoked as a npm/yarn/pnpm/deno script target, so the package manager already takes care of prepending the package'sbin/directory to the user's PATH. The lack ofnode_modules/directory is not an issue in this case.Though, being able to run the custom binary from the system (.e.g in
/usr/bin/) instead of the package's pre-built binaries is a bit more complex. In this situation, I'll have to mask all optional dependencies.nojaf commentedon Dec 26, 2025
It is a bit more complex than that.
The
rescriptscript needs to find the runtime and bsc.exe binary before it invokes the rust (rewatch) binary. So, I'm wondering if all that even worked out.