-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use CMake rpm macros and unset in-source builds #742
use CMake rpm macros and unset in-source builds #742
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #742 +/- ##
=========================================
Coverage ? 54.58%
=========================================
Files ? 52
Lines ? 6363
Branches ? 1128
=========================================
Hits ? 3473
Misses ? 2551
Partials ? 339 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
108ff2b
to
dd91f0c
Compare
@nuclearsandwich @cottsay Can you have a look at this? |
We specifically disable the automatic out-of-source build mechanism on the official buildfarm: https://github.com/ros-infrastructure/ros_buildfarm/blob/a1ebac65f42a3019b5b248fb15b8959097520a09/ros_buildfarm/templates/release/rpm/mock_config.cfg.em#L39-L41 What is the motivation for this change? |
The motivation is to align the bloom behaviour for RHEL 8 and 9, specifically when you use bloom to generate rpms ( |
I completely agree. This code predates those macros, as well as the automatic out-of-source mechanisms. I'm extremely hesitant to change this. It's working fine on the official buildfarm today, and I have plans to migrate away from the current spec file generators in Bloom for ROS 2 L-turtle on RHEL 10. Fixing bugs in the templates is really tough because it requires package maintainers to re-release their packages, so I'd rather not rock the boat for RHEL 8 and 9 if we can avoid it. You can set |
I found that I can set this on-the-fly via
I can understand that you do not want to have updates to packages released with a different spec file. Since this PR contains two changes, one for changing from in-source to out-of-source builds for RHEL 8, and one for using the cmake macros instead of the make macros. Would you be willing to merge at least the "in/out source build" change in order to make bloom work again outside the build farm? At the moment, bloom itself is broken "by default" for RHEL 9, and only works on the build farm because of workarounds, and this RHEL version still has to be supported by another 2 years. That means users won't be able to generate RPM packages for at least 2 years without looking up these workarounds. I think this is unfortunate for a tool central to ROS. Would a test on the CI, let's say building RPMs of some core packages, convince you to release changes? I don't see tests for building RPM or DEB packages in this repo and I somehow feel that this may be the reason that many PRs stalled and are not getting reviewed. Would a DEB/RPM test change that? |
Would it be acceptable if we just set |
dd91f0c
to
b116fea
Compare
I just added
on AlmaLinux 8 and 9 with this PR branch. This is now only using |
@cottsay Does the new change work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the new change work for you?
Yes, thank you.
The RPM CMake macros under
/usr/lib/rpm/macros.d/macros.cmake
are defined differently for RHEL / AlmaLinux 8 and 9. Specifically, under AlmaLinux 8 in-source builds are enabled via%__cmake_in_source_build 1
and AlmaLinux 9 turns of stripping via-DCMAKE_INSTALL_DO_STRIP:BOOL=OFF
.The effect is that the evaluation of the macros generates different spec files. This can be verified via:
On AlmaLinux 8 this evaluates to:
On AlmaLinux 9 this evaluates to:
Notice the difference in the build path (
-B
,--build
) for the configure and build procedure. On AlmaLinux 8, the build path is the source path due to%__cmake_in_source_build 1
, on AlmaLinux 9, there is a dedicated build folder.This PR fixes the issue by unsetting
__cmake_in_source_build
and thus reverting back to out-of-source builds for both distributions. I am also replacing the manual calls of the "make" macros with their "cmake" counterpart. See https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/#_available_macros.