From 1637bb2fda4893c486eacb51cf9e8e8b007ea705 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Thu, 30 Jul 2026 08:08:16 +0000 Subject: [PATCH] build: use genrule for best practices copy Replaces `copy_file` with `genrule` in `packages/schematics/angular/BUILD.bazel` to depend explicitly on `//:node_modules/@angular/core/dir`. When `@angular/core` is linked as a directory tree artifact, referencing an internal file label directly without depending on the directory artifact causes Bazel's sandbox not to stage `@angular/core` into the sandbox, failing with `cp: cannot stat 'node_modules/@angular/core/resources/best-practices.md'`. --- packages/schematics/angular/BUILD.bazel | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/schematics/angular/BUILD.bazel b/packages/schematics/angular/BUILD.bazel index b4fc4e885c30..34d730f2aa6d 100644 --- a/packages/schematics/angular/BUILD.bazel +++ b/packages/schematics/angular/BUILD.bazel @@ -3,7 +3,6 @@ # Use of this source code is governed by an MIT-style license that can be # found in the LICENSE file at https://angular.dev/license -load("@bazel_skylib//rules:copy_file.bzl", "copy_file") load("@npm//:defs.bzl", "npm_link_all_packages") load("//tools:defaults.bzl", "copy_to_bin", "jasmine_test", "npm_package", "ts_project") load("//tools:ts_json_schema.bzl", "ts_json_schema") @@ -46,10 +45,11 @@ copy_to_bin( srcs = glob(["**/schema.json"]), ) -copy_file( +genrule( name = "angular_best_practices", - src = "//:node_modules/@angular/core/resources/best-practices.md", - out = "ai-config/files/__bestPracticesName__.template", + srcs = ["//:node_modules/@angular/core/dir"], + outs = ["ai-config/files/__bestPracticesName__.template"], + cmd = "cp $(execpath //:node_modules/@angular/core/dir)/resources/best-practices.md $@", ) RUNTIME_ASSETS = [