generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: flip unused_inputs=1 by default (#432)
### Changes are visible to end-users: yes/no - Searched for relevant documentation and updated as needed: yes - Breaking change (forces users to change their own code or config): no - Suggested release notes appear below: yes ### Test plan - New test cases added
- Loading branch information
Showing
9 changed files
with
2,554 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
load("//py:defs.bzl", "py_image_layer", "py_binary") | ||
load("asserts.bzl", "assert_tar_listing") | ||
|
||
platform( | ||
name = "linux_amd64", | ||
constraint_values = [ | ||
"@platforms//os:linux", | ||
"@platforms//cpu:x86_64", | ||
], | ||
) | ||
|
||
|
||
# Case 1: Basic usage | ||
py_binary( | ||
name = "my_app_bin", | ||
srcs = ["main.py"], | ||
) | ||
|
||
py_image_layer( | ||
name = "my_app_layers", | ||
binary = ":my_app_bin", | ||
platform = ":linux_amd64", | ||
) | ||
|
||
assert_tar_listing( | ||
name = "my_app_layers_test", | ||
actual = [":my_app_layers"], | ||
expected = ":my_app_layers.listing", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") | ||
|
||
# buildifier: disable=function-docstring | ||
def assert_tar_listing(name, actual, expected): | ||
actual_listing = "_{}_listing".format(name) | ||
native.genrule( | ||
name = actual_listing, | ||
srcs = actual, | ||
testonly = True, | ||
outs = ["_{}.listing".format(name)], | ||
cmd = 'echo $(SRCS) | TZ="UTC" LC_ALL="en_US.UTF-8" xargs -n 1 $(BSDTAR_BIN) --exclude "*/_repo_mapping" --exclude "**/tools/venv_bin/**" -tvf > $@'.format(actual), | ||
toolchains = ["@bsd_tar_toolchains//:resolved_toolchain"], | ||
) | ||
|
||
write_source_file( | ||
name = name, | ||
in_file = actual_listing, | ||
out_file = expected, | ||
testonly = True, | ||
tags = ["skip-on-bazel6"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Hello!!") |
Oops, something went wrong.