From nobody Fri Nov 18 21:45:18 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDVhF5S75z4hQ6m for ; Fri, 18 Nov 2022 21:45:33 +0000 (UTC) (envelope-from developer@lorenzosalvadore.it) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "protonmail.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDVhF30tQz3y3B; Fri, 18 Nov 2022 21:45:33 +0000 (UTC) (envelope-from developer@lorenzosalvadore.it) Authentication-Results: mx1.freebsd.org; none Date: Fri, 18 Nov 2022 21:45:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lorenzosalvadore.it; s=protonmail; t=1668807931; x=1669067131; bh=YKH7MiPWDjpxiwd2iKb0kWPBUy2npGgkSwSB3GNG7Rk=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=RIZ/926/onH3ZUfAET/R2MgPokdv55sfDxAVVPU/89G07c3zM5Xx4jnDcHEn+CSqL WgHGC02R+fxE1Lalpe5CWmpU9hQBBr71uZPJTUYIeQ1Bh8sOlHE9vhBFas9KXB+cfG lF2Hq5bbsllm6JzpZtPdhYnAPUPoJ9gJ88s0AEJ1JNn769OGQqEqh2PAE2Z68ogPTU ivZSE+t6w+p2znNN+rvFgfy1rwYe2lSEC2bO2Hfhcv4XlX/9mPNRjJ8bUJPIsOgw76 sfKFOngNVhMU/A0gRYDM54u7Euq8aKFo+F6KiNiz8wuF1oLhHh/piwIuZARp26AdMI qiC2lsiwaRkEw== To: =?utf-8?Q?T=C4=B3l_Coosemans?= From: Lorenzo Salvadore Cc: Lorenzo Salvadore , thierry@FreeBSD.org, yuri@FreeBSD.org, ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org, Gerald Pfeifer Subject: Re: git: 4191c71fbd22 - main - Mk/Uses/fortran.mk: Make gfortran respect USE_GCC Message-ID: In-Reply-To: <20221118204110.5ff6c228@hal.tijl.coosemans.org> References: <202211162139.2AGLdojd006463@gitrepo.freebsd.org> <20221118204110.5ff6c228@hal.tijl.coosemans.org> Feedback-ID: 53711648:user:proton List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4NDVhF30tQz3y3B X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:62371, ipnet:185.70.43.0/24, country:CH] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N ------- Original Message ------- On Friday, November 18th, 2022 at 8:41 PM, T=C4=B3l Coosemans wrote: >=20 >=20 > On Wed, 16 Nov 2022 21:39:50 GMT Lorenzo Salvadore > salvadore@FreeBSD.org wrote: >=20 > > The branch main has been updated by salvadore: > >=20 > > URL: https://cgit.FreeBSD.org/ports/commit/?id=3D4191c71fbd229e5a96382b= c6fa271a1ce5668b0f > >=20 > > commit 4191c71fbd229e5a96382bc6fa271a1ce5668b0f > > Author: Lorenzo Salvadore salvadore@FreeBSD.org > > AuthorDate: 2022-11-16 14:43:40 +0000 > > Commit: Lorenzo Salvadore salvadore@FreeBSD.org > > CommitDate: 2022-11-16 21:38:54 +0000 > >=20 > > Mk/Uses/fortran.mk: Make gfortran respect USE_GCC > >=20 > > Allow choosing a specific version of gfortran through USE_GCC variable. > >=20 > > PR: 266196 > > Approved by: thierry (fortran) > > Co-authored by: thierry > > --- > > Mk/Uses/fortran.mk | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/Mk/Uses/fortran.mk b/Mk/Uses/fortran.mk > > index 09ebd62b1a0f..d335fad4dc8e 100644 > > --- a/Mk/Uses/fortran.mk > > +++ b/Mk/Uses/fortran.mk > > @@ -14,7 +14,11 @@ fortran_ARGS=3D ${FORTRAN_DEFAULT} > > . endif > >=20 > > . if ${fortran_ARGS} =3D=3D gfortran > > +. if empty(USE_GCC) > > _GCC_VER=3D ${GCC_DEFAULT:S/.//} > > +. else > > +_GCC_VER=3D ${_USE_GCC} > > +. endif > > BUILD_DEPENDS+=3D gfortran${_GCC_VER}:lang/gcc${_GCC_VER} > > RUN_DEPENDS+=3D gfortran${_GCC_VER}:lang/gcc${_GCC_VER} > > F77=3D gfortran${_GCC_VER} >=20 >=20 > When I wrote this file I didn't include this because users will end up > with multiple versions of GCC installed, each with its own set of runtime > libraries. So they'll have programs/libraries built against different > runtime libraries and those don't always work together. For instance, > science/octopus is now built with GCC 11 but its dependencies like > lapack are built with GCC 12. These dependencies may require features > from GCC 12 runtime libraries while science/octopus programs probably > (I haven't checked) load GCC 11 runtime libraries when you run them. I do not think it is a big issue if multiple versions of GCC are installed at the same time. Indeed, USE_GCC exists since a long time and while a few bugs might arise sometimes, they get fixed eventually and things work fine. Moreover, if for some fortran dependent port it is better to ignore USE_GCC= , it is sufficient to set USE_GCC=3Dyes and things work just as before this c= ommit. > Even if this happens to work now it may not work when the default > switches to 13. I believe it's better for ports like science/octopus to > have something like this in their Makefile: >=20 > .if ${GCC_DEFAULT} !=3D 11 > IGNORE=3D This port only works with gcc 11. You can add DEFAULT_VERSIONS+= =3Dgcc=3D11 to /etc/make.conf > .endif I think this is a bad idea as: - it prevents the port to be built on the official packages builder as soon= as GCC_DEFAULT gets updated to 12, so that users that prefer to install softwa= re from packages only cannot install science/octopus anymore; - adding DEFAULT_VERSIONS+=3Dgcc11 to /etc/make.conf would change the depen= dencies of all the gcc dependent ports, not just science/octopus. This could genera= te more issues: what if a port does not build with GCC 11 but needs GCC 12+ in= stead? > I noticed there's a new version of Octopus so maybe an update would fix > this particular case. I hope so, but if Yuri has not done that update yet I guess that the update is not straightforward. Setting USE_GCC together with this commit allows th= e update of GCC_DEFAULT to proceed instead of waiting for science/octopus. Moreover, GCC 11 is not going away any soon, so, while this is hopefully a temporary solution, it can safely last many months without any risk to brea= k science/octopus in the short term. That said, if you want to revert the commit on Mk/Uses/fortran.mk it is fin= e for me as long as another solution is implemented to prevent science/octopu= s from blocking GCC_DEFAULT upgrade. Please note that I also had suggested an alternative solution in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266196#c5 : "the issue can probably be fixed by setting the dependency on gfortran11 explicitely and dropping USE=3Dfortran". Cheers, Lorenzo Salvadore