Bug #116173 Can't build Mysql 8.0.39 in Copr for EPEL9
Submitted: 20 Sep 2024 7:16 Modified: 20 Sep 2024 16:19
Reporter: Danie de Jager Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.39 OS:Red Hat (9)
Assigned to: CPU Architecture:Any

[20 Sep 2024 7:16] Danie de Jager
Description:
I would like to build Mysql in COPR but the SPEC file do not include the Build requirements. According to the MySQL blog some dependencies are not added as build dependencies and that is why my build in COPR fails. My goal is to build MySQL for EPEL9 and eventually Amazon Linux AL2023. 

Currently the build of mysql 8.0.39 do not build for AL2023. It fails a test but I will get to that.

https://blogs.oracle.com/mysql/post/build-mysql-8-from-the-source-rpm-in-ol9

Here is the failure from COPR for the missing libcurl-devel package.
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR) 
-- CURL_INCLUDE_DIR = 
CMake Error at cmake/curl.cmake:249 (ADD_LIBRARY):
  ADD_LIBRARY cannot create ALIAS target "ext::curl" because target
  "curl_interface" does not already exist.
Call Stack (most recent call first):
  CMakeLists.txt:1942 (MYSQL_CHECK_CURL)

CMake Warning at cmake/curl.cmake:72 (MESSAGE):
  Cannot find CURL development libraries.  You need to install the required
  packages:

    Debian/Ubuntu:              apt install libcurl4-openssl-dev
    RedHat/Fedora/Oracle Linux: yum install libcurl-devel
    SuSE:                       zypper install libcurl-devel

Call Stack (most recent call first):
  CMakeLists.txt:1945 (WARN_MISSING_SYSTEM_CURL)

How to repeat:
Build MySQL 8.0.39 inside a Container with RHEL + EPEL. The Chroot is limited and therefore the SPEC needs to be more explicit.

Suggested fix:
Add all the missing build dependencies to the RPM SPEC file. This will allow the creation of RPM packages for EPEL9 based distros and eventually help to package MySQL 8 on AL2023 without intervention to repackage mysql source RPM with an updated SPEC file.
[20 Sep 2024 7:29] Danie de Jager
added 9 to Red Hat OS
[20 Sep 2024 7:30] Danie de Jager
It is implied that other missing buildrequirements need to be added to the SPEC as well. See what I did there? :-)
[20 Sep 2024 9:36] Danie de Jager
Another package that is found to be missing by configure is libudev-devel but building starts without it.
[20 Sep 2024 16:19] MySQL Verification Team
Thanks for the report