@@ -117,7 +117,7 @@ def relative_path(from_, to):
117117def _current_interpreter_executable_impl (ctx ):
118118 toolchain = ctx .toolchains [TARGET_TOOLCHAIN_TYPE ]
119119 runtime = toolchain .py3_runtime
120- direct = []
120+ runfiles = []
121121
122122 # NOTE: We name the output filename after the underlying file name
123123 # because of things like pyenv: they use $0 to determine what to
@@ -135,7 +135,7 @@ def _current_interpreter_executable_impl(ctx):
135135 # in the hermetic toolchain.
136136 interpreter_basename = runtime .interpreter .basename
137137 executable = ctx .actions .declare_symlink ("bin/" + interpreter_basename )
138- direct .append (executable )
138+ runfiles .append (executable )
139139 interpreter_actual_path = runfiles_root_path (ctx , runtime .interpreter .short_path )
140140 target_path = relative_path (
141141 # dirname is necessary because a relative symlink is relative to
@@ -152,11 +152,9 @@ def _current_interpreter_executable_impl(ctx):
152152 target_path = interpreter_basename + ".runfiles/" + interpreter_actual_path
153153 ctx .actions .symlink (output = executable , target_path = target_path )
154154 else :
155- interpreter_basename = paths .basename (runtime .interpreter_path )
156- executable = ctx .actions .declare_symlink (interpreter_basename )
157- direct .append (executable )
158- target_path = runtime .interpreter_path
159- ctx .actions .symlink (output = executable , target_path = target_path )
155+ executable = ctx .actions .declare_symlink (paths .basename (runtime .interpreter_path ))
156+ runfiles .append (executable )
157+ ctx .actions .symlink (output = executable , target_path = runtime .interpreter_path )
160158
161159 return [
162160 toolchain ,
0 commit comments