rules_haskell icon indicating copy to clipboard operation
rules_haskell copied to clipboard

Update nodejs

Open ylecornec opened this issue 2 years ago • 0 comments

This PR makes rules_haskell use node 16 as mentioned in issue #1742.

  • For bindists, rules_nodejs is updated so that node 16 is now the default.
  • For nix, nodejs-16_x is now used instead of the default nodejs.

rules_nodejs update.

The way to use rules_nodejs 5.0.0 with nix changed quite a bit:

  • The node from nix is still installed via the _nixpkgs_nodejs macro but was modified a bit because node is now expected at a specific path.
  • In addition, the name of the external repository containing node is expected to end with the os name. Because of this we declare the same repository multiple times under all the possible names here, but only the one corresponding to the current os will be used. (At first I defined a new repository rule to get the os_name and recover it with a load command in the WORKSPACE file, but declaring all the possible names seems simpler).
  • yarn_install now has a yarn attribute that can point to a nix installed yarn, which we install with _nixpkgs_yarn.
  • We must now declare the node toolchain ourselves (in the _declare_nix_node_toolchain_impl rule) and register it.
  • The name of the nodejs toolchain type changed to @rules_nodejs//nodejs:toolchain_type.

shellcheck

I encountered some shellcheck errors, mostly because it was trying to analyze template files which are not complete yet, so I added directives to these errors.

The --experimental-wasm-bigintoption

This option is not needed anymore with node 16, so the asterius bundle was updated to a new version to fix this (as mentioned in #1742).

ylecornec avatar Aug 22 '22 11:08 ylecornec