Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove declare_symlink use #4345

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ build:linux --define=pfm=1
# Enable TCMalloc on Linux as well.
build:linux --custom_malloc=@tcmalloc//tcmalloc

# Disables `actions.declare_symlink`. Done for cross-environment support.
build --allow_unresolved_symlinks=false

# Allow users to override any of the flags desired by importing a user-specific
# RC file here if present.
try-import %workspace%/user.bazelrc
3 changes: 2 additions & 1 deletion toolchain/install/install_filegroups.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ def make_install_filegroups(name, no_driver_name, pkg_name, install_dirs, prefix
strip_prefix = strip_prefix.from_pkg(prefix),
)
elif "symlink" in entry:
symlink_to = "{0}/{1}/{2}".format(prefix, dir, entry["symlink"])
symlink_file(
name = prefixed_path,
symlink_relative = entry["symlink"],
symlink_label = symlink_to,
)
pkg_mklink(
name = pkg_path,
Expand Down
7 changes: 0 additions & 7 deletions toolchain/install/symlink_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ def _symlink_file_impl(ctx):
output = out,
target_file = ctx.file.symlink_label,
)
elif ctx.attr.symlink_relative:
out = ctx.actions.declare_symlink(ctx.label.name)
ctx.actions.symlink(
output = out,
target_path = ctx.attr.symlink_relative,
)
else:
fail("Missing symlink target")

Expand All @@ -79,6 +73,5 @@ symlink_file = rule(
cfg = "target",
),
"symlink_label": attr.label(allow_single_file = True),
"symlink_relative": attr.string(),
},
)
Loading