Skip to content

Commit 7cfc71c

Browse files
committed
Apply suggestions from code review
1 parent b9d0fa4 commit 7cfc71c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

go/private/rpath.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,11 @@ def _rpath(go, library, executable = None):
3939
# 1. Where the executable is inside its own .runfiles directory.
4040
# This is the case for generated libraries as well as remote builds.
4141
# a) go back to the runfiles root from the executable file in .runfiles
42-
executable_rloc = _rlocation_path(go._ctx, executable)
43-
depth = executable_rloc.count("/")
42+
depth = _rlocation_path(go._ctx, executable).count("/")
4443
back_to_root = paths.join(*([".."] * depth))
4544

4645
# b) then walk back to the library's dir within runfiles dir.
47-
library_rloc = _rlocation_path(go._ctx, library)
48-
rpaths.append(paths.join(origin, back_to_root, paths.dirname(library_rloc)))
46+
rpaths.append(paths.join(origin, back_to_root, paths.dirname(_rlocation_path(go._ctx, library))))
4947

5048
# 2. Where the executable is outside the .runfiles directory:
5149
# This is the case for local pre-built libraries, as well as local

0 commit comments

Comments
 (0)