From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 799AF138334 for ; Thu, 1 Nov 2018 22:29:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AB3D5E0843; Thu, 1 Nov 2018 22:28:31 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 44BDBE0833 for ; Thu, 1 Nov 2018 22:28:31 +0000 (UTC) Received: from localhost (unknown [91.246.83.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bircoph) by smtp.gentoo.org (Postfix) with ESMTPSA id 807DE335CA6 for ; Thu, 1 Nov 2018 22:28:29 +0000 (UTC) Date: Fri, 2 Nov 2018 01:27:44 +0300 From: Andrew Savchenko To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] fortran-2.eclass: support EAPI 7 Message-Id: <20181102012744.475046f4a4cf9aadf5f17c67@gentoo.org> In-Reply-To: <1540883938.1250.6.camel@gentoo.org> References: <20181028013841.7bd52f2b363d0b11fbe97dd1@gentoo.org> <1540751368.7710.0.camel@gentoo.org> <20181029035705.59f926ed6e7e604baa84de0c@gentoo.org> <1540883938.1250.6.camel@gentoo.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-linux-gnu) 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; protocol="application/pgp-signature"; micalg="PGP-SHA512"; boundary="Signature=_Fri__2_Nov_2018_01_27_44_+0300_ARS1v+sdDPAyd2fa" X-Archives-Salt: dfe35d62-5152-4f60-8a7d-3959a29df5bf X-Archives-Hash: 0742ad3065feb4698543c25ba5bcb9b6 --Signature=_Fri__2_Nov_2018_01_27_44_+0300_ARS1v+sdDPAyd2fa Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! On Tue, 30 Oct 2018 08:18:58 +0100 Micha=C5=82 G=C3=B3rny wrote: > On Mon, 2018-10-29 at 03:57 +0300, Andrew Savchenko wrote: > > On Sun, 28 Oct 2018 19:29:28 +0100 Micha=C5=82 G=C3=B3rny wrote: > > > On Sun, 2018-10-28 at 01:38 +0300, Andrew Savchenko wrote: > > > > Hi all! > > > >=20 > > > > The only blocker for EAPI 7 update is eutils inheritance, but it > > > > seems to be not used within the current eclass code, probably a > > > > remnant from older days. So it is removed. > > > >=20 > > > > Looks like no other EAPI 7 specific changes needed. > > > >=20 > > >=20 > > > Please use -U99999 to include more context to the patches. >=20 > I'm going to include a few 'easy cleanup' comments since EAPI 7 > is a good opportunity to improve the eclass. I'm going to skip horribly > bad design decisions since I suppose nobody cares. Should we really mix EAPI bump with full code review? This eclass is small, so no harm here. But for larger eclasses (hello java-*.eclass) this will hinder updates considerably. I prefer to fix something rather than to fix nothing while frustrating in attempt to fix everything at once. Also this make git history review harder as fixes for independent issues will be mixed together. So I kindly ask you for future updates (from everyone, not just me) focus on review of the proposed changes instead of reviewing full code. Thank you for understanding. > > # @FUNCTION: fortran_int64_abi_fflags > > # @DESCRIPTION: > > # Return the Fortran compiler flag to enable 64 bit integers for > > # array indices > > # @CODE > > fortran_int64_abi_fflags() { > > debug-print-function ${FUNCNAME} "${@}" > > =20 > > _FC=3D$(tc-getFC) >=20 > Any reason not to make it local? Fixed. =20 > > # @FUNCTION: _fortran_write_testsuite > > # @INTERNAL > > # @DESCRIPTION: > > # writes fortran test code > > _fortran_write_testsuite() { > > debug-print-function ${FUNCNAME} "${@}" > > =20 > > local filebase=3D${T}/test-fortran > > =20 > > # f77 code > > cat <<- EOF > "${filebase}.f" >=20 > || die Done. > > end > > EOF > > =20 > > # f90/95 code > > cat <<- EOF > "${filebase}.f90" >=20 > || die Done. > > end >=20 > Also, why different indentation? I prefer not to touch it. Fortran compilers are quite picky with leading spaces or tabs. > > EOF > > =20 > > # f2003 code > > cat <<- EOF > "${filebase}.f03" >=20 > || die Done. > > # @FUNCTION: _fortran-has-openmp > > # @RETURN: return code of the compiler > > # @INTERNAL > > # @DESCRIPTION: > > # See if the fortran supports OpenMP. > > _fortran-has-openmp() { > > debug-print-function ${FUNCNAME} "${@}" > > =20 > > local flag > > local filebase=3D${T}/test-fc-openmp > > local fcode=3D${filebase}.f > > local ret > > local _fc=3D$(tc-getFC) > > =20 > > cat <<- EOF > "${fcode}" >=20 > || die Done. =20 > > for flag in -fopenmp -xopenmp -openmp -mp -omp -qsmp=3Domp; do > > ${_fc} ${flag} "${fcode}" -o "${fcode}.x" \ > > &>> "${T}"/_fortran_compile_test.log > > ret=3D$? > > (( ${ret} )) || break >=20 > This (( ... )) is unreadable at best; please replace it with clear > condition. Fixed. ret variable is not needed at all. > > # @FUNCTION: _fortran_die_msg > > # @INTERNAL > > # @DESCRIPTION: > > # Detailed description how to handle fortran support > > _fortran_die_msg() { > > debug-print-function ${FUNCNAME} "${@}" > > =20 > > echo >=20 > Don't mix echo with eerror. Done. > > # @FUNCTION: _fortran-2_pkg_setup > > # @INTERNAL > > # @DESCRIPTION: > > # _The_ fortran-2_pkg_setup() code > > _fortran-2_pkg_setup() { > > for _f_use in ${FORTRAN_NEEDED}; do > > case ${_f_use} in > > always) > > _fortran_test_function && break > > ;; > > no) > > einfo "Forcing fortran support off" > > break > > ;; > > *) > > if use ${_f_use}; then > > _fortran_test_function && break > > else > > unset FC > > unset F77 > > fi >=20 > This contradicts the dependency atoms. >=20 > If FORTRAN_NEEDED=3D"foo bar", you'll get: >=20 > DEP=3D"foo? ( virtual/fortran ) bar? ( virtual/fortran )" >=20 > However, with USE=3D"foo -bar" this will first set the compiler > for USE=3Dfoo, then reset it for USE=3Dbar. Ok, now both case and for will break immediately if fortran compiler is found and passed tests. =20 The updated full v2 patch will be sent as a separate e-mail. Best regards, Andrew Savchenko --Signature=_Fri__2_Nov_2018_01_27_44_+0300_ARS1v+sdDPAyd2fa Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE63ZIHsdeM+1XgNer9lNaM7oe5I0FAlvbfeAACgkQ9lNaM7oe 5I3MrA/+MeQbk2We3ud75aU+AtQXDbtC03dxEj6kXFG6XS8IvzBhKQbFAmrCHC7y +i2ezdkJAHbV8wBCyz3ES8caGUSWy5OX6lu2t+Lm4uF1wWE0KMtIKte+W8Q47tR8 hyFqOAh4c3wAUi41JN/plCRhae+73lsCRD/wy9ZRfBnsuaGW79ulTM1vnMxeC2Hp KjWGVj6zqeKiEzxLTPNDLfE70gZsCpoEoJWrN5JSKQuhAjn0inGD7EX0DrVUq4SA 9jVOcECXT5FR8x+5fUE6DixF+3jyHvxU3WZWJe4h/AUHVSDCYbDiWqFbprHAjE/C FtFDHTyzeiWhvBOvHrHOKIfr/a4jiUoohJVd3X/PzohqOUWOC44ARTODPUp8N0nt k08Oqi11jr4vByYfrZaxu+Bp2sPoW4WnHePZo/FGl34UGz2wjuwyFv+S7t7V3kry L6V+jHXv+50PrTbGT86dRSuCDvOnre7CtLMyrI0BeLqtGPErilTr3pHLSjp9MR2b 0qxCEHyGHPgBLyYO4goCJzskEgqSPxpymOm0KzQ5WJ7/WzZDgKUl++iS6Yi+X+ud icyYNx9SvKMmNl+1oJH88eMZ9FNxbQN+wg8Z+Zjlaor9xxguk7IwK3rpe5XHQ0gh tQlVBh/h+E8Uw23x00MbdtsKhg4gQQQBPthfh2cHt4YKvLTWudE= =rOIV -----END PGP SIGNATURE----- --Signature=_Fri__2_Nov_2018_01_27_44_+0300_ARS1v+sdDPAyd2fa--