From d12db4e114bc76226b5263b0336f3400fd63be2b Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Mon, 14 Jan 2019 22:15:18 +0100 Subject: [PATCH] fix(bazel): incorrectly always uses ngc-wrapped from "npm" workspace (#28137) * This is a follow-up to https://github.com/angular/angular/commit/cd0451305a819548e2816e84c9271c61001897e7 which fixes that "ngc-wrapped" from the "npm" workspace is always used if "angular" is fetched as an external dependency. PR Close #28137 --- packages/bazel/src/esm5.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/bazel/src/esm5.bzl b/packages/bazel/src/esm5.bzl index adbec24c5d..43c6ff03fe 100644 --- a/packages/bazel/src/esm5.bzl +++ b/packages/bazel/src/esm5.bzl @@ -96,10 +96,10 @@ def _esm5_outputs_aspect(target, ctx): compiler = ctx.executable._ngc_wrapped # BEGIN-INTERNAL - # If the "replay_compiler" path refers to "ngc_wrapped" from within the Angular workspace, - # we need to use "ngc_wrapped" from source. This is necessary because we don't have - # a "npm" workspace with the "@angular/bazel" NPM package installed. - if not replay_compiler_path.startswith("../"): + # If the "replay_compiler" path does not refer to "ngc_wrapped" from the "@npm" workspace, + # we use "ngc_wrapped" from within the Angular workspace. This is necessary because we + # don't have a "npm" workspace with the "@angular/bazel" NPM package installed. + if replay_compiler_path != ctx.executable._ngc_wrapped.short_path: compiler = ctx.executable._internal_ngc_wrapped # END-INTERNAL