Bug 1862014 - cmake is missing a dependency on make
Summary: cmake is missing a dependency on make
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Björn 'besser82' Esser
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-30 07:11 UTC by Petr Pisar
Modified: 2020-10-09 15:00 UTC (History)
5 users (show)

Fixed In Version: cmake-3.18.3-1.fc33 cmake-3.17.4-2.fc32 cmake-3.17.4-2.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-02 00:35:12 UTC
Type: Bug


Attachments (Terms of Use)

Description Petr Pisar 2020-07-30 07:11:14 UTC
A new packaging guidelines <https://docs.fedoraproject.org/en-US/packaging-guidelines/CMake/> reads:

BuildRequires: cmake
%build
%cmake
%cmake_build

That does not work if "make" package is not installed:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.HoJ7oa
+ umask 022
+ cd /home/test/fedora/libwbxml
+ cd libwbxml-libwbxml-0.11.7
+ CFLAGS='-O2 -flto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CFLAGS
+ CXXFLAGS='-O2 -flto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
+ export CXXFLAGS
+ FFLAGS='-O2 -flto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ FCFLAGS='-O2 -flto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
+ export FCFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ /usr/bin/cmake -S . -B x86_64-redhat-linux-gnu -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DLIB_SUFFIX=64 -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DENABLE_INSTALL_DOC:BOOL=OFF -DENABLE_UNIT_TEST:BOOL=ON -DWBXML_ENCODER_USE_STRTBL:BOOL=ON -DWBXML_INSTALL_FULL_HEADERS:BOOL=OFF -DWBXML_LIB_VERBOSE:BOOL=OFF -DWBXML_SUPPORT_AIRSYNC:BOOL=ON -DWBXML_SUPPORT_CO:BOOL=ON -DWBXML_SUPPORT_CONML=ON -DWBXML_SUPPORT_DRMREL:BOOL=ON -DWBXML_SUPPORT_EMN:BOOL=ON -DWBXML_SUPPORT_OTA_SETTINGS:BOOL=ON -DWBXML_SUPPORT_PROV:BOOL=ON -DWBXML_SUPPORT_SI:BOOL=ON -DWBXML_SUPPORT_SL:BOOL=ON -DWBXML_SUPPORT_SYNCML:BOOL=ON -DWBXML_SUPPORT_WML:BOOL=ON -DWBXML_SUPPORT_WTA:BOOL=ON -DWBXML_SUPPORT_WV:BOOL=ON
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/test/fedora/libwbxml/libwbxml-libwbxml-0.11.7/x86_64-redhat-linux-gnu/CMakeFiles/CMakeOutput.log".

As you can see the %{cmake} macro expands to "/usr/bin/cmake -S . -B x86_64-redhat-linux-gnu ..." and the cmake program checks for a make tool.

This issue is not specific to builing Fedora packages. Following the very first example from <https://cmake.org/cmake/help/latest/guide/tutorial/index.html> results in:

$ cat CMakeLists.txt 
cmake_minimum_required(VERSION 3.10)

# set the project name
project(Tutorial)

# add the executable
add_executable(Tutorial tutorial.cxx)
[test@fedora-33 tmp]$ find x86_64-redhat-linux-gnu/
x86_64-redhat-linux-gnu/
[test@fedora-33 tmp]$ /usr/bin/cmake -S . -B x86_64-redhat-linux-gnu
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/tmp/x86_64-redhat-linux-gnu/CMakeFiles/CMakeOutput.log".

While after installing make, it succeeds:

$ /usr/bin/cmake -S . -B x86_64-redhat-linux-gnu
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/x86_64-redhat-linux-gnu

I recommend you to add a "Requires: make" dependency to "cmake" RPM package.

Comment 1 Rex Dieter 2020-07-30 20:14:44 UTC
My opinion is torn.

Hardly anything else in the distro depends on make, though *lots* of things explicitly 
BuildRequires: make

I'm currently leaning towards just recommending you do that here too (add the BuildRequires: make) to follow the general packaging guideline:
"... you SHOULD NOT assume any other packages are present as RPM dependencies and anything brought into the buildroot by the build system can change over time."

Any other cmake maintainers have opinions one way or the other?

Comment 2 Petr Pisar 2020-07-31 07:26:47 UTC
Does cmake actually work without a make-like program (c.f. CMAKE_MAKE_PROGRAM variable)?
Does Fedora provide any other implementation of make-like tool other then GNU Make?
How does your proposal address a use of cmake out of the context of building Fedora packages?

Comment 3 Ben Cotton 2020-08-11 13:50:50 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 4 Rex Dieter 2020-08-11 14:44:58 UTC
cmake can use build tools other than make, yes.  One example is ninja.

that said, the 'make' output target is the default...

Comment 5 Fedora Update System 2020-09-30 14:04:40 UTC
FEDORA-2020-4454524871 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-4454524871

Comment 6 Fedora Update System 2020-09-30 14:05:29 UTC
FEDORA-2020-3dcb3abca1 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-3dcb3abca1

Comment 7 Fedora Update System 2020-09-30 14:05:30 UTC
FEDORA-2020-3c259a525a has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-3c259a525a

Comment 8 Fedora Update System 2020-10-01 01:18:43 UTC
FEDORA-2020-4454524871 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-4454524871`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-4454524871

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2020-10-01 01:29:35 UTC
FEDORA-2020-3c259a525a has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-3c259a525a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-3c259a525a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2020-10-01 02:15:20 UTC
FEDORA-2020-3dcb3abca1 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-3dcb3abca1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-3dcb3abca1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-10-02 00:35:12 UTC
FEDORA-2020-4454524871 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2020-10-03 02:01:54 UTC
FEDORA-2020-3dcb3abca1 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-10-09 15:00:32 UTC
FEDORA-2020-3c259a525a has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


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