[Rpm-maint] [rpm-software-management/rpm] 4.18.99: broken off-source-tree install target (Issue #2650)

Tomasz Kłoczko notifications at github.com
Fri Sep 8 07:39:28 UTC 2023


>From https://github.com/rpm-software-management/rpm/issues/2649
I just realised that %_arch macro is not defined as well and I see in %install
```console
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.TkXan3
+ umask 022
+ cd /home/tkloczko/rpmbuild/BUILD
+ '[' '/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}' '!=' / ']'
+ rm -rf '/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}'
++ dirname '/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}'
+ /usr/bin/mkdir -p /home/tkloczko/rpmbuild/BUILDROOT
+ /usr/bin/mkdir '/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}'
+ ASMFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections'
+ CFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections'
+ CXXFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections'
+ FFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -I/usr/lib/gfortran/modules'
+ FCFLAGS='-O2 -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fdata-sections -ffunction-sections -I/usr/lib/gfortran/modules'
+ LDFLAGS='-Wl,--gc-sections -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--build-id=sha1'
+ RUSTFLAGS='-C codegen-units=1 -C debuginfo=2 -C opt-level=2 -C link-arg=-fdata-sections -C link-arg=-ffunction-sections -C link-arg=-Wl,--as-needed -C link-arg=-Wl,-z,now -C link-arg=-Wl,-z,relro --cap-lints=warn'
+ VALAFLAGS=-g
+ CC=/usr/bin/gcc
+ CXX=/usr/bin/g++
+ FC=/usr/bin/gfortran
+ AR=/usr/bin/gcc-ar
+ NM=/usr/bin/gcc-nm
+ RANLIB=/usr/bin/gcc-ranlib
+ export ASMFLAGS CFLAGS CXXFLAGS FFLAGS FCFLAGS LDFLAGS VALAFLAGS CC CXX FC AR NM RANLIB RUSTFLAGS VALAFLAGS
+ cd rpm-4.18.99
+ DESTDIR='/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}'
+ /usr/bin/cmake --install x86_64-redhat-linux
-- Install configuration: "RelWithDebInfo"
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/share/man/man1/gendiff.1

[..]

-- Set runtime path of "/home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/rpmuncompress" to ""
grep: rpmrc: No such file or directory
sed: can't read rpmrc: No such file or directory
cat: platform: No such file or directory
cat: macros: No such file or directory
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/macros
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/rpmrc
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/rpmpopt-4.18.99
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib64/pkgconfig/rpm.pc
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/lua
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib/rpm/macros.d
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib64/cmake/rpm/rpm-config.cmake
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib64/cmake/rpm/rpm-config-version.cmake
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib64/cmake/rpm/rpm-targets.cmake
-- Installing: /home/tkloczko/rpmbuild/BUILDROOT/rpm-4.18.99-2.fc35.%{_arch}/usr/lib64/cmake/rpm/rpm-targets-relwithdebinfo.cmake
```
Result is that it is packaged without file which contains %_arch macro definition.

Files like rpmrc, platform and macros are mot in source tree and they are generated to `${CMAKE_BINARY_DIR}` in cace of off-source tree build.
Here is the patch which fixes this issue
```patch
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,7 +162,9 @@
        install(CODE "execute_process(COMMAND
                ${CMAKE_COMMAND} -E env pkglibdir=${RPM_CONFIGDIR}
                        ${CMAKE_SOURCE_DIR}/installplatform
-                       rpmrc platform macros
+                       ${CMAKE_BINARY_DIR}/rpmrc
+                       ${CMAKE_BINARY_DIR}/platform
+                       ${CMAKE_BINARY_DIR}/macros
                        ${RPMCANONVENDOR} ${RPMCANONOS} ${RPMCANONGNU})"
        )
 endfunction()
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2650
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/2650 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230908/3291fa0e/attachment.html>


More information about the Rpm-maint mailing list