From 6b77b7f87c7e6fc1c62b5680a61ec41ebd0c2d67 Mon Sep 17 00:00:00 2001 From: Michael Lee Date: Fri, 18 Mar 2022 15:34:02 -0700 Subject: [PATCH] Pass in //build_tools:pass_binary for configs expecting binaries Summary: For more context about what this diff is doing and why, see D844526. But in short, this diff modifies any BUILD/BUILD.in file that appears to be using `//build_tools:pass` as an exe so it instead uses `//build_tools:pass_binary`. Any other uses of the former were left untouched. My hope is that doing this will let us side-step the issue we discovered in https://github.com/bazelbuild/bazel/issues/14294 -- apparently, in Bazel 5.0, the default value of some flag was changed so that tests cannot be built as dependencies of non-test rules: https://github.com/bazelbuild/bazel/commit/ebac27ec5a6063556 While I don't really understand how our Dropbox-specific bazel stuff works, I'm guessing using `//build_tools:pass` (a test target) as an exe is probably not kosher now due to the above. This hypothesis does have one glaring hole: why is it fine to use `//build_tools/services:restart_test` as the test binary in build_tools/services/svc.bzl, but not `//build_tools:pass`? Both of them are test targets, so you would think that `restart_test` would also be breaking here. There are only three differences between these two targets: - `:restart_test` is located in the same dir as `svc.bzl` - `:restart_test` is a `dbx_sh_test` instead of a `sh_test` - `:restart_test` has the "manual" tag It's possible one of the above differences is responsible for making `:restart_test` work? But this works, so whatever. SEV: https://jira.dropboxer.net/browse/REL-8343 Test Plan: I arc-tested this against server-selective-kubernetes, and confirmed that all test failures related to this went green. GitOrigin-RevId: 510d1384be4f9caf8d94bc03e249dc8144c282e5 --- build_tools/services/svc.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build_tools/services/svc.bzl b/build_tools/services/svc.bzl index 9397ada2..d5cf0be5 100644 --- a/build_tools/services/svc.bzl +++ b/build_tools/services/svc.bzl @@ -748,7 +748,7 @@ def dbx_service_daemon( # Automatically verify that the service can start up correctly. test = Label("//build_tools/services:restart_test") if not idempotent: - test = Label("//build_tools:pass") + test = Label("//build_tools:pass_binary") dbx_services_test( name = name + "_service_test", test = test, @@ -798,7 +798,7 @@ def dbx_service_task( # Automatically verify that the service can start up correctly. test = Label("//build_tools/services:restart_test") if not idempotent: - test = Label("//build_tools:pass") + test = Label("//build_tools:pass_binary") dbx_services_test( name = name + "_service_test", test = test, @@ -831,7 +831,7 @@ def dbx_service_group( # Automatically verify that the service can start up correctly. test = Label("//build_tools/services:restart_test") if not idempotent: - test = Label("//build_tools:pass") + test = Label("//build_tools:pass_binary") dbx_services_test( name = name + "_service_test", test = test,