-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
Fully Compatible
-
ALL
-
CAR Team 2026-05-25
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The fail() call in the resmoke_suite_test macro is supposed to report when the suite YAML referenced by a target cannot be resolved via _resolve_suite_srcs (i.e. the config path is not present in SUITE_SELECTORS). Instead it crashes with a confusing Error: not all arguments converted during string formatting, hiding the real diagnostic.
The bug
fail("resmoke_suite_test '%s': no srcs provided and config '%s' not found in SUITE_SELECTORS. " + "Either provide explicit srcs or ensure the suite YAML has selector.roots." % (name, config))
In Starlark (and Python), % binds tighter than +. So this parses as:
A + (B % (name, config))
where A contains two %s placeholders (never substituted) and B contains zero %s placeholders (yet receives the (name, config) tuple). The % operation on B raises not all arguments converted during string formatting, which masks the real error.
Repro
Add a resmoke_suite_test(config = "//buildscripts/resmokeconfig:suites/nonexistent.yml") and run bazel build on its package. Instead of the intended error mentioning the missing config name, you get the formatting traceback.
Proposed fix
Parenthesize the concatenation (or use .format()) so % applies to the full message:
fail(("resmoke_suite_test '%s': no srcs provided and config '%s' not found in SUITE_SELECTORS. " + "Either provide explicit srcs or ensure the suite YAML has selector.roots.") % (name, config))