fix(bazel): correct expected outs for external sources in ng_module #22755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
ng_module rule does not compute correct expected_outs for external repository sources.
Issue Number: #22613
(Note: this PR replaces #22659)
/cc @alexeagle
I tried adding a test for this but could not find a way to have a local_repository use the ng_module rule in the parent repository.
The failure can be reproduced on this branch of angular-bazel-example: https://github.com/gregmagolan/angular-bazel-example/tree/ng_module_module_name_bug
The failure seen is:
Notice that the expected out file for index.ts in the
external_rule
local_repository isexternal/external_rule/../external_rule/index.ngfactory.js
. It should beexternal/external_rule/index.ngfactory.js
.What is the new behavior?
ng_module rule expected outs fixed to handle sources from external repository. If the source starts with
..
then the external repository name is dropped. In the above example, the expected out is correctly resolved toexternal/external_rule/index.ngfactory.js
.Does this PR introduce a breaking change?
Other information