Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Error when adding --strategy=TypeScriptCompile=worker #220

@mattem

Description

@mattem

The following error is thrown when using the worker strategy with the Typescript Compiler

bazel.rc

build --strategy=TypeScriptCompile=worker
build --symlink_prefix=dist/

output

INFO: Analysed target //app:devserver (2 packages loaded).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_matt/3fed23a2ef51f4f0c7bcf4b6ca1a97a8/external/rxjs/BUILD.bazel:7:1: Compiling TypeScript (devmode) @rxjs//:lib failed: Worker process did not return a WorkResponse:

---8<---8<--- Start of log, file at /private/var/tmp/_bazel_matt/3fed23a2ef51f4f0c7bcf4b6ca1a97a8/bazel-workers/worker-0-TypeScriptCompile.log ---8<---8<---
Starting TypeScript compiler persistent worker...

/private/var/tmp/_bazel_matt/3fed23a2ef51f4f0c7bcf4b6ca1a97a8/execroot/fabrik/external/build_bazel_rules_typescript/internal/tsc_wrapped/worker.ts:117
      process.stdout.write(new workerpb.WorkResponse()
                           ^
TypeError: workerpb.WorkResponse is not a constructor
    at Socket.<anonymous> (/private/var/tmp/_bazel_matt/3fed23a2ef51f4f0c7bcf4b6ca1a97a8/execroot/fabrik/external/build_bazel_rules_typescript/internal/tsc_wrapped/worker.ts:117:28)
    at emitNone (events.js:106:13)
    at Socket.emit (events.js:208:7)
    at emitReadable_ (_stream_readable.js:513:10)
    at emitReadable (_stream_readable.js:507:7)
    at addChunk (_stream_readable.js:274:7)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)
---8<---8<--- End of log ---8<---8<---
Target //app:devserver failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 25.220s, Critical Path: 8.61s
INFO: 14 processes: 6 darwin-sandbox, 8 local.
FAILED: Build did NOT complete successfully

bazel version:

release: release 0.14.1-homebrew

rules_typescript version:

http_archive(
    name = "build_bazel_rules_typescript",
    url = "https://github.com/bazelbuild/rules_typescript/archive/0.15.0.zip",
    strip_prefix = "rules_typescript-0.15.0",
    sha256 = "1aa75917330b820cb239b3c10a936a10f0a46fe215063d4492dd76dc6e1616f4",
)

I tried hacking around to change worker.ts to the protobuf js syntax, but I hit errors about invalid buffers and out of range indexes, and couldn't find any docs on the API between Bazel server and the workers. If someone can provide some in site I can put a PR together if this is the right direction.

const out = workerpb.WorkResponse
          .encodeDelimited({ exit_code: exitCode, output: consoleOutput })
          .finish();
process.stdout.write(out);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions