1 |
On Mon, 02 May 2016 18:06:44 +0200 Maciej Mrozowski wrote: |
2 |
> Hello, |
3 |
> |
4 |
> General advise: do not convert ebuilds inheriting cmake-utils to EAPI 6 unless |
5 |
> you know what you are doing (you are fully aware of eclass behaviour removed |
6 |
> with https://bugs.gentoo.org/show_bug.cgi?id=514384). |
7 |
> |
8 |
> Background: |
9 |
> |
10 |
> Pre EAPI-6 cmake-utils.eclass contained certain feature to mitigate CMake |
11 |
> variable case changes done by upstream. |
12 |
> This feature was explicitly removed with |
13 |
> https://bugs.gentoo.org/show_bug.cgi?id=514384 and no alternative was |
14 |
> proposed. |
15 |
> It opened new area of possible ebuild regression bugs when switching to EAPI-6 |
16 |
> for ebuilds inheriting cmake-utils.eclass. |
17 |
> |
18 |
> Unfortunately there is common misconception, also among developers, that it's |
19 |
> sufficient to simply replace "${cmake-utils_use_with foo)" with "-DWITH_foo=ON" |
20 |
> etc. |
21 |
> This is MOST OF THE TIME not the case. |
22 |
> When converting cmake-utils ebuild to EAPI>=6, one needs to consult |
23 |
> CMakeLists.txt wrt case each variable is written with since CMake is case- |
24 |
> sensitive and WITH_FOO != WITH_foo != WITH_Foo. |
25 |
> |
26 |
> Proposal: |
27 |
> |
28 |
> CMake allows warning about unused CMake variables passed by CLI. Since this is |
29 |
> how Gentoo passes ebuild configuration options, it's proposed to enable this |
30 |
> feature. |
31 |
> Unfortunately it won't fail compilation but at least it gives a chance to spot |
32 |
> case mismatch when reading build output. |
33 |
> |
34 |
> Future thoughts: |
35 |
> |
36 |
> For better damage control it's technically possible to extend configure phase |
37 |
> of cmake-utuls eclass to check mycmakeargs against parsed package buildsystem |
38 |
> but this might not be very reliable. |
39 |
|
40 |
For me the real confusion was from this line: |
41 |
|
42 |
die "${FUNCNAME[1]} is banned in EAPI 6 and later: use -D$1${arg}=\"\$(usex $2)\" instead" |
43 |
|
44 |
It recommends to use ${arg} without any warning about case, so when I just |
45 |
copied what it recommends: -DWITH_nls="$(usex nls)", I had a nice surprise |
46 |
and fun debugging. |
47 |
|
48 |
Best regards, |
49 |
Andrew Savchenko |