Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Jul 12, 2025

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.

@cknitt cknitt changed the title Stdlib dir Reliably determine standard lib dir Jul 12, 2025
Copy link

pkg-pr-new bot commented Jul 12, 2025

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7637

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7637

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7637

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7637

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7637

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7637

commit: 2daa984

@cknitt
Copy link
Member Author

cknitt commented Jul 12, 2025

BTW this approach should also make it easier to move the runtime to @rescript/runtime.

@cknitt
Copy link
Member Author

cknitt commented Jul 12, 2025

@zth This probably needs to be taken into account in the editor extension, too?

BTW this approach should also make it easier to move the runtime to @rescript/runtime.

So maybe the variable should actually be RESCRIPT_RUNTIME or RESCRIPT_RUNTIME_PATH or something like that.

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.

1 participant