Skip to content

Commit

Permalink
Demonstrate failure when srcs is a binary rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ewianda committed Jan 22, 2025
1 parent 0e4d8de commit 6340e9f
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions lib/tests/tar/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ load("@aspect_bazel_lib//lib:copy_directory.bzl", "copy_directory")
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
load("@aspect_bazel_lib//lib:tar.bzl", "mtree_mutate", "mtree_spec", "tar")
load("@aspect_bazel_lib//lib:testing.bzl", "assert_archive_contains")
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load(":asserts.bzl", "assert_tar_listing", "assert_unused_listing")
load(":node_modules_tree.bzl", "node_modules_tree")
Expand Down Expand Up @@ -511,10 +512,26 @@ node_modules_tree(
name = "e17_node_modules",
)

write_file(
name = "executable",
out = "executable.sh",
content = [
"#!/usr/bin/env bash",
],
is_executable = True,
)

native_binary(
name = "e17_binary",
src = ":executable",
out = "native_binary_bin",
data = [":e17_node_modules"],
)

mtree_spec(
name = "mtree17",
srcs = [
":e17_node_modules",
":e17_binary",
],
)

Expand Down Expand Up @@ -546,7 +563,7 @@ assert_tar_listing(
mtree_mutate(
name = "resolve_symlinks",
srcs = [
":e17_node_modules",
":e17_binary",
],
mtree = ":mtree17",
preserve_symlinks = True,
Expand Down

0 comments on commit 6340e9f

Please sign in to comment.