2020-08-25 19:21:37 +00:00
|
|
|
load("//tools:defs.bzl", "go_binary")
|
2018-04-27 17:37:02 +00:00
|
|
|
|
2020-01-27 18:04:07 +00:00
|
|
|
package(licenses = ["notice"])
|
2018-04-27 17:37:02 +00:00
|
|
|
|
|
|
|
go_binary(
|
|
|
|
name = "runsc",
|
|
|
|
srcs = [
|
|
|
|
"main.go",
|
2019-04-01 23:17:40 +00:00
|
|
|
"version.go",
|
2018-04-27 17:37:02 +00:00
|
|
|
],
|
2020-01-27 18:04:07 +00:00
|
|
|
pure = True,
|
2018-06-04 18:25:40 +00:00
|
|
|
visibility = [
|
2018-07-28 00:56:41 +00:00
|
|
|
"//visibility:public",
|
2018-06-04 18:25:40 +00:00
|
|
|
],
|
2019-09-10 22:41:47 +00:00
|
|
|
x_defs = {"main.version": "{STABLE_VERSION}"},
|
2020-10-19 23:26:42 +00:00
|
|
|
deps = ["//runsc/cli"],
|
2018-04-27 17:37:02 +00:00
|
|
|
)
|
2018-08-27 20:35:50 +00:00
|
|
|
|
|
|
|
# The runsc-race target is a race-compatible BUILD target. This must be built
|
2020-02-10 22:11:04 +00:00
|
|
|
# via: bazel build --features=race :runsc-race
|
2020-01-27 18:04:07 +00:00
|
|
|
#
|
|
|
|
# This is neccessary because the race feature must apply to all dependencies
|
|
|
|
# due a bug in gazelle file selection. The pure attribute must be off because
|
|
|
|
# the race detector requires linking with non-Go components, although we still
|
|
|
|
# require a static binary.
|
2018-08-27 20:35:50 +00:00
|
|
|
#
|
|
|
|
# Note that in the future this might be convertible to a compatible target by
|
|
|
|
# using the pure and static attributes within a select function, but select is
|
|
|
|
# not currently compatible with string attributes [1].
|
|
|
|
#
|
|
|
|
# [1] https://github.com/bazelbuild/bazel/issues/1698
|
|
|
|
go_binary(
|
|
|
|
name = "runsc-race",
|
|
|
|
srcs = [
|
|
|
|
"main.go",
|
2019-04-01 23:17:40 +00:00
|
|
|
"version.go",
|
2018-08-27 20:35:50 +00:00
|
|
|
],
|
2020-01-27 18:04:07 +00:00
|
|
|
static = True,
|
2018-08-27 20:35:50 +00:00
|
|
|
visibility = [
|
|
|
|
"//visibility:public",
|
|
|
|
],
|
2019-09-10 22:41:47 +00:00
|
|
|
x_defs = {"main.version": "{STABLE_VERSION}"},
|
2020-10-19 23:26:42 +00:00
|
|
|
deps = ["//runsc/cli"],
|
2018-08-27 20:35:50 +00:00
|
|
|
)
|
2019-05-03 18:42:25 +00:00
|
|
|
|
2019-09-10 22:41:47 +00:00
|
|
|
sh_test(
|
|
|
|
name = "version_test",
|
|
|
|
size = "small",
|
|
|
|
srcs = ["version_test.sh"],
|
2020-01-27 18:04:07 +00:00
|
|
|
args = ["$(location :runsc)"],
|
2019-09-12 21:55:24 +00:00
|
|
|
data = [":runsc"],
|
2020-02-03 20:08:46 +00:00
|
|
|
tags = ["noguitar"],
|
2019-09-10 22:41:47 +00:00
|
|
|
)
|