Skip to content

Commit

Permalink
build: update to more improved copy_to_bin rule.
Browse files Browse the repository at this point in the history
This is necessary as the current rule is not clever enough to detect
when a given file is already "generated" and inside `bin`.

This is important because `package.json` files are always copied to bin
for `npm_package`, but the `package.json` may already be copied from
e.g. `ts_project#data`. This shouldn't cause a Bazel action conflict.
  • Loading branch information
devversion authored and clydin committed Dec 16, 2024
1 parent 369a5fa commit 620671d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Re-export of some bazel rules with repository-wide defaults."""

load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
load("@aspect_bazel_lib//lib:utils.bzl", "to_label")
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin", _js_library = "js_library", _pkg_npm = "pkg_npm")
load("@build_bazel_rules_nodejs//:index.bzl", _js_library = "js_library", _pkg_npm = "pkg_npm")
load("@npm//@angular/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
load("@npm//@angular/build-tooling/bazel:extract_js_module_output.bzl", "extract_js_module_output")
load("@npm//@bazel/concatjs:index.bzl", _ts_library = "ts_library")
Expand Down Expand Up @@ -184,7 +185,10 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
"substituted/": "",
},
exclude_srcs_patterns = [
"packages/**/*", # Exclude compiled outputs of dependent packages
# Exclude compiled outputs of dependent packages
"packages/**/*",
# Exclude `node_modules` which may be pulled by the `js_module_output` runfiles.
"node_modules/**/*",
],
allow_overwrites = True,
)
Expand Down

0 comments on commit 620671d

Please sign in to comment.