Skip to content
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

Add missing include for check_symbol_exists #2831

Merged
merged 1 commit into from Jan 8, 2024

Conversation

teknoraver
Copy link
Contributor

The build fails because of a missing include in cmake:

CMake Error at CMakeLists.txt:353 (check_symbol_exists):
  Unknown CMake command "check_symbol_exists".

Include the needed file to fix the issue.

The build fails because of a missing include in cmake:

    CMake Error at CMakeLists.txt:353 (check_symbol_exists):
      Unknown CMake command "check_symbol_exists".

Include the needed file to fix the issue.
@pmatilai
Copy link
Member

pmatilai commented Jan 8, 2024

The patch is technically correct of course, but I'm curious: what cmake version is failing due to this? Because the project is certainly building fine on several platforms/distros as is.

@teknoraver
Copy link
Contributor Author

I'm using Fedora 39:

$ cmake --version
cmake version 3.27.7

@pmatilai
Copy link
Member

pmatilai commented Jan 8, 2024

Huh. That's where our CI is building every PR on the project, and what I use locally. Without seeing any errors from this.

Can you provide a full reproducer for getting to that failure, I'd like to try and understand what's going on here.

@teknoraver
Copy link
Contributor Author

Sure, this is what happens with a fresh clone:

teknoraver@fedora:~/src/rpm$ git reset --hard upstream/master
HEAD is now at 75965c1e7 rpmcli.h forces a public dependency on popt includes

teknoraver@fedora:~/src/rpm$ git clean -fdx
Removing CMakeCache.txt
Removing CMakeFiles/

teknoraver@fedora:~/src/rpm$ cmake .
-- The C compiler identification is GNU 13.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
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.9.5")
-- Found Lua: /usr/lib64/liblua-5.4.so;/usr/lib64/libm.so (found suitable version "5.4.6", minimum required is "5.2")
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.13")
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- Performing Test Iconv_IS_BUILT_IN
-- Performing Test Iconv_IS_BUILT_IN - Success
-- Found Iconv: built in to C library
-- Checking for module 'popt'
--   Found popt, version 1.19
-- Checking for module 'readline'
--   Package 'readline', required by 'virtual:world', not found
-- Checking for module 'libzstd>=1.3.8'
--   Found libzstd, version 1.5.5
-- Checking for module 'libelf'
--   Found libelf, version 0.190
-- Checking for module 'libdw'
--   Found libdw, version 0.190
-- Checking for module 'liblzma>=5.2.0'
--   Found liblzma, version 5.4.4
-- Found OpenMP_C: -fopenmp (found suitable version "4.5", minimum required is "4.5")
-- Found OpenMP: TRUE (found suitable version "4.5", minimum required is "4.5")
-- Found Intl: built in to C library
-- Checking for module 'sqlite3>=3.22'
--   Found sqlite3, version 3.42.0
-- Found Python3: /usr/bin/python3.12 (found suitable version "3.12.1", minimum required is "3.7") found components: Interpreter Development Development.Module Development.Embed
-- Checking for module 'libcap'
--   Found libcap, version 2.48
-- Checking for module 'libacl'
--   Found libacl, version 2.3.1
-- Checking for module 'audit'
--   Found audit, version 3.1.2
-- Checking for module 'libselinux'
--   Found libselinux, version 3.5
-- Checking for module 'libarchive'
--   Found libarchive, version 3.7.1
-- Looking for stpcpy
-- Looking for stpcpy - found
-- Looking for stpncpy
-- Looking for stpncpy - found
-- Looking for putenv
-- Looking for putenv - found
-- Looking for mempcpy
-- Looking for mempcpy - found
-- Looking for fdatasync
-- Looking for fdatasync - found
-- Looking for lutimes
-- Looking for lutimes - found
-- Looking for mergesort
-- Looking for mergesort - not found
-- Looking for getauxval
-- Looking for getauxval - found
-- Looking for setprogname
-- Looking for setprogname - not found
-- Looking for __progname
-- Looking for __progname - found
-- Looking for syncfs
-- Looking for syncfs - found
-- Looking for sched_getaffinity
-- Looking for sched_getaffinity - found
-- Looking for unshare
-- Looking for unshare - found
-- Looking for secure_getenv
-- Looking for secure_getenv - found
-- Looking for __secure_getenv
-- Looking for __secure_getenv - not found
-- Looking for mremap
-- Looking for mremap - found
-- Looking for strchrnul
-- Looking for strchrnul - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for getcwd
-- Looking for getcwd - found
-- Looking for basename
-- Looking for basename - found
-- Looking for dirname
-- Looking for dirname - found
-- Looking for realpath
-- Looking for realpath - found
-- Looking for setenv
-- Looking for setenv - found
-- Looking for unsetenv
-- Looking for unsetenv - found
-- Looking for regcomp
-- Looking for regcomp - found
-- Looking for utimes
-- Looking for utimes - found
-- Looking for getline
-- Looking for getline - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for statvfs
-- Looking for statvfs - found
-- Looking for getaddrinfo
-- Looking for getaddrinfo - found
-- Looking for openat
-- Looking for openat - found
-- Looking for mkdirat
-- Looking for mkdirat - found
-- Looking for fstatat
-- Looking for fstatat - found
-- Looking for linkat
-- Looking for linkat - found
-- Looking for symlinkat
-- Looking for symlinkat - found
-- Looking for mkfifoat
-- Looking for mkfifoat - found
-- Looking for mknodat
-- Looking for mknodat - found
-- Looking for unlinkat
-- Looking for unlinkat - found
-- Looking for renameat
-- Looking for renameat - found
-- Looking for utimensat
-- Looking for utimensat - found
-- Looking for fchmodat
-- Looking for fchmodat - found
-- Looking for fchownat
-- Looking for fchownat - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for limits.h
-- Looking for limits.h - found
-- Looking for getopt.h
-- Looking for getopt.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - found
-- Looking for sys/systemcfg.h
-- Looking for sys/systemcfg.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - found
-- Looking for sys/auxv.h
-- Looking for sys/auxv.h - found
CMake Error at CMakeLists.txt:353 (check_symbol_exists):
  Unknown CMake command "check_symbol_exists".


