tech-pkg archive

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

Re: python311 vs expat



> This change broke both macOS and SunOS:
> 
> bac7175966909 (adam      2026-03-04 06:51:45 +0000  44) CONFIGURE_ARGS+=        --without-system-expat # requires expat_config.h
> 
> It means that python311 has both:
> 
>  CONFIGURE_ARGS+=        --with-system-expat
>  CONFIGURE_ARGS+=        --without-system-expat # requires expat_config.h
> 
> I don't understand how this can work.  Does this even work on NetBSD?
> 
> I think it's clearly a regression on any other system, so if this is a NetBSD-specific hack then it needs to go in an .if OPSYS section, and I'd recommend a very good comment explaining why we have both --with and --without because that makes no sense to me.

The problem is, not every operating system provides 'expat_config.h', but pkgsrc thinks the external expat is fine.

The --without-system-expat makes Python use the internal (vendored) expat.

A quick fix would be to make all Python packages force use expat from pkgsrc (see below).

How does that sounds?

Adam


diff -u -r1.45 Makefile
--- Makefile 19 Mar 2026 16:58:45 -0000 1.45
+++ Makefile 20 Mar 2026 06:17:57 -0000
@@ -38,9 +38,9 @@
 GNU_CONFIGURE= yes
 CONFIGURE_ARGS+= --enable-shared
 CONFIGURE_ARGS+= --with-openssl=${BUILDLINK_PREFIX.openssl}
+CONFIGURE_ARGS+= --with-system-expat
 CONFIGURE_ARGS+= --with-system-ffi
 CONFIGURE_ARGS+= --without-ensurepip
-CONFIGURE_ARGS+= --without-system-expat # requires expat_config.h
 CONFIGURE_ENV+= OPT=${CFLAGS:M*:Q}
 CONFIGURE_ENV+= ac_cv_path_mkdir=${TOOLS_PATH.mkdir}
 PKGCONFIG_OVERRIDE+= Misc/python.pc.in Misc/python-embed.pc.in
@@ -250,6 +250,7 @@
 .include "../../devel/libuuid/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
+PREFER.expat= pkgsrc # needs expat_config.h
 .include "../../textproc/expat/buildlink3.mk"
 .include "../../mk/bdb.buildlink3.mk"
 .include "../../mk/curses.buildlink3.mk"


Home | Main Index | Thread Index | Old Index