Skip to content

Commit 9e7ba25

Browse files
gregmagolanmmalerba
authored andcommitted
build: try/catch the @angular/bazel rules_nodejs 1.0.0 patch (#18118)
This is needed for the material unit test to pass on angular repo in angular/angular#34589 otherwise the patch fails (since the changes are already made in that context) and throws and the CI job fails with: ``` if (config.fatal) throw e; ^ Error: exec: at Object.error (/tmp/material2/node_modules/shelljs/src/common.js:110:27) at execSync (/tmp/material2/node_modules/shelljs/src/exec.js:102:12) at String._exec (/tmp/material2/node_modules/shelljs/src/exec.js:205:12) at String.<anonymous> (/tmp/material2/node_modules/shelljs/src/common.js:335:23) at applyPatch (/tmp/material2/tools/bazel/postinstall-patches.js:186:26) at Object.<anonymous> (/tmp/material2/tools/bazel/postinstall-patches.js:35:1) at Module._compile (internal/modules/cjs/loader.js:936:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10) at Module.load (internal/modules/cjs/loader.js:790:32) at Function.Module._load (internal/modules/cjs/loader.js:703:12) error Command failed with exit code 1. ) ``
1 parent f2cbc06 commit 9e7ba25

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tools/bazel/postinstall-patches.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ shelljs.cd(projectDir);
2929
// Workaround for https://github.com/angular/angular/issues/18810.
3030
shelljs.exec('ngc -p angular-tsconfig.json');
3131

32-
// Temporary patch to make @angular/bazel compatible with rules_nodejs 1.0.0.
33-
// This is needed to resolve the dependency sandwich between angular components and
34-
// repo framework. It can be removed with a future @angular/bazel update.
35-
applyPatch(path.join(__dirname, './angular_bazel_rules_nodejs_1.0.0.patch'));
32+
try {
33+
// Temporary patch to make @angular/bazel compatible with rules_nodejs 1.0.0.
34+
// This is needed to resolve the dependency sandwich between angular components and
35+
// repo framework. It can be removed with a future @angular/bazel update.
36+
// try/catch needed for this the material CI tests to work in angular/repo
37+
applyPatch(path.join(__dirname, './angular_bazel_rules_nodejs_1.0.0.patch'));
38+
} catch (_) {}
3639

3740
// Temporary patch for ts-api-guardian to be compatible with rules_nodejs 1.0.0.
3841
// TODO: a new ts-api-guardian release is needed.

0 commit comments

Comments
 (0)