-- Configuring incomplete, errors occurred!

@pmatilai
Copy link
Member

pmatilai commented Jan 8, 2024

This seems pretty bizarre, all I get is

[...]
-- Looking for sys/auxv.h
-- Looking for sys/auxv.h - found
-- Looking for major
-- Looking for major - found
-- Performing Test found
-- Performing Test found - Success
[...]

And that's how it goes in all our CI builds, Fedora packages and so on. Do you have any cmake-related environment variables set, or something like that? Can you reproduce on another user account? Apologies for the "interrogation" on what's a correct patch, but if there's a setting somewhere that makes cmake more strict for mistakes like this one then we should have it enabled. And if it's something else, I sure would like to understand what.

@teknoraver
Copy link
Contributor Author

This is a fresh boot of the Fedora arm64 image available for download here:

https://fedora.mirrorservice.org/fedora/linux/releases/39/Workstation/aarch64/images/Fedora-Workstation-39-1.5.aarch64.raw.xz

I'm using it only to build RPM in a VM (my host is an Apple ARM notebook)

@pmatilai
Copy link
Member

pmatilai commented Jan 8, 2024

Oh okay, arm64, that's a difference. But then it doesn't happen on Fedora koji builds on that platform, eg here: https://kojipkgs.fedoraproject.org//packages/rpm/4.19.1/1.fc39/data/logs/aarch64/build.log

Could be a difference in installed packages perhaps, maybe there's a cmake module that "leaks" its own include of that file or something like that. Oh well.

Thanks for the patch!

@pmatilai pmatilai merged commit 2300eb6 into rpm-software-management:master Jan 8, 2024
1 check passed
@dmnks dmnks added build Build-system related bug labels Feb 5, 2024
@dmnks dmnks changed the title Add missing include Add missing include for check_symbol_exists Feb 5, 2024
@dmnks dmnks mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build Build-system related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants