[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] issue with CPack: RPM package was not generated!
From:       Eric Noulard <eric.noulard () gmail ! com>
Date:       2018-07-31 13:11:07
Message-ID: CAPASGLpWEAH_ML1jR9-JJtp6UdBfOEdetn7J97ZRsosyNxGWoQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi Miroslav,

Do you need something very specific that you need a custom spec file?
If this is not the case you should try to let CPackRPM generate the spec
file for you.

This "USER spec file" feature was designed (quite a long time ago) when
CPackRPM was lacking some features that came in after that.
It was a debug & developer feature as well in order to ease CPackRPM
evolution.
This was made public in order to be able to "unblock" user before they get
the awaited feature in next CPackRPM release.
The USER spec file cannot be as rich as a "standard RPM spec file" there is
some restriction in what you can write in it.

In any case you can try to switch on CPackRPM debug output:
cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM

You should be able to get more detail about the failure.
In this mode CPack RPM will tell you where is the log/err file you can
inspect to know more.


Le mar. 31 juil. 2018 Ã  14:49, Miroslav Kubiczek <
miroslav.kubiczek@gmail.com> a écrit :

> yes, there are install commands, one of CMakeLists.txt content:
>
> install(DIRECTORY ${PROJECT_SOURCE_DIR}/api/rest DESTINATION include)
> install(TARGETS Rest DESTINATION lib)
>
> I can see these files after running the 'make package':
> $ find ./_CPack_Packages/Linux/
> ./_CPack_Packages/Linux/
> ./_CPack_Packages/Linux/RPM
> ./_CPack_Packages/Linux/RPM/SOURCES
> ./_CPack_Packages/Linux/RPM/rpmbuildXXX-common-cpp-libs.err
> ./_CPack_Packages/Linux/RPM/tmp
> ./_CPack_Packages/Linux/RPM/rpmbuilXXX-common-cpp-libs.out
> ./_CPack_Packages/Linux/RPM/BUILDROOT
> ./_CPack_Packages/Linux/RPM/SRPMS
> ./_CPack_Packages/Linux/RPM/BUILD
> ./_CPack_Packages/Linux/RPM/SPECS
> ./_CPack_Packages/Linux/RPM/SPECS/XXX-common-cpp-libs.spec
> ./_CPack_Packages/Linux/RPM/RPMS
> ./_CPack_Packages/Linux/RPM/XXX-common-cpp-libs-7.0.0-1.x86_64.rpm
>
> I'm generating the spec file from a template by:
> configure_file("${CMAKE_CURRENT_SOURCE_DIR}/rpm/
> xxx-common-cpp-libs.spec.in"
> "${CMAKE_CURRENT_BINARY_DIR}/xxx-common-cpp-libs.spec" @ONLY IMMEDIATE)
>
> The genereated spec file looks like this:
>
> Buildroot:
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/xxx-common-cpp-libs-7.0.0-1.x86_64
> Summary:        xxx common cpp libs
> Name:           xxx-common-cpp-libs
> Version:        7.0.0
> Release:        1
> License:        Proprietary
> Group:          Development/Tools/Other
> Vendor:         xxx
> Prefix:         /usr/local
>
> %define _rpmdir /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM
> %define _rpmfilename xxx-common-cpp-libs-7.0.0-1.x86_64.rpm
> %define _unpackaged_files_terminate_build 0
> %define _topdir /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM
>
> %description
> ...
>
> # This is a shortcutted spec file generated by CMake RPM generator
> # we skip _install step because CPack does that for us.
> # We do only save CPack installed tree in _prepr
> # and then restore it in build.
> %prep
> mv $RPM_BUILD_ROOT
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/tmpBBroot
>
> %install
> if [ -e $RPM_BUILD_ROOT ];
> then
>   rm -Rf $RPM_BUILD_ROOT
> fi
> mv "/data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/tmpBBroot"
> $RPM_BUILD_ROOT
>
> %files
> %defattr(-,root,root,-)
> /usr/local/lib/*
> /usr/local/include/*
>
> <EOF>
>
> On Tue, Jul 31, 2018 at 2:30 PM, Craig Scott <craig.scott@crascit.com>
> wrote:
>
>>
>>
>> On Tue, Jul 31, 2018 at 9:56 PM, Miroslav Kubiczek <
>> miroslav.kubiczek@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I'm running cmake 3.10.1 and have this issue:
>>>
>>> $ make package
>>> [ 50%] Built target Rest
>>> [100%] Built target UT_RestLibrary
>>> Run CPack packaging tool...
>>> CPack: Create package using RPM
>>> CPack: Install projects
>>> CPack: - Run preinstall target for: XXXCommonCppLibrary
>>> CPack: - Install project: XXXCommonCppLibrary
>>> CPack: Create package
>>> CPackRPM: Will use USER specified spec file:
>>> /data/git/common-cpp-libs/build/XXX-common-cpp-libs.spec
>>> CMake Error at
>>> /usr/local/cmake-3.10.1-Linux-x86_64/share/cmake-3.10/Modules/CPackRPM.cmake:2703
>>> (message):
>>>   RPM package was not generated!
>>>   /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM
>>> Call Stack (most recent call first):
>>>
>>> /usr/local/cmake-3.10.1-Linux-x86_64/share/cmake-3.10/Modules/CPackRPM.cmake:2774
>>> (cpack_rpm_generate_package)
>>>
>>>
>>> CPack Error: Error while execution CPackRPM.cmake
>>> CPack Error: Problem compressing the directory
>>> CPack Error: Error when generating package: XXX-common-cpp-libs
>>> make: *** [package] Error 1
>>>
>>> The rpm file is generated by those strange errors printed, make exits
>>> with an error code and jenkins build fails.
>>> Does anyone know how to fix this?
>>>
>>>
>> A few things to check:
>>
>>
>>    - Have you given any install() commands in your project? The message
>>    above seems to be suggesting nothing was installed.
>>    - Are you overriding the .spec file rather than using the one
>>    CMake/CPack creates for you? If so, can you indicate why and maybe check
>>    its contents. Less likely this is the main issue, but worth covering anyway.
>>
>>
>>
>> --
>> Craig Scott
>> Melbourne, Australia
>> https://crascit.com
>>
>> New book released: Professional CMake: A Practical Guide
>> <https://crascit.com/professional-cmake/>
>>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>


-- 
Eric

[Attachment #5 (text/html)]

<div dir="ltr">Hi Miroslav,<div><br></div><div>Do you need something very specific \
that you need a custom spec file?</div><div>If this is not the case you should try to \
let CPackRPM generate the spec file for you.</div><div><br></div><div>This &quot;USER \
spec file&quot; feature was designed (quite a long time ago) when CPackRPM was \
lacking some features that came in after that.</div><div>It was a debug &amp; \
developer feature as well in order to ease CPackRPM evolution.</div><div>This was \
made public in order to be able to &quot;unblock&quot; user before they get the \
awaited feature in next CPackRPM release.</div><div>The USER spec file cannot be as \
rich as a &quot;standard RPM spec file&quot; there is some restriction in what you \
can write in it.</div><div><br></div><div>In any case you can try to switch on \
CPackRPM debug output:</div><div>cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G \
RPM<br></div><div><br></div><div>You should be able to get more detail about the \
failure.</div><div>In this mode CPack RPM will tell you where is the log/err file you \
can inspect to know more.</div><div><br></div></div><br><div class="gmail_quote"><div \
dir="ltr">Le  mar. 31 juil. 2018 Ã   14:49, Miroslav Kubiczek &lt;<a \
href="mailto:miroslav.kubiczek@gmail.com">miroslav.kubiczek@gmail.com</a>&gt; a \
écrit  :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>yes, there \
are install commands, one of CMakeLists.txt content:<br><br>install(DIRECTORY \
${PROJECT_SOURCE_DIR}/api/rest DESTINATION include)<br>install(TARGETS Rest \
DESTINATION lib)<br><br></div>I can see these files after running the &#39;make \
package&#39;:<br><span style="font-family:monospace,monospace">$ find \
./_CPack_Packages/Linux/<br>./_CPack_Packages/Linux/<br>./_CPack_Packages/Linux/RPM<br \
>./_CPack_Packages/Linux/RPM/SOURCES<br>./_CPack_Packages/Linux/RPM/rpmbuildXXX-common \
> -cpp-libs.err<br>./_CPack_Packages/Linux/RPM/tmp<br>./_CPack_Packages/Linux/RPM/rpmb \
> uilXXX-common-cpp-libs.out<br>./_CPack_Packages/Linux/RPM/BUILDROOT<br>./_CPack_Pack \
> ages/Linux/RPM/SRPMS<br>./_CPack_Packages/Linux/RPM/BUILD<br>./_CPack_Packages/Linux \
> /RPM/SPECS<br>./_CPack_Packages/Linux/RPM/SPECS/XXX-common-cpp-libs.spec<br>./_CPack \
> _Packages/Linux/RPM/RPMS<br>./_CPack_Packages/Linux/RPM/XXX-common-cpp-libs-7.0.0-1.x86_64.rpm<br></span><br></div>I&#39;m \
> generating the spec file from a template \
> by:<br><div>configure_file(&quot;${CMAKE_CURRENT_SOURCE_DIR}/rpm/<a \
> href="http://xxx-common-cpp-libs.spec.in" \
> target="_blank">xxx-common-cpp-libs.spec.in</a>&quot; \
> &quot;${CMAKE_CURRENT_BINARY_DIR}/xxx-common-cpp-libs.spec&quot; @ONLY \
> IMMEDIATE)</div><div><br></div><div>The genereated spec file looks like \
> this:</div><div><br></div><div><span \
> style="font-family:monospace,monospace">Buildroot: \
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/xxx-common-cpp-libs-7.0.0-1.x86_64<br>Summary: \
> xxx common cpp libs<br>Name:                     xxx-common-cpp-libs<br>Version:    \
> 7.0.0<br>Release:               1<br>License:               Proprietary<br>Group:   \
> Development/Tools/Other<br>Vendor:                 xxx<br>Prefix:                 \
> /usr/local<br>  <br>%define _rpmdir \
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM<br>%define _rpmfilename \
> xxx-common-cpp-libs-7.0.0-1.x86_64.rpm<br>%define _unpackaged_files_terminate_build \
> 0<br>%define _topdir /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM<br>  \
> <br>%description<br>...<br>  <br># This is a shortcutted spec file generated by \
> CMake RPM generator<br># we skip _install step because CPack does that for us.<br># \
> We do only save CPack installed tree in _prepr<br># and then restore it in \
> build.<br>%prep<br>mv $RPM_BUILD_ROOT \
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/tmpBBroot<br>  \
> <br>%install<br>if [ -e $RPM_BUILD_ROOT ];<br>then<br>   rm -Rf \
> $RPM_BUILD_ROOT<br>fi<br>mv \
> &quot;/data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM/tmpBBroot&quot; \
> $RPM_BUILD_ROOT<br>  \
> <br>%files<br>%defattr(-,root,root,-)<br>/usr/local/lib/*<br>/usr/local/include/*<br> \
> <br></span></div><div>&lt;EOF&gt;<br></div></div><div class="gmail_extra"><br><div \
> class="gmail_quote">On Tue, Jul 31, 2018 at 2:30 PM, Craig Scott <span \
> dir="ltr">&lt;<a href="mailto:craig.scott@crascit.com" \
> target="_blank">craig.scott@crascit.com</a>&gt;</span> wrote:<br><blockquote \
> class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
> solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><span><br><div \
> class="gmail_quote">On Tue, Jul 31, 2018 at 9:56 PM, Miroslav Kubiczek <span \
> dir="ltr">&lt;<a href="mailto:miroslav.kubiczek@gmail.com" \
> target="_blank">miroslav.kubiczek@gmail.com</a>&gt;</span> wrote:<br><blockquote \
> class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
> solid;padding-left:1ex"><div dir="ltr"><div>Hi \
> All,</div><div><br></div><div>I&#39;m running cmake 3.10.1 and have this \
> issue:<br><br>$ make package<br>[ 50%] Built target Rest<br>[100%] Built target \
> UT_RestLibrary<br>Run CPack packaging tool...<br>CPack: Create package using \
> RPM<br>CPack: Install projects<br>CPack: - Run preinstall target for: \
> XXXCommonCppLibrary<br>CPack: - Install project: XXXCommonCppLibrary<br>CPack: \
> Create package<br>CPackRPM: Will use USER specified spec file: \
> /data/git/common-cpp-libs/build/XXX-common-cpp-libs.spec<br>CMake Error at \
> /usr/local/cmake-3.10.1-Linux-x86_64/share/cmake-3.10/Modules/CPackRPM.cmake:2703 \
> (message):<br>   RPM package was not generated!<br>   \
> /data/git/common-cpp-libs/build/_CPack_Packages/Linux/RPM<br>Call Stack (most \
> recent call first):<br>   \
> /usr/local/cmake-3.10.1-Linux-x86_64/share/cmake-3.10/Modules/CPackRPM.cmake:2774 \
> (cpack_rpm_generate_package)<br><br><br>CPack Error: Error while execution \
> CPackRPM.cmake<br>CPack Error: Problem compressing the directory<br>CPack Error: \
> Error when generating package: XXX-common-cpp-libs<br>make: *** [package] Error \
> 1<br></div><div><br></div><div>The rpm file is generated by those strange errors \
> printed, make exits with an error code and jenkins build fails.<br></div><div>Does \
> anyone know how to fix this?<br><br></div></div></blockquote></div><div \
> class="gmail_extra"><br></div></span><div class="gmail_extra">A few things to \
> check:</div><div class="gmail_extra"><br></div><ul><li>Have you given any install() \
> commands in your project? The message above seems to be suggesting nothing was \
> installed.<br></li><li>Are you overriding the .spec file rather than using the one \
> CMake/CPack creates for you? If so, can you indicate why and maybe check its \
> contents. Less likely this is the main issue, but worth covering \
> anyway.</li></ul><span class="m_492997127245032931HOEnZb"><font color="#888888"><br \
> clear="all"><div><br></div>-- <br><div \
> class="m_492997127245032931m_5533403591294707579gmail_signature" \
> data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div \
> dir="ltr"><div dir="ltr">Craig Scott<br><div>Melbourne, Australia</div><div><a \
> href="https://crascit.com" \
> target="_blank">https://crascit.com</a><br></div><div><br></div><div>New book \
> released:  <a href="https://crascit.com/professional-cmake/" \
> target="_blank">Professional CMake: A Practical \
> Guide</a><br></div></div></div></div></div></div></div>
</font></span></div></div>
</blockquote></div><br></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" \
target="_blank">www.kitware.com</a><br> <br>
Please keep messages on-topic and check the CMake FAQ at: <a \
href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" \
target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br> <br>
Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:<br> <br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/support.html</a><br> CMake Consulting: <a \
href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/consulting.html</a><br> CMake Training \
Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" \
target="_blank">http://cmake.org/cmake/help/training.html</a><br> <br>
Visit other Kitware open-source projects at <a \
href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" \
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" \
target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br> \
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div \
dir="ltr"><div>Eric<br></div></div></div></div></div>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic