Bun install or Could Rescript use a globally installed ninja?

Hi Folks (esp @cristianoc @ryyppy?)
Working on building a container for our ci builds that would use bun to speed up our dependency installs.
If I install this way, it seems that post installs are not called which leaves things in a weird state. pursuing that, it looks like the ninja.exe that comes with rescript is somehow unsatisfactory, and rescript_postinstall.js attempts to build it. building ninja then fails because it expects many things to be installed which are not yet…python, g++…

Im wondering…

would it be possible to check for a sufficient globally installed ninja instead?

[edit: I may have some funny stuff going on locally. all the binaries are visible in node_modules/rescript/linux. and appear to ls, permissions are rwxr_xr_x, but get “bash: file not found” when i try to execute them]

[edit2: maybe some missing dynamic libs?]

[edit3: global ninja wont be enough since the rescript.exe also does the same thing and we’ll ultimately need that too]

That’s probably a question for @cknitt who has been messing around with the github runners / postinstall scripts for v11 lately.

1 Like

I think i found it. an issue with nix and unpatched dynamic libs…

I cannot comment on bun as I have no experience with it.

However, in ReScript 11, the postinstall script will not try to build ninja or the compiler anymore. Instead, ReScript 11 will come with prebuilt binaries for all of the following platforms:

  • macOS x64
  • macOS arm64
  • Linux x64 (statically linked)
  • Linux arm64 (statically linked)
  • Windows x64

As the Linux binaries will be statically linked, there will be no more issues with incompatible glibc versions.

All of this is already on master, so maybe give the latest master build a try and see if it solves your problem (see rescript-compiler/CONTRIBUTING.md at master · rescript-lang/rescript-compiler · GitHub).