[PATCH] D157830: [bazel] Use binary_alias instead of symlinks for ld.lld and friends
Angus Lees via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 19:58:00 PDT 2023
anguslees created this revision.
anguslees added a reviewer: MaskRay.
Herald added subscribers: jeroen.dobbelaere, sunfish.
Herald added a project: All.
anguslees requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.
Symlinks are poorly supported in Bazel+remote-exec. Create the links from `ld.lld`,
`ld64.lld`, `lld-link`, `wasm-ld` to `lld` using LLVM's `binary_alias` instead.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D157830
Files:
utils/bazel/llvm-project-overlay/lld/BUILD.bazel
Index: utils/bazel/llvm-project-overlay/lld/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/lld/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/lld/BUILD.bazel
@@ -4,6 +4,7 @@
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
load("//llvm:tblgen.bzl", "gentbl")
+load("//llvm:binary_alias.bzl", "binary_alias")
load(
"//:vars.bzl",
"LLVM_VERSION",
@@ -315,16 +316,15 @@
# macOS require that the binary be named "ld64.lld".
# Windows require that the binary be named "lld-link".
# WebAssembly builds require that the binary be named "wasm-ld".
-genrule(
- name = "gen_lld",
- srcs = [":lld"],
- outs = [
+[
+ binary_alias(
+ name = name,
+ binary = ":lld",
+ )
+ for name in [
"ld.lld",
"ld64.lld",
"lld-link",
"wasm-ld",
- ],
- cmd =
- "target=$$(basename $<); for n in ld.lld ld64.lld lld-link wasm-ld; do ln -sf $$target $(@D)/$$n; done",
- output_to_bindir = 1,
-)
+ ]
+]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157830.549776.patch
Type: text/x-patch
Size: 1068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230814/cb04b3bc/attachment.bin>
More information about the llvm-commits
mailing list