-
Notifications
You must be signed in to change notification settings - Fork 469
Reliably determine standard lib dir #7637
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
base: master
Are you sure you want to change the base?
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/win32-x64
commit: |
BTW this approach should also make it easier to move the runtime to |
@zth This probably needs to be taken into account in the editor extension, too?
So maybe the variable should actually be |
a18e180
to
2daa984
Compare
@cknitt this means that you have to supply that env variable always to be able to run bsc standalone...? |
Yes. I mean we could fall back to the previous algorithm if the variable is not set, but we need to be aware that there are cases where this algorithm will not work. We could also use a command line argument instead of an env var if that's your concern - just more work to implement to get it passed through for both rewatch and bsb. |
Would like to have a fallback for this. I frequently run bsc. |
Note that that would only be an issue when directly running the platform-specific When running bsc via |
# Conflicts: # cli/rescript.js # rewatch/tests/suite-ci.sh
That includes running |
Would it be possible to make it an optional bsc arg (that uses the old algorithm if not supplied) and bake resolving that into the "compiler args" command? Rewatch could call a node script to get the path. Maybe in the future we could check if this resolution is needed at all by checking what package manager is used. Bsc is already used standalone in a few places, and I envision it being used even more standalone in the future (Svelte integration, one off scripts, code blocks in docs etc). The overhead of calling a node process for each invocation is non-negligible, and the orchestration for figuring out how to call it shouldn't be too difficult (that's why compiler args is so nice). |
To determine the standard library path in a reliable way that works with all package managers / package directory layouts, we need to do it on the JS side, see
cli/common/stdlib.js
.We pass the directory to the compiler exe via the environment variable
RESCRIPT_STDLIB
.This should fix pnpm issues for good.