-
Notifications
You must be signed in to change notification settings - Fork 471
Closed
Milestone
Description
Introduction
This is a follow-up to this discussion and poll on the forum: https://forum.rescript-lang.org/t/platform-support-and-prebuilt-binaries-postinstall-scripts/3443.
Currently, on postinstall of the rescript npm package, the install script checks if a prebuilt binary is available. If not, it will try to build from scratch:
- Ninja (from vendored sources)
- OCaml (from vendored sources)
- The ReScript compiler binaries
IMHO building from source in postinstall for “exotic” platforms (for which no prebuilt binaries are available at the moment) has the following disadvantages:
- Installation of the rescript package takes a long time.
- We can not be sure if it actually works. I do not know if anyone is regularly testing installations for e.g. FreeBSD or OpenBSD. In my experience, if something is not tested by CI, there is a high likelihood that it has already stopped working some time ago.
- Even if still working in principle and even though only (I think) a C compiler, make and python are required as prerequisites for the postinstall script, there is a good chance that the build/installation may fail on some machines because of a local setup issue.
- The install scripts bring a lot of complexity and restrictions to the project setup and prevent us from moving to a dune-only build setup.
My proposal
- Provide prebuilt binaries for Linux ARM. Linux ARM was the only additional platform that people expressed interest in in the forum poll (except for NixOS which should build from source anyway according to its philosophy).
- This would extend the list of platforms that we provide prebuilt binaries for to:
- macOS x64
- macOS ARM
- Linux x64
- Linux ARM
- Windows x64
- For any platform not in this list, users are required to "bring their own binaries" (either built from source by themselves or provided by some third party). Then they would install ReScript e.g. as follows:
export RESCRIPT_PLATFORM_BIN_DIR="<path to my exotic rescript binaries>"
npm install rescript
- The postinstall script of the rescript npm package will then take the binaries from this directory after verifying that the versions match.
cometkim
Metadata
Metadata
Assignees
Labels
No labels