Re: c++ packaging of contour terminal and libunicode
I open an issue of the upstream repo and reported the maintainer, It was fixed by explicitly setting the libs as static. And thanks for your clear clarification. ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
Dan Horák wrote: > another option is to build the internal libs as static, then they won't > have to be installed. Try appending > -DBUILD_SHARED_LIBS:BOOL=OFF > to the cmake flags I guess this is also why the OP ran into the error with the non-PIC code in the static library in the RPM build and not elsewhere. Shared libraries need to contain all-PIC code, so both the shared libraries themselves and any static libraries linked into them need to be PIC. This is not the case if the static libraries are linked only into executables. So if the build has only ever been tested with BUILD_SHARED_LIBS off (the upstream CMake default), this will not have been caught. Generally, for an upstream project, it is a better idea to explicitly mark the library as STATIC in the CMakeLists.txt files if upstream does not support building it as a shared library. By the way, if upstream is not going to install the static library, they can also declare the library as OBJECT instead of STATIC (a CMake-specific feature). That creates a kind of virtual static library, where CMake will link the object files directly into the target and skip the generation of the unnecessary .a file. Kevin Kofler ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
Grateful for your suggestion, it helps me, so it can build the RPM package and install it finally. ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
On Tue, 28 Feb 2023 11:04:27 + Ian McInerney via devel wrote: > On Mon, Feb 27, 2023 at 12:21 PM Felix Wang wrote: > > > Thanks for your advice. I tried and it can be built with no error, but > > when installing built contour package, it shows the following error: > > ``` > > Error: > > Problem: conflicting requests > > - nothing provides libContourTerminalDisplay.so()(64bit) needed by > > contour-20230226-1.fc39.x86_64 > > - nothing provides libcrispy-core.so()(64bit) needed by > > contour-20230226-1.fc39.x86_64 > > ``` > > > > This looks to be because upstream isn't installing those two shared > libraries in their CMake steps, so the RPM isn't including them in its > packaged files. another option is to build the internal libs as static, then they won't have to be installed. Try appending -DBUILD_SHARED_LIBS:BOOL=OFF to the cmake flags Dan ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
On Mon, Feb 27, 2023 at 12:21 PM Felix Wang wrote: > Thanks for your advice. I tried and it can be built with no error, but > when installing built contour package, it shows the following error: > ``` > Error: > Problem: conflicting requests > - nothing provides libContourTerminalDisplay.so()(64bit) needed by > contour-20230226-1.fc39.x86_64 > - nothing provides libcrispy-core.so()(64bit) needed by > contour-20230226-1.fc39.x86_64 > ``` > This looks to be because upstream isn't installing those two shared libraries in their CMake steps, so the RPM isn't including them in its packaged files. The only files it is installing are: + /usr/bin/cmake --install redhat-linux-build -- Install configuration: "RelWithDebInfo" -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/bin/contour -- Set runtime path of "/home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/bin/contour" to "" -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/applications/org.contourterminal.Contour.desktop -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/kservices5/ServiceMenus/org.contourterminal.Contour.RunIn.desktop -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/kservices5/ServiceMenus/org.contourterminal.Contour.OpenHere.desktop -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/icons/hicolor/512x512/apps/org.contourterminal.Contour.png -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/icons/hicolor/256x256/apps/org.contourterminal.Contour.png -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/icons/hicolor/128x128/apps/org.contourterminal.Contour.png -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/icons/hicolor/64x64/apps/org.contourterminal.Contour.png -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/icons/hicolor/32x32/apps/org.contourterminal.Contour.png -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/metainfo/org.contourterminal.Contour.metainfo.xml -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/shell-integration -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/shell-integration/shell-integration.fish -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/shell-integration/shell-integration.tcsh -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/shell-integration/shell-integration.zsh -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/LICENSE.txt -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/contour/README.md -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/terminfo -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/terminfo/c -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/terminfo/c/contour -- Installing: /home/ruby/rpmbuild/BUILDROOT/contour-20230226-1.fc39.x86_64/usr/share/terminfo/c/contour-latest So this is an upstream bug in their build scripts that should be fixed. Once that is fixed, you then need to add the libraries to the %files section of your spec file. -Ian > detailed steps information: > https://gist.github.com/topazus/adc72785c126c513093f5389c117cae7 > ___ > devel mailing list -- devel@lists.fedoraproject.org > To unsubscribe send an email to devel-le...@lists.fedoraproject.org > Fedora Code of Conduct: > https://docs.fedoraproject.org/en-US/project/code-of-conduct/ > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines > List Archives: > https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org > Do not reply to spam, report it: > https://pagure.io/fedora-infrastructure/new_issue > ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
Thanks for your advice. I tried and it can be built with no error, but when installing built contour package, it shows the following error: ``` Error: Problem: conflicting requests - nothing provides libContourTerminalDisplay.so()(64bit) needed by contour-20230226-1.fc39.x86_64 - nothing provides libcrispy-core.so()(64bit) needed by contour-20230226-1.fc39.x86_64 ``` detailed steps information: https://gist.github.com/topazus/adc72785c126c513093f5389c117cae7 ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
Upstream appears to be disabling position independent code for some reason in the crispy-core library: https://github.com/contour-terminal/contour/blob/master/src/crispy/CMakeLists.txt#L100 (although they are using no-pie, which is odd since it is a library and I would have expected no-pic instead, since pie is for executables not libraries...). Try removing those options from the build and running it again. CMake should automatically pick up the PIC/PIE options from the hardened build flags provided by the RPM build system. -Ian On Mon, Feb 27, 2023 at 6:31 AM Felix Wang wrote: > The detailed information: > https://gist.github.com/topazus/b4bfd63b8cbce70acd4dac02a087d785 > ___ > devel mailing list -- devel@lists.fedoraproject.org > To unsubscribe send an email to devel-le...@lists.fedoraproject.org > Fedora Code of Conduct: > https://docs.fedoraproject.org/en-US/project/code-of-conduct/ > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines > List Archives: > https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org > Do not reply to spam, report it: > https://pagure.io/fedora-infrastructure/new_issue > ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
The detailed information: https://gist.github.com/topazus/b4bfd63b8cbce70acd4dac02a087d785 ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
I tried to add -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON to %cmake, it still does not compile and occurred the same error in the same position. ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
Felix Wang wrote: > /usr/bin/ld: /tmp/ccW09Umc.ltrans0.ltrans.o: relocation R_X86_64_PC32 > against symbol `_ZTIZN8logstore4SinkC4EbRSoEUlSt17basic_string_viewIcSt11char_traitsIcEEE_' > can not be used when making a shared object; recompile with -fPIC Pass -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON to %cmake. Kevin Kofler ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
updated contour .spec file: https://gist.githubusercontent.com/topazus/f81005cb85762ce2cf6e138f0b1cede1/raw/9745fd9c7b01d9c7d7a9619b93b22a8219ce7ad4/contour.spec ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Re: c++ packaging of contour terminal and libunicode
libunicode repo URL: https://github.com/contour-terminal/libunicode contour terminal repo URL: https://github.com/contour-terminal/contour ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
c++ packaging of contour terminal and libunicode
spec file URL of libunicode: https://gist.githubusercontent.com/topazus/e30b83d669600756894a77b5258c9405/raw/5f402302ae0527732ad112059906c2a239239c34/libunicode.spec spec file URL of contour: https://gist.githubusercontent.com/topazus/f81005cb85762ce2cf6e138f0b1cede1/raw/c29f456daa0a440529a4ffe20fdcaf683574053f/contour.spec Descriptions about problems: I first build libunicode dependency using my spec file and install it on my machine. Then I try build contour terminal. It failed with the following errors: ``` [ 10%] Linking CXX static library libtext_shaper.a cd /home/ruby/rpmbuild/BUILD/contour-98c8c0d0e96dc7c56ee06b4e8bfd71a23ae4f4d6/redhat-linux-build/src/text_shaper && /usr/bin/cmake -P CMakeFiles/text_shaper.dir/cmake_clean_target.cmake cd /home/ruby/rpmbuild/BUILD/contour-98c8c0d0e96dc7c56ee06b4e8bfd71a23ae4f4d6/redhat-linux-build/src/text_shaper && /usr/bin/cmake -E cmake_link_script CMakeFiles/text_shaper.dir/link.txt --verbose=1 /usr/bin/ar qc libtext_shaper.a CMakeFiles/text_shaper.dir/font.cpp.o CMakeFiles/text_shaper.dir/font_locator_provider.cpp.o CMakeFiles/text_shaper.dir/fontconfig_locator.cpp.o CMakeFiles/text_shaper.dir/mock_font_locator.cpp.o CMakeFiles/text_shaper.dir/open_shaper.cpp.o CMakeFiles/text_shaper.dir/shaper.cpp.o /usr/bin/ranlib libtext_shaper.a gmake[2]: Leaving directory '/home/ruby/rpmbuild/BUILD/contour-98c8c0d0e96dc7c56ee06b4e8bfd71a23ae4f4d6/redhat-linux-build' [ 10%] Built target text_shaper /usr/bin/ld: /tmp/ccW09Umc.ltrans0.ltrans.o: warning: relocation against `_ZGVZN8logstore4Sink7consoleEvE8instance' in read-only section `.text.startup' /usr/bin/ld: /tmp/ccW09Umc.ltrans0.ltrans.o: relocation R_X86_64_PC32 against symbol `_ZTIZN8logstore4SinkC4EbRSoEUlSt17basic_string_viewIcSt11char_traitsIcEEE_' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status gmake[2]: *** [src/crispy/CMakeFiles/crispy-core.dir/build.make:148: src/crispy/libcrispy-core.so] Error 1 gmake[2]: Leaving directory '/home/ruby/rpmbuild/BUILD/contour-98c8c0d0e96dc7c56ee06b4e8bfd71a23ae4f4d6/redhat-linux-build' gmake[1]: *** [CMakeFiles/Makefile2:267: src/crispy/CMakeFiles/crispy-core.dir/all] Error 2 gmake[1]: Leaving directory '/home/ruby/rpmbuild/BUILD/contour-98c8c0d0e96dc7c56ee06b4e8bfd71a23ae4f4d6/redhat-linux-build' gmake: *** [Makefile:159: all] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.Eo3xWu (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.Eo3xWu (%build) ``` I also try to build contour from the SOURCE file of contour .spec file, which is cmake . -DCONTOUR_BUILD_WITH_QT6=ON && make -j6, the above build cmd worked fine. So I doubt the error that appeared in the build process with .spec file is related with the setting build flags with %cmake macros, but I do not know how to modify it? Or the error is relevant with build options in CMakeLists.txt from the upstream repo code? ___ devel mailing list -- devel@lists.fedoraproject.org To unsubscribe send an email to devel-le...@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue