Skip to content

Commit

Permalink
Pass in //build_tools:pass_binary for configs expecting binaries
Browse files Browse the repository at this point in the history
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 bazelbuild/bazel#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:
bazelbuild/bazel@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
  • Loading branch information
MichaelLeeDBX authored and jhance committed Mar 23, 2022
1 parent 7fcb7cc commit 6b77b7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build_tools/services/svc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6b77b7f

Please sign in to comment.