Skip to content

typescript: run tsc and the validator with their runfiles located on Windows (closes #13788) - #13857

Closed
TrapsterDK wants to merge 3 commits into
mainfrom
fix-13788-tsc-windows-runfiles
Closed

TrapsterDK wants to merge 3 commits into
mainfrom
fix-13788-tsc-windows-runfiles

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #13788

bazel_lib 3.8.0's Windows .bat launcher runs the sibling tsc.sh without exporting RUNFILES_MANIFEST_FILE, so the rules_js bash launcher looks for a missing tsc.sh.runfiles and every tsc action fails with RUNFILES environment variable is not set. Removal of the shim is tracked in #13889 (bazel-lib#1296); other JS tools in #13890.

  • javascript/private/windows_tool.bzl: windows_js_tool_shim writes a CRLF .bat that sets RUNFILES_MANIFEST_FILE to its own runfiles (which hold the tool's) and calls the inner launcher. js_build_tool defines an alias that selects the shim on @platforms//os:windows and the original tool elsewhere.
  • typescript/private/BUILD.bazel: :tsc and :validator via js_build_tool.
  • typescript/private/defs.bzl, typescript/private/quality/tsc.bzl: use those labels (tsc_worker unchanged).
  • typescript/tests/windows_tool_tests.bzl: analysis tests for shim content, runfiles, and the select on Windows and default platforms.

Local (linux):

  • bazel test //typescript/tests/... //typescript/private/... //javascript/private:all: 56 pass, 4 skipped.
  • bazel aquery 'deps(//typescript/tests/conformance:all)': all 54 Ts* action keys (TsProjectEmit/Check, TsValidateOptions, TscGate, TscDiagnostics) identical before and after.

Not run locally: //examples/adopt-polyglot:consumer_test (nested Bazel), Windows, windows_arm64.
Evidence (windows_x86_64, consumer_test + typescript conformance + windows_tool_tests): pending, https://github.com/devhusdk/rules_dx/actions/runs/44518078057. The previous run 44495950225 failed before testing at //tools/ci/producers:producers_bin ("module extension rules_python ... for platform os:windows,arch:amd64 does not exist in the lockfile"), which every Windows evidence run today hits.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

TrapsterDK and others added 2 commits November 19, 2026 10:23
…Windows (closes #13788)

The bazel_lib 3.8.0 Windows launcher starts the sibling bash script without
exporting a runfiles location, so js_binary tools in build actions fail with
"RUNFILES environment variable is not set". typescript_* now passes ts_project
an action_tool wrapper that sets RUNFILES_MANIFEST_FILE to its own runfiles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
…d by alias (#13788)

Replace action_tool with javascript/private/windows_tool.bzl: js_build_tool
defines an alias that selects windows_js_tool_shim on @platforms//os:windows
and the @npm_typescript launcher everywhere else, so Linux and macOS action
keys are unchanged. The quality tsc gate uses the same alias. Analysis tests
cover the shim content, its runfiles and the select on both platforms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Reworked to the planned alias+select shim (Linux/macOS action keys unchanged). Remaining: Windows evidence run 44518078057 must show consumer_test and conformance green; if it fails at producers_bin with the rules_python lockfile error, that is a CI infra break on every Windows evidence run, not this PR.

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Its commits landed in main via the squash merge of #13927 (stacked on this branch); this PR is now redundant.

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Superseded: its commits landed in main via #13927 (d738427), which closed #13788.

@TrapsterDK TrapsterDK closed this Nov 19, 2026
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

Successfully merging this pull request may close these issues.

adopt-polyglot: Windows tsc.bat fails with RUNFILES environment variable is not set

1 participant