Skip to content

Commit ed262de

Browse files
committed
rpm: suppress invalid RPATHSs such as /opt/fluent/lib
It will fix the following ERROR: ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/json-2.9.0/json/ext/parser.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ******************************************************************************* * * WARNING: 'check-rpaths' detected a broken RPATH OR RUNPATH and will cause * 'rpmbuild' to fail. To ignore these errors, you can set the * '$QA_RPATHS' environment variable which is a bitmask allowing the * values below. The current value of QA_RPATHS is 0x0000. * * 0x0001 ... standard RPATHs (e.g. /usr/lib); such RPATHs are a minor * issue but are introducing redundant searchpaths without * providing a benefit. They can also cause errors in multilib * environments. * 0x0002 ... invalid RPATHs; these are RPATHs which are neither absolute * nor relative filenames and can therefore be a SECURITY risk * 0x0004 ... insecure RPATHs; these are relative RPATHs which are a * SECURITY risk * 0x0008 ... the special '$ORIGIN' RPATHs are appearing after other * RPATHs; this is just a minor issue but usually unwanted * 0x0010 ... the RPATH is empty; there is no reason for such RPATHs * and they cause unneeded work while loading libraries * 0x0020 ... an RPATH references '..' of an absolute path; this will break * the functionality when the path before '..' is a symlink * * * Examples: * - to ignore standard and empty RPATHs, execute 'rpmbuild' like * $ QA_RPATHS=$(( 0x0001|0x0010 )) rpmbuild my-package.src.rpm * - to check existing files, set $RPM_BUILD_ROOT and execute check-rpaths like * $ RPM_BUILD_ROOT=<top-dir> /usr/lib/rpm/check-rpaths * ******************************************************************************* ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/cmetrics-0.3.3/cmetrics/cmetrics.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/systemd-journal-2.0.0/systemd/journal/shim.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/rbs-2.8.2/rbs_extension.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/strptime-0.2.5/strptime/strptime.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/capng_c-0.2.3/capng/capng.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/cool.io-1.8.1/cool.io_ext.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/yajl-ruby-1.4.3/yajl/yajl.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/cool.io-1.8.1/iobuffer_ext.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/nio4r-2.7.4/nio4r_ext.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] ERROR 0002: file '/opt/fluent/lib/ruby/gems/3.2.0/extensions/aarch64-linux/3.2.0/msgpack-1.7.3/msgpack/msgpack.so' contains an invalid rpath '/opt/fluent/lib' in [/opt/fluent/lib] Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent ef39b90 commit ed262de

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/yum/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ run cp \
112112
run cat <<BUILD > build.sh
113113
#!/bin/bash
114114
115-
rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${PACKAGE}.spec
115+
# Ignore invalid RPATHS such as /opt/fluent/lib
116+
QA_RPATHS=$(( 0x0002 )) rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${PACKAGE}.spec
116117
BUILD
117118
run chmod +x build.sh
118119
if [ -n "${DEVTOOLSET_VERSION:-}" ]; then

0 commit comments

Comments
 (0)