Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts_project with transpiler: "The command line is too long" on Windows #3311

Closed
bazaglia opened this issue Feb 3, 2022 · 1 comment
Closed

Comments

@bazaglia
Copy link

bazaglia commented Feb 3, 2022

🐞 bug report

Affected Rule

ts_project

Is this a regression?

No

Description

One of the developers in my team is using Windows, and while the new ts_project transpiler option is working just file with Linux and macOS, it fails with The command line is too long. on Windows.

The .bazelrc contains the relevant option that was supposed to make a param become a file as this issue on Bazel repo says, but it has no effect here:

build --enable_runfiles --features=compiler_param_file

🔬 Minimal Reproduction

Any ts_project that sets the transpiler as the following and has enough source files to cause the command line to get too big:

load("@aspect_rules_swc//swc:swc.bzl", swc = "swc_rule")

transpiler = partial.make(
    swc,
    args = ["-C sourceMaps=true -C jsc.target=es2021 -C module.type=commonjs"],
),

🔥 Exception or Error

_cli_launcher.bat failed: error executing command
  cd C:/users/my_user/_bazel_my_user/x3g4wn4v/execroot/my-service
  SET SWC_BINARY_PATH=external/swc_win32-x64-msvc/swc.win32-x64-msvc.node
bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/aspect_rules_swc/swc/_cli_launcher.bat --no-swcrc my-service/src/@types/AuthState.ts --out-file bazel-out/x64_windows-fastbuild/bin/my-service/src/@types/AuthState.js -q --no-swcrc my-service/src/@types/Identifiers.ts --out-file bazel-out/x64_windows-fastbuild/bin/my-service/src/@types/Identifiers.js -q --no-swcrc my-service/src/@types/Logger.ts [...] (all the other files here, making the command line long enough for Windows to complaint....)
Execution platform: @local_config_platform//:host
The command line is too long.

🌍 Your Environment

Operating System:

  
Windows 10
  

Output of bazel version:

  
4.2.2
  

Rules_nodejs version:

  
4.6.1. Issue also happens when testing with the latest as now (5.1.0).
  
@mattem
Copy link
Collaborator

mattem commented Feb 26, 2022

This doesn't seem like an rnj issue, but a bug in rules_swc.
The swc rule incorrect reuses the same args object for each iteration when transpiling src files. I'll close this issue and open one on rules_swc and put in a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants