rules_haskell icon indicating copy to clipboard operation
rules_haskell copied to clipboard

Support Asterius on Darwin arm64 / Apple M1

Open avdv opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

When testing rules_haskell I noticed that the nodejs toolchain could not be found. The reason for this is that the default nodejs version (currently 14.17.5 https://github.com/bazelbuild/rules_nodejs/blob/4.4.6/nodejs/repositories.bzl#L11) does not support darwin_arm64 yet, and creation of the corresponding nodejs_darwin_arm64 repository is simply skipped by rules_nodejs.

The first nodejs version that supports running on that platform is the current LTS version 16.x.

Describe the solution you'd like

Upgrade rules_nodejs to version 5.x where 16.x is now the default:

https://github.com/bazelbuild/rules_nodejs/pull/3107

Additionally, the --experimental-wasm-bigint flag needs to be removed when calling node since it is no longer understood by nodejs >= 16.x.

To that end, we also need to use a more recent Asterius bundle since the --experimental-wasm-bigint flag has been in use by Asterius itself, but was removed as of commit tweag/asterius@9c75ad777d1dc23cc33cc35ed38a63cca2eddb28.

Describe alternatives you've considered

Instead of upgrading rules_nodejs we could also specify the node_version parameter when calling node_repositories:

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories")

node_repositories(
    node_version = "16.13.0",
)

Additional context

See https://github.com/bazelbuild/rules_nodejs/wiki/Migrating-to-5.0

Depends on PR #1739

avdv avatar May 16 '22 08:05 avdv