gvisor.dev/gvisor@v0.0.0-20240520182842-f9d4d51c7e0f/runsc/BUILD (about) 1 load("//tools:defs.bzl", "go_binary") 2 3 package( 4 default_applicable_licenses = ["//:license"], 5 licenses = ["notice"], 6 ) 7 8 go_binary( 9 name = "runsc", 10 srcs = ["main.go"], 11 pure = True, 12 tags = ["staging"], 13 visibility = [ 14 "//visibility:public", 15 ], 16 x_defs = {"gvisor.dev/gvisor/runsc/version.version": "{STABLE_VERSION}"}, 17 deps = [ 18 "//runsc/cli", 19 "//runsc/version", 20 ], 21 ) 22 23 # The runsc-race target is a race-compatible BUILD target. This must be built 24 # via: bazel build --features=race :runsc-race 25 # 26 # This is neccessary because the race feature must apply to all dependencies 27 # due a bug in gazelle file selection. The pure attribute must be off because 28 # the race detector requires linking with non-Go components, although we still 29 # require a static binary. 30 # 31 # Note that in the future this might be convertible to a compatible target by 32 # using the pure and static attributes within a select function, but select is 33 # not currently compatible with string attributes [1]. 34 # 35 # [1] https://github.com/bazelbuild/bazel/issues/1698 36 go_binary( 37 name = "runsc-race", 38 srcs = ["main.go"], 39 gotags = ["lockdep"], 40 static = True, 41 visibility = [ 42 "//visibility:public", 43 ], 44 x_defs = {"gvisor.dev/gvisor/runsc/version.version": "{STABLE_VERSION}"}, 45 deps = [ 46 "//runsc/cli", 47 "//runsc/version", 48 ], 49 ) 50 51 sh_test( 52 name = "version_test", 53 size = "small", 54 srcs = ["version_test.sh"], 55 args = ["$(location :runsc)"], 56 data = [":runsc"], 57 )