On Mon, Sep 4, 2023 at 4:38 PM Joe (Jun-Yan) Chen jychena@ambarella.com wrote:
Dear Koji Development Team,
I hope this email finds you well. I have a couple of questions regarding the packaging of CMake-based open-source software.
Question 1: Can Koji's buildroot be deployed to access the Internet?
For some open-source software projects, dependencies are downloaded during the CMake configuration phase. However, Koji's buildroot access towards internet(GitHub) is restricted. I attempted to pre-download these dependencies by cmake or set them as 'BuildRequires', but it appears that the intricate CMake system are inflexible and do not provide room for such customization.
In the context of packaging such software for compilation on Koji, aside from modifying the CMake scripts, I would like to know if there are any other more straightforward methods that have been recommended based on the experience of previous packagers.
Nope, currently not. It is a part of koji's philosophy for reproducible builds. Anything downloaded outside of curated git repos could change in the future and rebuild of such thing will not be the same. It is also a part of Fedora's packaging guidelines ( https://docs.fedoraproject.org/en-US/packaging-guidelines/#_build_time_netwo... )
Normal solution is really to alter the package to not access the internet during the build and package all dependencies.
Question 2: Handling Hardcoded Paths in CMake
When packaging certain open-source software using CMake, I noticed that during the CMake configuration phase, if I set "-DCMAKE_INSTALL_PREFIX=$RPM_BUILD_ROOT/opt/oss/", CMake tends to hardcode this path with $RPM_BUILD_ROOT into various places, such as the RPATH of binary libraries or CMake configuration files. Clearly, this is incorrect for the files that end up in /opt/oss/.
As a workaround, I've experimented with running the command "find $RPM_BUILD_ROOT -type f -exec sed -i 's/${RPM_BUILD_ROOT}//g' {} ;" at the end of the %install section, which successfully passes the /usr/lib/rpm/check-buildroot check. However, I'm curious to know if this approach will introduce potential issues or concerns?
There are some predefined macros in Fedora which you can use to handle this: https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/
Your expertise and guidance on these matters would be highly valuable to me. Thank you for your time and assistance.
Best Regards, Junyan CHEN
This email and attachments contain Ambarella Proprietary and/or Confidential Information and is intended solely for the use of the individual(s) to whom it is addressed. Any unauthorized review, use, disclosure, distribute, copy, or print is prohibited. If you are not an intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you. _______________________________________________ koji-devel mailing list -- koji-devel@lists.fedorahosted.org To unsubscribe send an email to koji-devel-leave@lists.fedorahosted.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.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.o... Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Tomas,
It looks like I'll need to delve into learning CMake more seriously.
Your response to my second question was particularly helpful and greatly appreciated.
Best Regards, Junyan CHEN
[Ambarella AI Envisioned]https://www.ambarella.com
Junyan(Joe) CHEN
Software Engineer | SDK Team
Phone: +86-021-60880608-265
Email: jychena@ambarella.commailto:ypchang@ambarella.com
________________________________ From: Tomas Kopecek tkopecek@redhat.com Sent: Tuesday, September 5, 2023 10:05 PM To: Koji development koji-devel@lists.fedorahosted.org Cc: Yu-Peng Chang ypchang@ambarella.com Subject: [EXT] Re: Inquiry Regarding CMake-Based Software Packaging for Koji
On Mon, Sep 4, 2023 at 4:38 PM Joe (Jun-Yan) Chen <jychena@ambarella.commailto:jychena@ambarella.com> wrote: Dear Koji Development Team,
I hope this email finds you well. I have a couple of questions regarding the packaging of CMake-based open-source software.
Question 1: Can Koji's buildroot be deployed to access the Internet?
For some open-source software projects, dependencies are downloaded during the CMake configuration phase. However, Koji's buildroot access towards internet(GitHub) is restricted. I attempted to pre-download these dependencies by cmake or set them as 'BuildRequires', but it appears that the intricate CMake system are inflexible and do not provide room for such customization.
In the context of packaging such software for compilation on Koji, aside from modifying the CMake scripts, I would like to know if there are any other more straightforward methods that have been recommended based on the experience of previous packagers.
Nope, currently not. It is a part of koji's philosophy for reproducible builds. Anything downloaded outside of curated git repos could change in the future and rebuild of such thing will not be the same. It is also a part of Fedora's packaging guidelines (https://docs.fedoraproject.org/en-US/packaging-guidelines/#_build_time_netwo...https://urldefense.com/v3/__https://docs.fedoraproject.org/en-US/packaging-guidelines/*_build_time_network_access__;Iw!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYV27FecfA$)
Normal solution is really to alter the package to not access the internet during the build and package all dependencies.
Question 2: Handling Hardcoded Paths in CMake
When packaging certain open-source software using CMake, I noticed that during the CMake configuration phase, if I set "-DCMAKE_INSTALL_PREFIX=$RPM_BUILD_ROOT/opt/oss/", CMake tends to hardcode this path with $RPM_BUILD_ROOT into various places, such as the RPATH of binary libraries or CMake configuration files. Clearly, this is incorrect for the files that end up in /opt/oss/.
As a workaround, I've experimented with running the command "find $RPM_BUILD_ROOT -type f -exec sed -i 's/${RPM_BUILD_ROOT}//g' {} ;" at the end of the %install section, which successfully passes the /usr/lib/rpm/check-buildroot check. However, I'm curious to know if this approach will introduce potential issues or concerns?
There are some predefined macros in Fedora which you can use to handle this: https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/https://urldefense.com/v3/__https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/__;!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYXxolZqKg$
Your expertise and guidance on these matters would be highly valuable to me. Thank you for your time and assistance.
Best Regards, Junyan CHEN
________________________________ This email and attachments contain Ambarella Proprietary and/or Confidential Information and is intended solely for the use of the individual(s) to whom it is addressed. Any unauthorized review, use, disclosure, distribute, copy, or print is prohibited. If you are not an intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you. _______________________________________________ koji-devel mailing list -- koji-devel@lists.fedorahosted.orgmailto:koji-devel@lists.fedorahosted.org To unsubscribe send an email to koji-devel-leave@lists.fedorahosted.orgmailto:koji-devel-leave@lists.fedorahosted.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/https://urldefense.com/v3/__https://docs.fedoraproject.org/en-US/project/code-of-conduct/__;!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYWjV6xMfQ$ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelineshttps://urldefense.com/v3/__https://fedoraproject.org/wiki/Mailing_list_guidelines__;!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYXXWnehIg$ List Archives: https://lists.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.o...https://urldefense.com/v3/__https://lists.fedorahosted.org/archives/list/koji-devel@lists.fedorahosted.org__;!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYU6PMTldg$ Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issuehttps://urldefense.com/v3/__https://pagure.io/fedora-infrastructure/new_issue__;!!PeEy7nZLVv0!jssGtMmnJXoZj5GqwxIfqfwfzMbW_WAB-83pK5rktIz3gF3Hciu9GrKNnMKy2RWQUlJRYLMfzYWCcnPPGg$
--
Tomas Kopecek <tkopecek@redhat.commailto:tkopecek@redhat.com> RHEL Build Development, RedHat ________________________________ This EXTERNAL email has been scanned by Proofpoint Email Protect service.
koji-devel@lists.fedorahosted.org