summaryrefslogtreecommitdiffhomepage
path: root/pkg/seccomp/BUILD
blob: 742c8b79b84c82c1a1c3d28e16f544b0589b5a46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
load("//tools:defs.bzl", "go_binary", "go_embed_data", "go_library", "go_test")

package(licenses = ["notice"])

go_binary(
    name = "victim",
    testonly = 1,
    srcs = ["seccomp_test_victim.go"],
    deps = [":seccomp"],
)

go_embed_data(
    name = "victim_data",
    testonly = 1,
    src = "victim",
    package = "seccomp",
    var = "victimData",
)

go_library(
    name = "seccomp",
    srcs = [
        "seccomp.go",
        "seccomp_amd64.go",
        "seccomp_arm64.go",
        "seccomp_rules.go",
        "seccomp_unsafe.go",
    ],
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/abi/linux",
        "//pkg/bpf",
        "//pkg/log",
    ],
)

go_test(
    name = "seccomp_test",
    size = "small",
    srcs = [
        "seccomp_test.go",
        ":victim_data",
    ],
    library = ":seccomp",
    deps = [
        "//pkg/abi/linux",
        "//pkg/binary",
        "//pkg/bpf",
    ],
)