From ab59b78287ffc5a40ff4a69f171f6a2fb0e630aa Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Fri, 18 Sep 2026 18:35:13 +0000 Subject: [PATCH] Support `env_inherit` in `workspace_root_test` (#46534) Add an `env_inherit` string-list attribute and pass it to `RunEnvironmentInfo.inherited_environment`, allowing tests to inherit selected environment variables from the calling environment. GitOrigin-RevId: 4ea868bda2d80dd57a8fc139ffa9625cb8311b37 --- defs.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/defs.bzl b/defs.bzl index 7d2ea81faf..1aba4f274c 100644 --- a/defs.bzl +++ b/defs.bzl @@ -98,6 +98,7 @@ def _workspace_root_test_impl(ctx): ), RunEnvironmentInfo( environment = env, + inherited_environment = ctx.attr.env_inherit, ), ] @@ -153,6 +154,7 @@ workspace_root_test = rule( allow_files = True, ), "env": attr.string_dict(), + "env_inherit": attr.string_list(), "runfile_env": attr.label_keyed_string_dict( cfg = "target", ),