[ts_project] using Angular compiler with composite = True errors because ngc doesn't generate .tsbuildinfo #2885
Labels
Can Close?
We will close this in 30 days if there is no further activity
馃悶 bug report
Affected Rule
ts_project
Is this a regression?
n/a
Description
In
ts_project
, the.tsbuildinfo
file is declared as an output so that bazel will delete the file when re-building the rule. However,ngc
does not generate.tsbuildinfo
files because it does not support tsc incremental mode:angular/angular#42011
Passing
ts_build_info_file = None
as an attribute on thets_project
rule doesn't work, as the implementation defaults the downstream attribute:My current workaround is to patch
ts_project.bzl
to comment out:buildinfo_out = tsbuildinfo_path if composite or incremental else None,
and replace with
buildinfo_out = None
but this is too blunt an instrument and will cause bazel not to delete
.tsbuildinfo
files when it would be present e.g,. through nontsc = ngc
rules.I'm not sure what the best way to fix this would be. Seems we more or less want
buildinfo_out = if tsc is ngc then None else regular_buildinfo_out
But this means encoding the ngc
node_binary
target intots_project
, which seems nasty.A cleaner alternative is to add a new attribute
force_no_tsbuildinfo_path
.If someone who knows more about this codebase and best practices can lend some advice, I am happy to take a stab at implementing a fix.
馃敩 Minimal Reproduction
https://github.com/matthewjh/rules_nodejs/tree/ngc_tsbuildinfo_error_repo
bazel build //packages/typescript/test/ts_project/a:tsconfig
馃敟 Exception or Error
馃實 Your Environment
Operating System:
Output of
bazel version
:Rules_nodejs version:
(Please check that you have matching versions between WORKSPACE file and
@bazel/*
npm packages.)The text was updated successfully, but these errors were encountered: