--nextPart1839024.eREmzoVPam Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On Wednesday 18 of May 2016 09:22:53 Andrew Savchenko wrote: > On Mon, 02 May 2016 18:06:44 +0200 Maciej Mrozowski wrote: > > Hello, > >=20 > > General advise: do not convert ebuilds inheriting cmake-utils to EA= PI 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=3D51= 4384). > >=20 > > Background: > >=20 > > 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=3D514384 and no alternative= was > > proposed. > > It opened new area of possible ebuild regression bugs when switchin= g to > > EAPI-6 for ebuilds inheriting cmake-utils.eclass. > >=20 > > Unfortunately there is common misconception, also among developers,= that > > it's sufficient to simply replace "${cmake-utils_use_with foo)" wit= h > > "-DWITH_foo=3DON" etc. > > This is MOST OF THE TIME not the case. > > When converting cmake-utils ebuild to EAPI>=3D6, one needs to consu= lt > > CMakeLists.txt wrt case each variable is written with since CMake i= s case- > > sensitive and WITH_FOO !=3D WITH_foo !=3D WITH_Foo. > >=20 > > Proposal: > >=20 > > CMake allows warning about unused CMake variables passed by CLI. Si= nce > > this is how Gentoo passes ebuild configuration options, it's propos= ed to > > enable this feature. > > Unfortunately it won't fail compilation but at least it gives a cha= nce to > > spot case mismatch when reading build output. > >=20 > > Future thoughts: > >=20 > > For better damage control it's technically possible to extend confi= gure > > phase of cmake-utuls eclass to check mycmakeargs against parsed pac= kage > > buildsystem but this might not be very reliable. >=20 > For me the real confusion was from this line: >=20 > die "${FUNCNAME[1]} is banned in EAPI 6 and later: use > -D$1${arg}=3D\"\$(usex $2)\" instead" >=20 > It recommends to use ${arg} without any warning about case, so when I= just > copied what it recommends: -DWITH_nls=3D"$(usex nls)", I had a nice s= urprise > and fun debugging. Ah, there you go.. @kensington Come on, man, you should have known better. Invalid suggestion removed. Thanks for noticing. I prefer to have developers figure out the right EAPI-6 migration path=20= themselves rather than blindly relying on suggestions: diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 427c13f..5958230 100644 =2D-- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -161,7 +161,7 @@ _cmake_use_me_now() { local arg=3D$2 [[ ! -z $3 ]] && arg=3D$3 =20 =2D [[ ${EAPI} =3D=3D [2345] ]] || die "${FUNCNAME[1]} is banned in= EAPI 6 and=20 later: use -D$1${arg}=3D\"\$(usex $2)\" instead" + [[ ${EAPI} =3D=3D [2345] ]] || die "${FUNCNAME[1]} is banned in= EAPI 6 and=20 later" =20 local uper capitalised x [[ -z $2 ]] && die "cmake-utils_use-$1 []= " @@ -184,7 +184,7 @@ _cmake_use_me_now_inverted() { [[ ! -z $3 ]] && arg=3D$3 =20 if [[ ${EAPI} !=3D [2345] && "${FUNCNAME[1]}" !=3D cmake- utils_use_find_package ]] ; then =2D die "${FUNCNAME[1]} is banned in EAPI 6 and later: use = =2D D$1${arg}=3D\"\$(usex $2)\" instead" + die "${FUNCNAME[1]} is banned in EAPI 6 and later" fi =20 local uper capitalised x regards MM --nextPart1839024.eREmzoVPam Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlc80GkACgkQFuHa/bHpVduq/wCgla1MGAzYpcyXHuDUE/O8o4fB Uo0AnRDlMCLrMG4e377dU5d8Q50vceB9 =zNY3 -----END PGP SIGNATURE----- --nextPart1839024.eREmzoVPam--