Bug 2059201

Summary: cmake not setting up proper directories in rawhide
Product: [Fedora] Fedora Reporter: William Cohen <wcohen>
Component: cmakeAssignee: Björn Esser (besser82) <besser82>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 37CC: besser82, germano.massullo, jplesnik, jreznik, mhroncok, rdieter, trpost, walter.pete, zonexpertconsulting
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-06-30 20:09:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2079833    
Bug Blocks: 2060431, 2060764, 2060781, 2060821, 2060860, 2060891, 2060898    

Description William Cohen 2022-02-28 13:36:01 UTC
Description of problem:

The rawhide cmake not creating redhat-linux-build directory and causing build on koji to fail:


Version-Release number of selected component (if applicable):

cmake-3.23.0-0.1.rc2.fc37

How reproducible:

Every time


Steps to Reproduce:
1. In rawhide download:
 wget https://kojipkgs.fedoraproject.org//work/tasks/4881/83434881/dyninst-12.1.0-0.1.fc35git.src.rpm
2. sudo dnf builddep ./dyninst-12.1.0-0.1.fc35git.src.rpm
3. rpm -Uvh ./dyninst-12.1.0-0.1.fc35git.src.rpm
4. cd ~/rpmbuild/SPECS
5. rpmbuild -ba dyninst.spec

Actual results:

rpmbuild fails as shown in https://koji.fedoraproject.org/koji/taskinfo?taskID=83434878


    SYSCONF_INSTALL_DIR
-- Build files have been written to: /builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0
+ /usr/bin/cmake --build redhat-linux-build -j6 --verbose
Error: /builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build is not a directory
error: Bad exit status from /var/tmp/rpm-tmp.GM4JlG (%build)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.GM4JlG (%build)
Child return code was: 1



Expected results:

rpmbuild completes like https://koji.fedoraproject.org/koji/taskinfo?taskID=83434881



-- Build files have been written to: /builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build
+ /usr/bin/cmake --build redhat-linux-build -j6 --verbose
/usr/bin/cmake -S/builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0 -B/builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build/CMakeFiles /builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build//CMakeFiles/progress.marks
/usr/bin/gmake  -f CMakeFiles/Makefile2 all
gmake[1]: Entering directory '/builddir/build/BUILD/dyninst-12.1.0/dyninst-12.1.0/redhat-linux-build'

Additional info:
The rawhide build works with cmake-3.22.2-1.fc37.x86_64  just started failing with cmake-3.23.0-0.1.rc2.fc37.x86_64

Comment 1 Miro Hrončok 2022-03-02 22:01:21 UTC
This breaks all my cmake based packages.

Comment 2 Fedora Update System 2022-03-02 22:11:50 UTC
FEDORA-2022-a48185dae6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-a48185dae6

Comment 3 Fedora Update System 2022-03-02 22:12:42 UTC
FEDORA-2022-a48185dae6 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Miro Hrončok 2022-03-02 22:24:48 UTC
Sorry about that. I've put "Related: rhbz#2059201, rhbz#2059188, rhbz#2057738" in the changelog and Bodhi closed this :(

Comment 5 Andrew Bauer 2022-03-04 14:37:48 UTC
Interesting this bug has been filed as a cmake bug.

In my case, I fixed this for libcec by simply changing how cmake is called in the specfile:

cmake .

to 

cmake ..


Shouldn't we be doing it that way anyway, since fedora packaging builds out of source now?

Comment 6 Rex Dieter 2022-03-04 19:41:08 UTC
Wrt libcec (or any other fedora package), if using %cmake macro, you shouldn't refer to a directory at all (any more).

Comment 7 Andrew Bauer 2022-03-04 19:55:18 UTC
Good catch. Old habits die hard I guess.

Looks like Fedora packaging documentation does indeed reflect this change in the example:
https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/

I'll update libcec to reflect that.

Bringing this back to dyninst, the problem does indeed seem to be in the specfile:
https://src.fedoraproject.org/rpms/dyninst/blob/rawhide/f/dyninst.spec#_116

The dot needs to go away.

Comment 8 Ben Cotton 2022-08-09 13:13:25 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.