This is done by pinning gmp to a fork of `esy-packages/esy-gmp` that uses the `--enable-fat` argument, suggested by @ulrikstrid.
Here's the description of the open PR for `esy-packages/esy-gmp` https://github.com/esy-packages/esy-gmp/pull/3:
> GMP uses [Intel ADX](https://en.wikipedia.org/wiki/Intel_ADX) to do math stuff when capable for performance reasons. The pick whether to use ADX or not is being chosen on compile time, unless you specify `--enable-fat` which creates a "fat" binary that decides on runtime whether to use these custom instructions:
>
> > Using --enable-fat selects a “fat binary” build on x86, where optimized low level subroutines are chosen at runtime according to the CPU detected. This means more code, but gives good performance on all x86 chips. (This option might become available for more architectures in the future.)
>
> Without this flag, users can get "illegal hardware instruction" errors when running their binaries on a machine without Intel ADX.
>
> So, in other words, this PR enables building gmp into a binary on CI which _has Intel ADX_, and then using it on a machine that does not have it (like AMD or older Intels)
>
> To me, it sounds like a sane default.
Github URLS are different between release/version so check during
download and install using the correct path.
Adding in a check for if the curl command fails to download.
By statically linking `libgmp` on MacOS, we can avoid problems we have with OpenSSL, including dynamic linking (Fixes#110), and certificate issues (Fixes#170)
Unfortunately, it makes fnm fail to build on Windows, which is not that of a big deal. I want to say thanks for @ulrikstrid for all the work he invested into making the build pass on Windows, but I think that implementing fnm on Windows will be better off as a separate program — maybe even in this very repo, while sharing the feature tests with the Unix implementation
This PR adds a GitHub action (🎉) that checks for the latest refmt syntax.
This is done thanks to @thomsj which brought up the problems with formatting in the repo! 👏#105 (comment)
The current implementation is not ideal: it installs esy and then installs OCaml and @esy-ocaml/reason. A better way to do it is to distribute refmt as a standalone binary from the latest Reason release. This will be fast to install and therefore fast to integrate with CI.
An approach to do so is to add an artifact to the CircleCI runs, and then use something like circleci-artifacts.now.sh to fetch the artifact, extract it and profit 💰
In the meantime, it takes <4m to run it, which is much faster than the Azure Linux build, not to mention the Windows one.
Fixes#122, and adds tests for it:
The problem, I believe, was that some files were deleted before their symlink was deleted. `Unix.stat` fails on symlinks that point to missing files. We don't really care about their stat, honestly, so we can just run `Unix.lstat` and remove them.
* Fix build with fixed versions
* Use carets
* support `lts/dubnium` format
* trim string in test
* fix typo
* Add resolution to windows.json too
* Use specific opam file