diff --git a/src/BUILD.plz b/src/BUILD.plz index 549c304a57..a2d15c364d 100644 --- a/src/BUILD.plz +++ b/src/BUILD.plz @@ -48,3 +48,12 @@ filegroup( binary = True, visibility = ["//:install"], ) + +# On Linux, we should produce statically linked binaries. Emit a test to verify this is the case. +if is_platform(os = "linux"): + gentest( + name = "static_test", + test_cmd = "file $DATA | grep 'statically linked'", + data = [":please"], + no_test_output = True, + ) diff --git a/test/stamp/BUILD b/test/stamp/BUILD index f373bd2a19..5f08116be0 100644 --- a/test/stamp/BUILD +++ b/test/stamp/BUILD @@ -14,22 +14,3 @@ sh_test( src = "stamp_test.sh", data = [":stamp"], ) - -if is_platform(os = "linux"): - go_binary( - name = "stamp_static", - srcs = ["main.go"], - definitions = { - "github.com/thought-machine/please/test/stamp/lib.GitRevision": "$SCM_REVISION", - "github.com/thought-machine/please/test/stamp/lib.GitDescribe": "$SCM_DESCRIBE", - }, - stamp = True, - static = True, - deps = ["//test/stamp/lib"], - ) - - sh_test( - name = "stamp_test_static", - src = "stamp_test.sh", - data = [":stamp_static"], - )