diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index 466d787a2f..6f923e18fb 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -729,7 +729,7 @@ def rustc_compile_action( stamp = stamp, ) - args, env = construct_arguments( + args, env_from_args = construct_arguments( ctx = ctx, attr = attr, file = ctx.file, @@ -749,6 +749,9 @@ def rustc_compile_action( stamp = stamp, ) + env = dict(ctx.configuration.default_shell_env) + env.update(env_from_args) + if hasattr(attr, "version") and attr.version != "0.0.0": formatted_version = " v{}".format(attr.version) else: