@@ -33,9 +33,6 @@ def create_venv_app_files(ctx, deps, venv_dir_map):
3333 {type}`struct` with the following attributes:
3434 * {type}`list[File]` `venv_files` additional files created for
3535 the venv.
36- * {type}`dict[str, File]` `runfiles_symlinks` map intended for
37- the `runfiles.symlinks` argument. A map of main-repo
38- relative paths to File.
3936 """
4037
4138 # maps venv-relative path to the runfiles path it should point to
@@ -49,31 +46,25 @@ def create_venv_app_files(ctx, deps, venv_dir_map):
4946
5047 link_map = build_link_map (ctx , entries )
5148 venv_files = []
52- runfiles_symlinks = {}
5349
5450 for kind , kind_map in link_map .items ():
5551 base = venv_dir_map [kind ]
5652 for venv_path , link_to in kind_map .items ():
5753 bin_venv_path = paths .join (base , venv_path )
58- if is_file (link_to ):
59- symlink_from = "{}/{}" .format (ctx .label .package , bin_venv_path )
60- runfiles_symlinks [symlink_from ] = link_to
61-
62- else :
63- venv_link = ctx .actions .declare_symlink (bin_venv_path )
64- venv_link_rf_path = runfiles_root_path (ctx , venv_link .short_path )
65- rel_path = relative_path (
66- # dirname is necessary because a relative symlink is relative to
67- # the directory the symlink resides within.
68- from_ = paths .dirname (venv_link_rf_path ),
69- to = link_to ,
70- )
71- ctx .actions .symlink (output = venv_link , target_path = rel_path )
72- venv_files .append (venv_link )
54+ link_to_path = link_to .short_path if is_file (link_to ) else link_to
55+ venv_link = ctx .actions .declare_symlink (bin_venv_path )
56+ venv_link_rf_path = runfiles_root_path (ctx , venv_link .short_path )
57+ rel_path = relative_path (
58+ # dirname is necessary because a relative symlink is relative to
59+ # the directory the symlink resides within.
60+ from_ = paths .dirname (venv_link_rf_path ),
61+ to = link_to_path ,
62+ )
63+ ctx .actions .symlink (output = venv_link , target_path = rel_path )
64+ venv_files .append (venv_link )
7365
7466 return struct (
7567 venv_files = venv_files ,
76- runfiles_symlinks = runfiles_symlinks ,
7768 )
7869
7970# Visible for testing
0 commit comments