rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

Windows: Remove Bash dependency

Open meteorcloudy opened this issue 6 years ago • 2 comments

🚀 feature request

Description

Rules released in rules_nodejs should not depend on Bash on Windows.

Describe the solution you'd like

We currently depends on Bash in the following places:

  • [x] sh_binary/sh_test: To be removed by https://github.com/bazelbuild/rules_nodejs/pull/1078
  • [ ] shell script for launching nodejs binary, node_launcher.sh and launcher for protractor_web_test We can re-implement the logic in this file in nodejs, then use a simple Bash script to run the node script on Linux and a Batch script to run it on Windows. (In a similar way we use a Batch script to run Bash currently, see windows_utils.bzl)
  • [ ] ctx.actions.run just to cp files at https://github.com/bazelbuild/rules_nodejs/blob/843d8e48f763d4a9efce49d260c1e65529985586/third_party/github.com/bazelbuild/bazel-skylib/rules/private/copy_file_private.bzl#L50

ctx.actions.run_shell API in rollup_bundle.bzl will go away since the legacy rollup_bundle will be deprecated/removed by 1.0.

I checked in the release artifact of rules_nodejs, we don't have any usage of genrule, so that's nice. In the rules_nodejs repo, we still use some genrules, but I believe that's fine.

To test we can set BAZEL_SH=C:/not/exist/bash.exe or pass --shell_executable= during the build.

/cc @alexeagle

meteorcloudy avatar Sep 06 '19 09:09 meteorcloudy

This is a great tracking bug to have. I have a party interested in running rules_nodejs on windows so if you can utilize this tracking bug or something else to keep track of windows incompatibilities I would be happy to make PRs to fix some of them which affect my client

mrmeku avatar Sep 18 '19 16:09 mrmeku

Hi @mrmeku , this bug is intended to track the progress of making rules_nodejs Bashless on Windows. Do you want to contribute to it? The main blocker is to replacing the node_launcher.sh script.

meteorcloudy avatar Oct 02 '19 07:10 meteorcloudy

No longer in scope for rules_nodejs which only supplies the Node.js toolchain as of v6.0.0.

Downstream canonical JavaScript + Node.js ruleset is now https://github.com/aspect-build/rules_js.

gregmagolan avatar Jun 08 '24 21:06 gregmagolan