Bug 2284124 - cmake tests fail with RPM 4.20
Summary: cmake tests fail with RPM 4.20
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Björn Esser (besser82)
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: RPM4.20
TreeView+ depends on / blocked
 
Reported: 2024-05-31 14:13 UTC by Miro Hrončok
Modified: 2024-06-05 09:48 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-06-05 09:23:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm pull 3139 0 None open Minimally bring back --buildroot and %{_buildrootdir} 2024-06-03 13:41:03 UTC
Github rpm-software-management rpm pull 3140 0 None open Require %{buildsubdir} to be defined to get debuginfo packages again 2024-06-03 13:41:03 UTC

Description Miro Hrončok 2024-05-31 14:13:55 UTC
The following tests FAILED:
	123 - CPackComponents (Failed)
	124 - CPackComponentsForAll-RPM-IgnoreGroup (Failed)
	130 - CPackComponentsPrefix (Failed)
	581 - RunCMake.CPack_RPM.CUSTOM_BINARY_SPEC_FILE (Failed)
	582 - RunCMake.CPack_RPM.CUSTOM_NAMES (Failed)
	583 - RunCMake.CPack_RPM.DEBUGINFO (Failed)
	584 - RunCMake.CPack_RPM.DEFAULT_PERMISSIONS (Failed)
	585 - RunCMake.CPack_RPM.DEPENDENCIES (Failed)
	586 - RunCMake.CPack_RPM.DIST (Failed)
	587 - RunCMake.CPack_RPM.EMPTY_DIR (Failed)
	588 - RunCMake.CPack_RPM.VERSION (Failed)
	589 - RunCMake.CPack_RPM.INSTALL_SCRIPTS (Failed)
	590 - RunCMake.CPack_RPM.MAIN_COMPONENT (Failed)
	591 - RunCMake.CPack_RPM.MINIMAL (Failed)
	592 - RunCMake.CPack_RPM.PARTIALLY_RELOCATABLE_WARNING (Failed)
	593 - RunCMake.CPack_RPM.PER_COMPONENT_FIELDS (Failed)
	594 - RunCMake.CPack_RPM.SINGLE_DEBUGINFO (Failed)
	595 - RunCMake.CPack_RPM.EXTRA_SLASH_IN_PATH (Failed)
	596 - RunCMake.CPack_RPM.SOURCE_PACKAGE (Failed)
	597 - RunCMake.CPack_RPM.SUGGESTS (Failed)
	598 - RunCMake.CPack_RPM.SYMLINKS (Failed)
	599 - RunCMake.CPack_RPM.USER_FILELIST (Failed)
	600 - RunCMake.CPack_RPM.PROJECT_META (Failed)
Errors while running CTest

Panu said:

"""
happened to spot your failed cmake build from koji (https://kojipkgs.fedoraproject.org//work/tasks/9252/118339252/build.log) with bunch of CPack_RPM related test failures this would be yet another case of an obscure cli switch nobody was expected to be using that option got axed as a part of the new build directory setup we'll have a look at that next week need to think/see what to do about it, we want the buildroot inside the new %builddir thing so it can all be cleaned up in a single go, so users overriding the buildroot is not really an option anymore, but maybe it could be repurposed to something similar to allow cmake to continue to work, or something
"""

Comment 1 Cristian Le 2024-05-31 14:18:56 UTC
Reported upstream: https://gitlab.kitware.com/cmake/cmake/-/issues/26021

Comment 2 Panu Matilainen 2024-05-31 14:22:37 UTC
cmake upstream report is a bit premature, we'll need to look at the case first and decide what (if anything) to do about it on the rpm front. That'll have to wait over the weekend though.

Comment 3 Cristian Le 2024-05-31 14:31:16 UTC
If the issue is within https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/Internal/CPack/CPackRPM.cmake I think it's quite feasible to patch it upstream and assume that cmake and rpm versions are built for the current running system (excluding maybe installing rpm from pip). Either way we would probably want upstream to have a check for RPM 4.20 and gradually migrate the support?

Comment 4 Panu Matilainen 2024-05-31 17:00:20 UTC
Hold your horses, please.

Before jumping to conclusions we'll need to investigate what exactly cpack is doing here. If it does what I think it does, it does fall into the category of 4.20 stuff failing because they're trying to herd rpm from the outside instead of using it from the inside, BUT. This is a different case from various other 4.20 "regressions" people have run into due to creative packaging, hardcoded assumptions and whanot, in that cpack is using a documented long-standing command line switch that was suddenly removed. We may well have to backpedal on this one, at least for the time being, and look to solve cpack's use-case in a different manner long-term.

We'll look into this on Monday.

Comment 5 Panu Matilainen 2024-06-03 08:14:42 UTC
As expressed in https://gitlab.kitware.com/cmake/cmake/-/issues/26021#note_1530422:

We can't break cpack like this, so we'll bring back --buildroot for the time being and investigate better alternatives for the future later on. I'll try to get this sorted ASAP, hopefully today.

Comment 6 Panu Matilainen 2024-06-03 13:04:25 UTC
There seems to be more issues, not too surprisingly due to the changes to debuginfo enablement. 

The plan there was to enable debuginfo on packages without requiring use of %setup, but there are just too many things this breaks, one of them again cpack. So we'll bring back the requirement of %{buildsubdir} being defined for the debuginfo machinery to fire.

