#2 Export CMake targets as architecture independent
Merged 2 years ago by music. Opened 2 years ago by xvitaly.
Unknown source ffarch  into  rawhide

@@ -0,0 +1,27 @@

+ From 1d277f02e9e955a64edc35af4d7a002c80a721c8 Mon Sep 17 00:00:00 2001

+ From: Vitaly Zaitsev <vitaly@easycoding.org>

+ Date: Sat, 5 Mar 2022 15:49:54 +0100

+ Subject: [PATCH] Export targets as architecture independent.

+ 

+ Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>

+ ---

+  CMakeLists.txt | 6 +++++-

+  1 file changed, 5 insertions(+), 1 deletion(-)

+ 

+ diff --git a/CMakeLists.txt b/CMakeLists.txt

+ index 6c8f502..f3ab1be 100644

+ --- a/CMakeLists.txt

+ +++ b/CMakeLists.txt

+ @@ -49,7 +49,11 @@ set(FASTFLOAT_VERSION_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/module/FastFloatConfig

+  set(FASTFLOAT_PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/module/FastFloatConfig.cmake")

+  set(FASTFLOAT_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATAROOTDIR}/cmake/FastFloat")

+  

+ -write_basic_package_version_file("${FASTFLOAT_VERSION_CONFIG}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion)

+ +if(${CMAKE_VERSION} VERSION_LESS "3.14")

+ +  write_basic_package_version_file("${FASTFLOAT_VERSION_CONFIG}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion)

+ +else()

+ +  write_basic_package_version_file("${FASTFLOAT_VERSION_CONFIG}" VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ARCH_INDEPENDENT)

+ +endif()

+  configure_package_config_file("cmake/config.cmake.in"

+                                "${FASTFLOAT_PROJECT_CONFIG}"

+                                INSTALL_DESTINATION "${FASTFLOAT_CONFIG_INSTALL_DIR}")

file modified
+2
@@ -31,6 +31,8 @@

  

  # https://github.com/fastfloat/fast_float/pull/127

  Patch100:       %{name}-fixed-cmake-installation.patch

+ # https://github.com/fastfloat/fast_float/pull/129

+ Patch101:       %{name}-fixed-cmake-architectures.patch

  

  BuildRequires:  gcc-c++

  BuildRequires:  cmake

This will fix issues when package was built on 32-bit and then reused on 64-bit architectures and fixes the following issues:

CMake Error at CMakeLists.txt:52 (find_package):
  Could not find a configuration file for package "FastFloat" that is
  compatible with requested version "".

  The following configuration files were considered but not accepted:

    /usr/share/cmake/FastFloat/FastFloatConfig.cmake, version: 3.4.0 (32bit)

Eek, arch-dependent files installed into an arch-independent directory. I’ll definitely merge this, and start the backporting process again.

I thought koji was supposed to detect arch-dependent differences in noarch subpackages of arched base packages. Am I missing something that would explain why that didn’t happen?

Pull-Request has been merged by music

2 years ago

Am I missing something that would explain why that didn’t happen?

Koji uses random builders for noarch targets.

Koji uses random builders for noarch targets.

True, but in this case the base package is arched, and only the -devel subpackage is noarch, so the package actually builds on all architectures every time. This is explicitly to flush out arch-dependent issues. For example, fast_float-3.4.0-5.fc37. So koji should be able to detect any differences.

I’m not sure what the hash in noarch_rpmdiff.json covers, but it was the same for all arches in that build.

Genereated on 32-bit architecture without patch:

# if the installed project requested no architecture check, don't perform the check
if("FALSE")
  return()
endif()

# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "")
  return()
endif()

# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4")
  math(EXPR installedBits "4 * 8")
  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
  set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()

With patch:

# if the installed project requested no architecture check, don't perform the check
if("TRUE")
  return()
endif()

Architecture checks will be avoided.

After building please create a buildroot overrides for 1 week for F35+.

EPEL8: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2022-e7e834de4a
F34: https://bodhi.fedoraproject.org/updates/FEDORA-2022-14a907cdf0

EPEL9 and F35–F37 are still building. (These have exhaustive tests enabled and take much longer.)

I will create the buildroot overrides as requested.

EPEL9 and F35–F37 are still building. (These have exhaustive tests enabled and take much longer.)

Just drop these tests. They are useless.