Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,32 @@ copyright_checker(
visibility = ["//visibility:public"],
)

# Needed for Dash tool to check python dependency licenses.
# This is a workaround to filter out local packages from the Cargo.lock file.
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'depenendencies' to 'dependencies' in comment.

Copilot uses AI. Check for mistakes.
# The tool is intended for third-party content.
genrule(
name = "filtered_cargo_lock",
srcs = ["Cargo.lock"],
outs = ["Cargo.lock.filtered"],
cmd = """
awk '
BEGIN { skip = 0; data = "" }
/^\\[\\[package\\]\\]/ {
if (data != "" && !skip) print data;
skip = 1;
data = $$0;
next;
}
data != "" { data = data "\\n" $$0 }
# any package that has a "source = " line will not be skipped.
/^source = / { skip = 0 }
END { if (data != "" && !skip) print data }
' $(location Cargo.lock) > $@
""",
)

dash_license_checker(
src = "//examples:cargo_lock",
src = ":filtered_cargo_lock",
file_type = "", # let it auto-detect based on project_config
project_config = PROJECT_CONFIG,
visibility = ["//visibility:public"],
Expand Down
Loading