Comment 7 Panu Matilainen 2024-06-04 10:15:41 UTC
This should be fixed as of 4.19.91-7, I got a successful scratch-build of cmake here:
https://koji.fedoraproject.org/koji/taskinfo?taskID=118548810

Launched a full build just now: https://koji.fedoraproject.org/koji/taskinfo?taskID=118549531

Comment 8 Panu Matilainen 2024-06-04 10:19:53 UTC
On a related note, while looking at this I spotted the following in cmake.spec:

# Failing for rpm 4.19
NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-default"
NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-OnePackPerGroup"
NO_TEST="$NO_TEST|CPackComponentsForAll-RPM-AllInOne"

Coming from https://src.fedoraproject.org/rpms/cmake/c/ae71be464b559997355261bd60fe5098b149674d?branch=rawhide

There was never any bug filed for this so we've had no idea.

Comment 9 Panu Matilainen 2024-06-05 07:08:27 UTC
The build succeeds now alright, there's just one gating failure (https://bodhi.fedoraproject.org/updates/FEDORA-2024-c3ee74a980 / https://artifacts.dev.testing-farm.io/0bed7031-113e-4950-9594-48a79d86daf3/)

Looking at https://artifacts.dev.testing-farm.io/0bed7031-113e-4950-9594-48a79d86daf3/work-ciggtpoy6f/plans/ci/execute/data/guest/default-0/tests/cmake-testsuite-sanity-1/output.txt I see this:

:: [ 11:18:52 ] :: [   PASS   ] :: Command 'rpm -D "_topdir /tmp/tmp.jLYNZj026K" -U *.src.rpm' (Expected 0, got 0)
:: [ 11:19:19 ] :: [   PASS   ] :: Command 'dnf builddep -y /tmp/tmp.jLYNZj026K/SPECS/*.spec' (Expected 0, got 0)
:: [ 11:19:20 ] :: [   PASS   ] :: Command 'su -c 'rpmbuild -D "_topdir /tmp/tmp.jLYNZj026K" -bp /tmp/tmp.jLYNZj026K/SPECS/*.spec &>/tmp/tmp.jLYNZj026K/rpmbuild.log' cmkbld' (Expected 0, got 0)
:: [ 11:19:20 ] :: [   INFO   ] :: Sending /tmp/tmp.jLYNZj026K/rpmbuild.log as tmp-tmp.jLYNZj026K-rpmbuild.log
:: [ 11:19:20 ] :: [   PASS   ] :: Command 'rlFileSubmit /tmp/tmp.jLYNZj026K/rpmbuild.log' (Expected 0, got 0)
:: [ 11:19:20 ] :: [   PASS   ] :: Command 'CMakeDir=' (Expected 0, got 0)
:: [ 11:19:20 ] :: [   PASS   ] :: Command 'cd /tmp/tmp.jLYNZj026K/BUILD/' (Expected 0, got 0)
:: [ 11:19:20 ] :: [   FAIL   ] :: Command 'su -c './bootstrap &>/tmp/tmp.jLYNZj026K/bootstrap.log' cmkbld' (Expected 0, got 127)

The fundamental issue here is assuming rpmbuild puts things into certain places just the way it always did, and doing stuff from outside the spec. Which is certain to run into trouble now.

This test builds cmake again from the rpm prepped sources, but then manually runs (or, tries to) a ./bootstrap build from the patched source, and I guess, test that? Maybe I'm just missing something here, but this seems not only extremely expensive but also a bizarre way to test the cmake package we just built, because the re-bootstrapped build is not going to be built with the same exact environment as the package just built, that we're supposed to be testing here.

If the point is to ensure the just-built cmake can be built again, then why not just run the full rpmbuild and its checks on it? But, like said this seems like an extremely expensive test to be doing.

Anyway, this is now outside what I can fix in rpm, so reassigning to cmake.

Comment 10 Panu Matilainen 2024-06-05 07:20:38 UTC
Oh and, one way to preserve such a test relying on external access to rpm prepared source is just look it up, eg in the context of the test, something like (untested):

rlRun "builddir=$(dirname $(find $TmpDir/ -name bootstrap))"

That said, this kind of usage is a far more common theme than I ever imagined, so maybe rpm should export the build directory information somehow. A simple way would be explicitly outputting the build directory in a parseable form at the point rpm itself knows the directory during the build.

Comment 11 Miro Hrončok 2024-06-05 09:18:42 UTC
We knew about the failure when we merged the PR, I am going to wave it.

Comment 12 Miro Hrončok 2024-06-05 09:20:58 UTC
Correction, we knew about *a* CI failure, not about this one. Doing it anyway.

Comment 13 Miro Hrončok 2024-06-05 09:23:48 UTC
Thanks for the fix.

Comment 14 Cristian Le 2024-06-05 09:48:45 UTC
I have opened a separate issue for tracking the tmt test refactoring: https://bugzilla.redhat.com/show_bug.cgi?id=2290539
If anyone has some feedback on what tests should be added, please let me know and I'll try to design some.

W.r.t. the cpack tests here, I don't think there is much special case to be designed other than calling the bundled ctest testuite.


Note You need to log in before you can comment on or make changes to this bug.