Skip to content

Commit 7b63789

Browse files
committed
always use declare_symlink
1 parent a737b26 commit 7b63789

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

python/private/py_executable_bazel.bzl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,16 @@ def _create_venv(ctx, output_prefix, imports, runtime_details):
362362
runtime = runtime_details.effective_runtime
363363
if runtime.interpreter:
364364
py_exe_basename = paths.basename(runtime.interpreter.short_path)
365-
interpreter = ctx.actions.declare_file("{}/bin/{}".format(venv, py_exe_basename))
366-
ctx.actions.symlink(output = interpreter, target_file = runtime.interpreter)
365+
366+
##interpreter = ctx.actions.declare_file("{}/bin/{}".format(venv, py_exe_basename))
367+
##ctx.actions.symlink(output = interpreter, target_file = runtime.interpreter)
368+
interpreter = ctx.actions.declare_symlink("{}/bin/{}".format(venv, py_exe_basename))
367369
interpreter_actual_path = runtime.interpreter.short_path
370+
parent = "/".join([".."] * (interpreter_actual_path.count("/") + 1))
371+
rel_path = parent + "/" + interpreter_actual_path
372+
ctx.actions.symlink(output = interpreter, target_path = rel_path)
373+
##interpreter_actual_path = runtime.interpreter.short_path
374+
368375
else:
369376
py_exe_basename = paths.basename(runtime.interpreter_path)
370377
interpreter = ctx.actions.declare_symlink("{}/bin/{}".format(venv, py_exe_basename))

python/private/stage1_bootstrap_template.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ if [[ "$IS_ZIPFILE" == "1" ]]; then
129129
mkdir -p "$(dirname $python_exe)"
130130
ln -s "$symlink_to" "$python_exe"
131131
else
132-
set -x
133-
stat "$python_exe"
134-
ls -l $(dirname $python_exe)
135-
set +x
132+
:
133+
#set -x
134+
#stat "$python_exe"
135+
#ls -l $(dirname $python_exe)
136+
#set +x
136137
fi
137138

138139
# At this point, we should have a valid reference to the interpreter.

0 commit comments

Comments
 (0)