Skip to content

Commit 58cdc41

Browse files
committed
Set RUNPATH on liblivestatus.so
CMK-29420 Change-Id: I6ef3a3bff5856280afa01a8caff0c002d814080a
1 parent c7af6ef commit 58cdc41

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

packages/livestatus/.f12

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ROOT=/omd/sites/$SITE
1414
test -d "${ROOT}" || exit 1
1515

16-
TARGET=":all"
16+
TARGET=":livestatus_shared_runpath"
1717
bazel build "${TARGET}"
1818
EXECUTION_ROOT=$(bazel info execution_root)
1919
for FILE in $(bazel cquery --output=files "${TARGET}"); do
@@ -22,7 +22,6 @@
2222
case "${BASENAME}" in
2323
liblivestatus.so)
2424
install --mode 644 "${FULL_PATH}" "${ROOT}/lib/liblivestatus.so.0.1"
25-
patchelf --set-rpath "\$ORIGIN/../lib" "${ROOT}/lib/liblivestatus.so.0.1"
2625
;;
2726
esac
2827
done

packages/livestatus/BUILD

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("@bazel_skylib//rules:build_test.bzl", "build_test")
22
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "pkg_mklink")
33
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
4+
load("//bazel/rules:patchelf.bzl", "set_runpath")
45
load("//bazel/rules:xcomp/cc.bzl", "cc_library", "cc_test")
56

67
cc_library(
@@ -78,11 +79,18 @@ cc_shared_library(
7879
],
7980
)
8081

82+
set_runpath(
83+
name = "livestatus_shared_runpath",
84+
srcs = [":livestatus_shared"],
85+
rpaths = ["$ORIGIN"],
86+
tags = ["manual"],
87+
)
88+
8189
pkg_files(
8290
name = "livestatus_shared_files",
83-
srcs = [":livestatus_shared"],
91+
srcs = [":livestatus_shared_runpath"],
8492
prefix = "lib",
85-
renames = {":livestatus_shared": "liblivestatus.so.0.1"},
93+
renames = {":livestatus_shared_runpath": "liblivestatus.so.0.1"},
8694
)
8795

8896
pkg_mklink(

0 commit comments

Comments
 (0)