Bug 2027118 - CMake 3.22 breaks all 64-bit builds when conda installed
Summary: CMake 3.22 breaks all 64-bit builds when conda installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: 35
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Björn 'besser82' Esser
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-28 19:21 UTC by Monty
Modified: 2021-11-30 01:22 UTC (History)
5 users (show)

Fixed In Version: cmake-3.22.0-2.fc36 cmake-3.22.0-2.fc35
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-28 22:03:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Kitware 22962 0 None None None 2021-11-28 19:21:50 UTC

Description Monty 2021-11-28 19:21:51 UTC
Description of problem: CMake 3.22 forces an installation libdir of lib/ instead of lib64/ when the system has a conda environment installed


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


How reproducible: 100%


Steps to Reproduce:
1. Stock, updated F35 install updated to have at least CMake version 3.22 and a conda build environment both installed
2. rpkg or rpmbuild any cmake-driven package build from SRPM, eg, Coin4-devel

Actual results:
CMake forces installation to usr/lib/ rather than usr/lib64, build fails in files check

Expected results
CMake 3.21 and earlier install in the correct /usr/lib64 location and succeed.


Additional info:
Also filed upstream at https://gitlab.kitware.com/cmake/cmake/-/issues/22962

Edited text from that report:

CMake commit ecaca8c1, now released in CMake 3.22.0, breaks builds on F35 and probably all other RedHat platforms.

The problem has a few interacting components, some of which preexist the visible breakage:

    RH dev and build machines normally have the 'conda' build environment installed and set up for use. That means the various CONDA_XXX environment vars are always present in the shell environment, even on containerized 'clean' builds, whether building in the conda environment or not. This has ~always been the case AFAIK.

    CMake has always treated the mere presence of the ENV{CONDA_XXXX} vars as indicating we're building with conda, whether we are or not. This is pre-existing breakage, and __system_type_for_install gets set to "conda" in GNUInstallDirs.cmake. Although CMkae has always made this error, it has not been visible until...

    ecaca8c1 changed:

diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index ead55ca1d8..1b9cfce258 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
[...]
@@ -251,7 +277,8 @@
           set(__LAST_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
         endif()
       endif()
-    else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
+    elseif(NOT DEFINED __system_type_for_install)
+      # not debian, alpine, arch, or conda so rely on CMAKE_SIZEOF_VOID_P:
       if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
         set(_LIBDIR_DEFAULT "lib64")
         if(DEFINED _GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX)

Now instead of getting lib64 if 'not debian', we get lib64 only if __system_type_for_install is unset, but it's set to the misidentified 'conda'. So CMake tries to install to lib/ on 64-bit RedHat distros.

Note that the other 'improvement' of checking to see if the conda install dir exist is uninvolved (and neither helps nor hurts) here; it's set by the system to '/usr'

Obviously, the best course is to fix conda detection, but given that it was always broken on RH, perhaps temporarily rolling back the change for now is sufficient if fixing conda detect is tricky.

Comment 1 Fedora Update System 2021-11-28 21:20:18 UTC
FEDORA-2021-eff2e9b46a has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2021-eff2e9b46a

Comment 2 Fedora Update System 2021-11-28 21:31:57 UTC
FEDORA-2021-de5fcd83c1 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-de5fcd83c1

Comment 3 Fedora Update System 2021-11-28 22:03:08 UTC
FEDORA-2021-eff2e9b46a has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Fedora Update System 2021-11-29 02:49:44 UTC
FEDORA-2021-de5fcd83c1 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-de5fcd83c1`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-de5fcd83c1

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

Comment 5 Fedora Update System 2021-11-30 01:22:15 UTC
FEDORA-2021-de5fcd83c1 has been pushed to the Fedora 35 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.