tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Fixing lang/python311 by splitting off NIS module (Re: using pkg-config modules from host (Re: wip/py-numpy + blas))



"Dr. Thomas Orgis" <thomas.orgis%uni-hamburg.de@localhost> writes:

> Am Wed, 27 Dec 2023 13:47:50 -0500
> schrieb Greg Troxel <gdt%lexort.com@localhost>:
>
>> Why isn't that all "if linux"?
>
> 1. Probably because this is just my local hack while I was busy with
>    elsethings.
>
> 2. Because it mirrors what the configure script does. Or at least
>    enough to make it work for me. There is no check for Linux. And
>    also, this is a details of glibc, not Linux. But I guess we don't
>    care about systems where that difference matters (Debian/kFreeBSD,
>    Linux with musl)?

My point is

  libnsl seems to be a Linux thing.  the nis module builds on NetBSD
  without it.

  Other than "nis is not present on Linux, except when it is", we are
  not having general problems.  Every change has a risk of breakage, and
  limiting the scope of change narrows that risk.  For !Linux, there is
  no gain and only possible trouble.  Were we in month 1 vs freeze, the
  situation would be different.

In theory, this should be correct everywhere, but in practice the more
obscure cases do not seem to have users who are testing and reporting,
and do not seem to have volunteers to work on it for theoretical users.
So we are left to try to be architecturally clean and hope for the
best.

> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/pkgsrc/lang/python311/Makefile,v
> retrieving revision 1.22
> diff -u -r1.22 Makefile
> --- Makefile	11 Dec 2023 10:23:42 -0000	1.22
> +++ Makefile	27 Dec 2023 20:16:50 -0000
> @@ -111,10 +111,16 @@
>  PLIST.dbm=	yes
>  .endif
>  .for incdir in ${_OPSYS_INCLUDE_DIRS}
> -.  if (exists(${incdir}/rpc/rpc.h) || exists(${incdir}/tirpc/rpc/rpc.h))
> +.  if exists(${incdir}/rpc/rpc.h)
> +HAVE_RPC_H=	yes
> +.  elif exists(${incdir}/tirpc/rpc/rpc.h)
> +CPPFLAGS+=	-I${incdir}/tirpc
>  HAVE_RPC_H=	yes
>  .  endif
> -.  if (exists(${incdir}/rpcsvc/yp_prot.h) || exists(${incdir}/nsl/rpcsvc/yp_prot.h))
> +.  if exists(${incdir}/rpcsvc/yp_prot.h)
> +HAVE_YP_PROT_H=	yes
> +.  elif exists(${incdir}/nsl/rpcsvc/yp_prot.h)
> +CPPFLAGS+=	-I${incdir}/nsl
>  HAVE_YP_PROT_H=	yes
>  .  endif
>  .endfor
>
> Would that be good? I used CPPFLAGS instead of CFLAGS since configure
> nags that compiler and preprocessor differ in finding the header
> otherwise. It's more correct, anyway (although other include flags are
> put into CFLAGS in the Makefile).

Yes, I think that's ok.   Feels a bit scary to touch the !Linux case,
but it's really just splitting an if and setting extra CPPFLAGS on the
linuxy/glibc-ish branch of the if.


Post branch, as someone suggested to me offlist, I think it makes sense
to import libnsl and watch bulk builds and get people to test and see if
it really does build everywhere we want it to.  And then if so, make
python depend on it if linux.  If it isn't reliable, then I think we
need to replan.


Home | Main Index | Thread Index | Old Index