Bug 474820 - Double slash in file generated by ecm_generate_pkgconfig_file
Summary: Double slash in file generated by ecm_generate_pkgconfig_file
Status: RESOLVED FIXED
Alias: None
Product: extra-cmake-modules
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: ecm-bugs-null@kde.org
URL:
Keywords:
: 474701 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-09-23 20:40 UTC by Steve Cossette
Modified: 2023-09-26 23:35 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Cossette 2023-09-23 20:40:04 UTC
Good afternoon!

We're working on bringing kf6 packages into Fedora. For this package, we get the following error:

kf6-kwayland-devel.x86_64: E: double-slash-in-pkgconfig-path /usr/lib64/pkgconfig/KF6WaylandClient.pc libdir=${prefix}//usr/lib64
kf6-kwayland-devel.x86_64: E: double-slash-in-pkgconfig-path /usr/lib64/pkgconfig/KF6WaylandClient.pc Libs: -L${prefix}//usr/lib64 -lKF6WaylandClient

Here's the error description:

double-slash-in-pkgconfig-path:
This pkg-config file contains a path with a double slash ('//') in it. This
will break debugedit when stripping debug symbols during package building if
these paths have been passed to gcc, and fail with the following error:
canonicalization unexpectedly shrank by one character.

This is after building commit 770e361d9b6521191e4464944e49b41b21ccdf2e (Latest at the time of speaking): https://invent.kde.org/frameworks/kwayland/-/commit/770e361d9b6521191e4464944e49b41b21ccdf2e

If you need any kind of information please do not hesitate to ask! Thanks!
Comment 1 Nicolas Fella 2023-09-24 13:08:02 UTC
Cannot reproduce in my local build. I get "libdir=${prefix}/lib64"

Can you give your exact CMake arguments?
Comment 2 Steve Cossette 2023-09-24 13:16:18 UTC
Hopefully this is what you're asking:

+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rp>
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/>
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened>
+ export FFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-pack>
+ export LDFLAGS
+ /usr/bin/cmake -S . -B redhat-linux-build -DCMAKE_C_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE:STRING=-DNDEBUG -DCMAKE_Fortran_FLAGS_RELEASE:STRING=-DNDEBUG -DBUILD_SHARED_LIBS:BOOL=ON -DB>
Comment 3 Nicolas Fella 2023-09-24 13:22:02 UTC
Can you also give the full content of /usr/lib64/pkgconfig/KF6WaylandClient.pc ?
Comment 4 Nicolas Fella 2023-09-24 13:26:05 UTC
Does this also happen with kf5-kwayland (or any KF5 package)?
Comment 5 Nicolas Fella 2023-09-24 13:28:04 UTC
*** Bug 474701 has been marked as a duplicate of this bug. ***
Comment 6 Steve Cossette 2023-09-24 13:41:45 UTC
(In reply to Nicolas Fella from comment #4)
> Does this also happen with kf5-kwayland (or any KF5 package)?

Yes, kf6-bluez-qt (We're working on packaging more kf6 packages and we're two packagers doing this so there may be more)
Comment 7 Steve Cossette 2023-09-24 13:44:41 UTC
(In reply to Nicolas Fella from comment #3)
> Can you also give the full content of
> /usr/lib64/pkgconfig/KF6WaylandClient.pc ?

prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}//usr/lib64
includedir=/usr/include/KF6/KWayland

Name: KF6WaylandClient
Description: Qt-style API to interact with the wayland-client API
URL: https://www.kde.org/
Version: 5.240.0
Libs: -L${prefix}//usr/lib64 -lKF6WaylandClient
Cflags: -I/usr/include/KF6/KWayland 
Requires: Qt6Gui
Comment 8 Nicolas Fella 2023-09-24 13:53:23 UTC
(In reply to Steve Cossette from comment #6)
> (In reply to Nicolas Fella from comment #4)
> > Does this also happen with kf5-kwayland (or any KF5 package)?
> 
> Yes, kf6-bluez-qt (We're working on packaging more kf6 packages and we're
> two packagers doing this so there may be more)

I wanted to know about KF*5*
Comment 9 Nicolas Fella 2023-09-24 13:54:44 UTC
But I can answer that myself. /usr/lib64/pkgconfig/KF5WaylandClient.pc also shows this, so it's not a new problem. That makes sense, because the relevant code didn't change
Comment 10 Steve Cossette 2023-09-24 14:07:34 UTC
(In reply to Nicolas Fella from comment #9)
> But I can answer that myself. /usr/lib64/pkgconfig/KF5WaylandClient.pc also
> shows this, so it's not a new problem. That makes sense, because the
> relevant code didn't change

My bad.
Comment 11 Nicolas Fella 2023-09-26 22:27:36 UTC
I'm not entirely sure what's happening. In particular I'm wondering what the value of KDE_INSTALL_LIBDIR/CMAKE_INSTALL_LIBDIR is, but I don't see that being set to anything in your flags.

*maybe* https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/268 fixes the issue
Comment 12 Steve Cossette 2023-09-26 23:24:23 UTC
(In reply to Nicolas Fella from comment #11)
> I'm not entirely sure what's happening. In particular I'm wondering what the
> value of KDE_INSTALL_LIBDIR/CMAKE_INSTALL_LIBDIR is, but I don't see that
> being set to anything in your flags.
> 
> *maybe*
> https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/268
> fixes the issue

KDE_INSTALL_LIBDIR = /usr/lib64

The other, I actually don't know to be honest.
Comment 13 Steve Cossette 2023-09-26 23:28:49 UTC
I've asked around and CMAKE_INSTALL_LIBDIR is set on it's own, we don't set it
Comment 14 Nicolas Fella 2023-09-26 23:35:31 UTC
> KDE_INSTALL_LIBDIR = /usr/lib64

ah, that makes sense. the value is absolute, so the problem should be indeed fixed with https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/268