temp repro

This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent 747807f1ea
commit dea04a72d8
2 changed files with 29 additions and 1 deletions

14
BUILD
View File

@ -1,6 +1,6 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar") load("@bazel_tools//tools/build_defs/pkg:pkg.bzl", "pkg_tar")
load("//src/undocker:rules.bzl", "rootfs") load("//src/undocker:rules.bzl", "rootfs", "temp")
load( load(
"@io_bazel_rules_docker//container:container.bzl", "@io_bazel_rules_docker//container:container.bzl",
"container_bundle", "container_bundle",
@ -34,3 +34,15 @@ rootfs(
#src = "@alpine//image:image", #src = "@alpine//image:image",
src = ":alpine-container-plus", src = ":alpine-container-plus",
) )
filegroup(
name = "maingo",
srcs = ["main.go"],
visibility = ["//visibility:public"],
)
temp(
name = "temp",
data = ":maingo",
out = "maingo.txt",
)

View File

@ -33,3 +33,19 @@ rootfs = rule(
), ),
}, },
) )
def _temp_impl(ctx):
for f in ctx.files.data:
print(f.path)
ctx.actions.run_shell(
outputs = [ctx.outputs.out],
command = "find $@",
)
temp = rule(
implementation = _temp_impl,
attrs = {
"data": attr.label(mandatory = True, allow_single_file = True),
"out": attr.output(mandatory = True)
},
)