Skip to content

Commit 362c9c8

Browse files
authored
Fast-path _expand_location_for_build_script_runner (#3637)
Before: <img width="1172" height="180" alt="image" src="https://github.com/user-attachments/assets/00417d21-2a1c-439f-9aa7-85635f0741ac" /> After: <img width="1159" height="177" alt="image" src="https://github.com/user-attachments/assets/7925646c-420e-4db0-9177-d4b08fc7bef0" />
1 parent ab10c8b commit 362c9c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rust/private/utils.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,11 @@ def _expand_location_for_build_script_runner(ctx, env, data, known_variables):
270270
Returns:
271271
string: The location-macro expanded version of the string.
272272
"""
273+
274+
# Fast-path - both location expansions and make vars have a `$` so we can short-circuit everything.
275+
if "$" not in env:
276+
return env
277+
273278
for directive in ("$(execpath ", "$(location "):
274279
if directive in env:
275280
# build script runner will expand pwd to execroot for us

0 commit comments

Comments
 (0)