From 2ea030c2c5810681ef911c4a659e25ae0a596752 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 13 Feb 2019 16:15:13 +0800 Subject: [PATCH] fix(bazel): Turn on strict action env (#28675) This commit fixes a bug whereby recompilation occurs every time `yarn ng build` or `yarn bazel build ...` is invoked. This is a temporary solution until # https://github.com/bazelbuild/bazel/issues/7026 is fixed. PR Close #28675 --- .../bazel-workspace/files/__dot__bazelrc.template | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/bazel/src/schematics/bazel-workspace/files/__dot__bazelrc.template b/packages/bazel/src/schematics/bazel-workspace/files/__dot__bazelrc.template index a40483eeac..1b544399da 100644 --- a/packages/bazel/src/schematics/bazel-workspace/files/__dot__bazelrc.template +++ b/packages/bazel/src/schematics/bazel-workspace/files/__dot__bazelrc.template @@ -13,6 +13,16 @@ build --strategy=AngularTemplateCompile=worker # `bazel-out` directory that is created in the workspace root. build --symlink_prefix=dist/ +# Turn on --incompatible_strict_action_env which was on by default +# in Bazel 0.21.0 but turned off again in 0.22.0. Follow +# https://github.com/bazelbuild/bazel/issues/7026 for more details. +# This flag is needed to so that the bazel cache is not invalidated +# when running bazel via `yarn bazel`. +# See https://github.com/angular/angular/issues/27514. +build --incompatible_strict_action_env +run --incompatible_strict_action_env +test --incompatible_strict_action_env + test --test_output=errors # Use the Angular 6 compiler