rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

googmodules example fails to compile prodmode with worker

Open JaredNeil opened this issue 6 years ago β€’ 5 comments

🐞 bug report

This bug was originally filed as https://github.com/bazelbuild/rules_typescript/issues/396, but has been ignored, so re-filing here now that rules_typescript was moved to this repository. It appears the referenced example was also lost in the transition.

Affected Rule

The issue is caused by the rule: ts_library

Is this a regression?

Yes.

Description

The prodmode compile of the googlemodules example fails while trying to write .externs.js when run in a worker.

πŸ”¬ Minimal Reproduction

  1. Checkout the latest release (https://github.com/bazelbuild/rules_typescript/releases/tag/0.22.1)
  2. Run bazel build //examples/googmodule --output_groups=es6_sources
  3. Notice compile error
  4. Comment out build --strategy=TypeScriptCompile=worker in .bazelrc
  5. Run bazel build //examples/googmodule --output_groups=es6_sources again.
  6. Notice successful compile

Also note: adding generate_externs = False, to the ts_library and adding "tsickleGenerateExterns": false, to the bazelOptions in tsconfig.json fail to prevent the error.

πŸ”₯ Exception or Error


ERROR: /home/jaredneil/code/rules_typescript/examples/googmodule/BUILD.bazel:5:1: Compiling TypeScript (prodmode) //examples/googmodule:googmodule failed (Exit 1)
Compilation failed Error: EACCES: permission denied, open 'bazel-out/k8-fastbuild/bin/examples/googmodule/googmodule.externs.js'
    at Object.openSync (fs.js:436:3)
    at Object.writeFileSync (fs.js:1187:35)
    at emitWithTsickle (/home/jaredneil/.cache/bazel/_bazel_jaredneil/19dfd516ff256fd1671b6233e232dcc8/execroot/build_bazel_rules_typescript/bazel-out/host/bin/external/build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.ts:323:8)
    at runFromOptions (/home/jaredneil/.cache/bazel/_bazel_jaredneil/19dfd516ff256fd1671b6233e232dcc8/execroot/build_bazel_rules_typescript/bazel-out/host/bin/external/build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.ts:242:19)
    at runOneBuild (/home/jaredneil/.cache/bazel/_bazel_jaredneil/19dfd516ff256fd1671b6233e232dcc8/execroot/build_bazel_rules_typescript/bazel-out/host/bin/external/build_bazel_rules_typescript/internal/tsc_wrapped/tsc_wrapped.ts:159:12)
    at Socket. (/home/jaredneil/.cache/bazel/_bazel_jaredneil/19dfd516ff256fd1671b6233e232dcc8/execroot/build_bazel_rules_typescript/bazel-out/host/bin/external/build_bazel_rules_typescript/internal/tsc_wrapped/worker.ts:112:26)
    at Socket.emit (events.js:182:13)
    at emitReadable_ (_stream_readable.js:534:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Target //examples/googmodule:googmodule failed to build

🌍 Your Environment

Operating System:

  
Ubuntu 18.04.1 LTS
  

Output of bazel version:

  
0.24.1
  

JaredNeil avatar May 09 '19 22:05 JaredNeil

bump

sgammon avatar Mar 23 '20 07:03 sgammon

This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

github-actions[bot] avatar Nov 18 '20 01:11 github-actions[bot]

I think this is still an issue. We got around it by commenting out the line that writes the externs file using patch-package.

JaredNeil avatar Nov 18 '20 18:11 JaredNeil

This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

github-actions[bot] avatar Apr 27 '21 01:04 github-actions[bot]

bump

sgammon avatar Feb 07 '22 02:02 sgammon

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