[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-dev
Subject: Re: [gentoo-dev] [RFC] Enable CMAKE_WARN_UNUSED_CLI by default in cmake-utils for EAPI>=6
From: Andrew Savchenko <bircoph () gentoo ! org>
Date: 2016-05-18 6:22:53
Message-ID: 20160518092253.dcc8a44b4c7e7cb8a07011c4 () gentoo ! org
[Download RAW message or body]
On Mon, 02 May 2016 18:06:44 +0200 Maciej Mrozowski wrote:
> Hello,
>
> General advise: do not convert ebuilds inheriting cmake-utils to EAPI 6 unless
> you know what you are doing (you are fully aware of eclass behaviour removed
> with https://bugs.gentoo.org/show_bug.cgi?id=514384).
>
> Background:
>
> Pre EAPI-6 cmake-utils.eclass contained certain feature to mitigate CMake
> variable case changes done by upstream.
> This feature was explicitly removed with
> https://bugs.gentoo.org/show_bug.cgi?id=514384 and no alternative was
> proposed.
> It opened new area of possible ebuild regression bugs when switching to EAPI-6
> for ebuilds inheriting cmake-utils.eclass.
>
> Unfortunately there is common misconception, also among developers, that it's
> sufficient to simply replace "${cmake-utils_use_with foo)" with "-DWITH_foo=ON"
> etc.
> This is MOST OF THE TIME not the case.
> When converting cmake-utils ebuild to EAPI>=6, one needs to consult
> CMakeLists.txt wrt case each variable is written with since CMake is case-
> sensitive and WITH_FOO != WITH_foo != WITH_Foo.
>
> Proposal:
>
> CMake allows warning about unused CMake variables passed by CLI. Since this is
> how Gentoo passes ebuild configuration options, it's proposed to enable this
> feature.
> Unfortunately it won't fail compilation but at least it gives a chance to spot
> case mismatch when reading build output.
>
> Future thoughts:
>
> For better damage control it's technically possible to extend configure phase
> of cmake-utuls eclass to check mycmakeargs against parsed package buildsystem
> but this might not be very reliable.
For me the real confusion was from this line:
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead"
It recommends to use ${arg} without any warning about case, so when I just
copied what it recommends: -DWITH_nls="$(usex nls)", I had a nice surprise
and fun debugging.
Best regards,
Andrew Savchenko
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic