Skip to content

Use bsc.exe to figure out rescript version #1083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Apr 14, 2025

Fixes #1079

I'm also in a little weird position where I use nvm on Mac, and somehow node is not always on my path anymore. This worked in the past, but is somehow broken for me, so I took a look in how I can get the LSP server working without depending on Node being present.

Turns out, the only thing I bump into is the initial rescript version call.
That will run node_modules/.bin/rescript which in the latest alpha has

#!/usr/bin/env node
...

For all the other stuff where we shell out to bsc, rescript-editor-analysis, we target the platform specific executable.

So, in this PR, I'm changing the version check to do the same. bsc.exe -v also produces the version we are after, prepended with ReScript.

@zth
Copy link
Collaborator

zth commented Apr 14, 2025

I have a hunch there might be a reason we used the rescript bin instead, but can't fully remember. Could you check what older ReScript versions gives you when you call that command? ReScript 9 & 10.

@nojaf
Copy link
Contributor Author

nojaf commented Apr 14, 2025

ReScript 11.1.4
ReScript 10.1.4
ReScript 9.1.4

all works out

@zth
Copy link
Collaborator

zth commented Apr 14, 2025

Great, thanks for checking! Then just a changelog and we're good to go.

@zth zth merged commit acd6d7d into rescript-lang:master Apr 14, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work with standalone bun 1.2.5
2 participants