From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AFDD4138262 for ; Wed, 18 May 2016 20:28:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DC6BC14320; Wed, 18 May 2016 20:28:33 +0000 (UTC) Received: from mail-lb0-f195.google.com (mail-lb0-f195.google.com [209.85.217.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id ADCD514304 for ; Wed, 18 May 2016 20:28:32 +0000 (UTC) Received: by mail-lb0-f195.google.com with SMTP id qf3so3382618lbb.0 for ; Wed, 18 May 2016 13:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:in-reply-to:references :mime-version; bh=EU4LdFgacCavjhLpiUqbzdeqCypD2sOQldXFY/hEK50=; b=Mx+jYj8IxyQm+FnAvwT7nDRsDwWvTDE7clwHrUEo6gH7zydE+6szCgjgS92M5x63T1 vG/u1Utr/dRLz73eTXjNt6UCC2QJN+TdzweYISmHGRV+BTpGZOTDvlwWDayqqs78/HAn CzYCCJw5372PXluzewD0Vqo5Yv0yBczpt6IAXuBolAV2xslnibN8o+0VePYvSEsa/JxM gUjHnc/55MZNi4BI6lv18HARHy64EEq6yZFm7mLj3rkODeUsLVAGE0h/4ktXMUqcRkDQ 7aTXaLeJu7DEnf/rnuDPSBp0DKBqpAFJuMJFcV8vrDj2BrNi1oA5jA+SbjeCRNgrv2ot necA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :in-reply-to:references:mime-version; bh=EU4LdFgacCavjhLpiUqbzdeqCypD2sOQldXFY/hEK50=; b=d0oFbs8bbWY3g1UhcepUyoaje677OqdMFIAJVSZTg83JW5JSoNP4Q56Y+hZA6UxoMx Pw0EVXdNKPvcNwTJqyCGKsv9qLXa66ty3UnsKFTZjmJzDR6XMCVZmoracc9QJf1SuqFp pEjGsjrAEGIUGOO3Yc5An52dIqRpbfKfvHjsS0/ghuq7oYI8vpZ1hS9qOItxcc8BqS83 +t5I+a+56og3nV4Ivnp8CjLKgB9HZAB8E09hHd8+7dnQFFub4ESc/8RDSQBJ4R3gwW/T RGx87SS/cwu+zC3CyDhaRHNZLm7waZOCFcFPUep9+UqtyWn2vBItl5I5od7r2tycgEBH Lv8w== X-Gm-Message-State: AOPr4FVXb5CHnU/ocH/QggqCM7Rttd2xDHGancWvyk6z3iwVY0lrernxZ35wdmYetSi8Sw== X-Received: by 10.112.146.136 with SMTP id tc8mr3174620lbb.78.1463603310913; Wed, 18 May 2016 13:28:30 -0700 (PDT) Received: from liwardyna.localnet (90-156-71-188.internetia.net.pl. [90.156.71.188]) by smtp.gmail.com with ESMTPSA id ts5sm1687071lbb.40.2016.05.18.13.28.29 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 May 2016 13:28:29 -0700 (PDT) From: Maciej Mrozowski To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [RFC] Enable CMAKE_WARN_UNUSED_CLI by default in cmake-utils for EAPI>=6 Date: Wed, 18 May 2016 22:28:25 +0200 Message-ID: <3920608.pHNNlbhsxm@liwardyna> User-Agent: KMail/4.14.10 (Linux/4.4.6-gentoo; KDE/4.14.19; x86_64; ; ) In-Reply-To: <20160518092253.dcc8a44b4c7e7cb8a07011c4@gentoo.org> References: <2425813.40BMEBc0ED@liwardyna> <20160518092253.dcc8a44b4c7e7cb8a07011c4@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1839024.eREmzoVPam"; micalg="pgp-sha1"; protocol="application/pgp-signature" X-Archives-Salt: fd3f0d75-b431-4e36-974a-3a3ef6b16916 X-Archives-Hash: 076dfb3495f733a184fee3cde2f9168d --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--