[Bug 1174581] New: %cmake uses absolute path for CMAKE_INSTALL_LIBDIR
https://bugzilla.suse.com/show_bug.cgi?id=1174581 Bug ID: 1174581 Summary: %cmake uses absolute path for CMAKE_INSTALL_LIBDIR Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Development Assignee: simonf.lees@suse.com Reporter: fvogt@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- According to https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html:
LIBDIR object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
It is meant to contain the path below CMAKE_INSTALL_PREFIX, but currently %cmake sets it to %{_libdir}, which evaluates to /usr/lib64. This breaks several projects which use any variation of ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} or libdir=$prefix/${CMAKE_INSTALL_LIBDIR} to generate .pc files. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c1 Simon Lees <simonf.lees@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tchvatal@suse.com Flags| |needinfo?(tchvatal@suse.com | |) --- Comment #1 from Simon Lees <simonf.lees@suse.com> ---
From the changelog:
Mon Sep 21 08:40:41 UTC 2015 - tchvatal@suse.com - Remove CMAKE_INSTALL_LIBDIR declaration from the macros. rh#795542 * It is unfortunate but SOME packages will now have to define it themselves because in some cases it is relative path while in others it is absolute one.
From the RedHat bug:
Reading GNUInstallDirs.cmake convinces me that this bug in invalid. CMAKE_INSTALL_LIBDIR isn't guaranteed to be relative, they just say you can use it in the install() CMake command, which is true for both relative and absolute path. And GNUInstallDirs.cmake defines CMAKE_INSTALL_FULL_LIBDIR variable which is guaranteed to be absolute. So packages using ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} just need to be fixed and I see no bug here in Fedora/CMake. FWIW, Gentoo also defines CMAKE_INSTALL_LIBDIR to an absolute path. And Gentoo being a source-based distribution would be especially vulnerable to problems with packages assuming the path to be relative. And they handle it. Having spoken to Fedora people they ended up dropping it altogether because they decided it was too inconsistent. I don't have time to fix all the staging issues from changing this or removing it atm. I believe someone submitted a SR with a similar change several months back but it got reverted because it changed too much. I'll ask Tomas for more info seen as he tried it back then and he would be responsible for finding the engineering manpower to fix the issues if we make any changes here in the next few months. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c2 Tomáš Chvátal <tchvatal@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(tchvatal@suse.com | |) | --- Comment #2 from Tomáš Chvátal <tchvatal@suse.com> --- Yep this is wontfix, too many projects mess it up, it might change in the future but still easiest is to have some override to make it relative if your project uses gnuinstalldirs. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 Luigi Baldoni <aloisio@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aloisio@gmx.com -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c3 --- Comment #3 from Dirk Mueller <dmueller@suse.com> --- see https://gitlab.kitware.com/cmake/cmake/-/issues/20250 it is supposed to be relative, us setting it to an absolute path breaks documented assumptions. do we still know where/what how things were broken by it? it shouldn't be too difficult to fix stuff to use CMAKE_INSTALL_FULL_LIBDIR when it is being used outside install commands (where relative work fine). -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c5 Marius Kittler <marius.kittler@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marius.kittler@suse.com --- Comment #5 from Marius Kittler <marius.kittler@suse.com> --- I've also fixed this at some point within my projects. The tricky part is that the clarifying sentence within the documentation is within the section for `CMAKE_INSTALL_FULL_<dir>` (and not `CMAKE_INSTALL_<dir>`):
The absolute path generated from the corresponding CMAKE_INSTALL_<dir> value. If the value is not already an absolute path, an absolute path is constructed …
The "already" clarifies the possibility for `CMAKE_INSTALL_<dir>` to be absolute. So any distro using absolute paths here is definitely correct. Changing the macro to use relative paths can still be seen as a useful workaround to deal with certain projects. (It would also make sense to make the upstream documentation easier to understand, e.g. the section of `CMAKE_INSTALL_<dir>` should already explicitly clarify that the path can be absolute.) -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c6 --- Comment #6 from Simon Lees <simonf.lees@suse.com> --- (In reply to Dirk Mueller from comment #3)
see https://gitlab.kitware.com/cmake/cmake/-/issues/20250
it is supposed to be relative, us setting it to an absolute path breaks documented assumptions.
do we still know where/what how things were broken by it? it shouldn't be too difficult to fix stuff to use CMAKE_INSTALL_FULL_LIBDIR when it is being used outside install commands (where relative work fine).
They are probably not too difficult to fix on a case by case basis but it is a significant number of packages that break, from also looking at other distro's its possible that more upstream's are expecting it to be a full path over being a relative path to the point where years ago fedora decided not to set the value to anything and force all packages to set it manually so if you can grab all there spec files you might get some idea. If someone actually wants to fix it they will probably need to put it into a staging and slowly go through and fix it for a bunch of upstreams i'm happy for someone to do this as long as its not to close to whenever we decide to branch SLE-16, but currently i'm working on several other projects and don't have time. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c8 Dirk Mueller <dmueller@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(dmueller@suse.com | |) | --- Comment #8 from Dirk Mueller <dmueller@suse.com> --- (In reply to Simon Lees from comment #7)
Dirk do you have time to fix all the issues that come out of this? If not I am going to have to revert https://build.opensuse.org/request/show/835798, I missed seeing the initial submission.
Hi Simon, yes I'm listed as one of the maintainers of cmake, so I take responsibility for it. I did set up a staging with that change (under https://build.opensuse.org/project/show/home:dirkmueller:branches:devel:tool...) and I saw no relevant regression, so I think its fine. If you know better, please don't hesitate a minute to share the information so that we can work on it. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1174581 https://bugzilla.suse.com/show_bug.cgi?id=1174581#c13 Simon Lees <simonf.lees@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #13 from Simon Lees <simonf.lees@suse.com> --- I believe Dirk fixed this one up ages ago. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com