nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.35k stars 321 forks source link

Support Python 3.11/3.12 on RHEL 8/9 #1370

Open tjmullicani opened 1 month ago

tjmullicani commented 1 month ago

RHEL (and clones) have Python 3.11/3.12 packages in the AppStream repo. It should be easy to add RPMs for these versions.

Example RPMs:

One issue I see is that Fedora 39 does not have a python3.12 RPM, since it appears to be the default python3 RPM. This will cause issues setting the value of BUILD_DEPENDS_python312 between RHEL and Fedora.

diff --git a/pkg/rpm/Makefile b/pkg/rpm/Makefile
index f00b336a..9796dfd0 100644
--- a/pkg/rpm/Makefile
+++ b/pkg/rpm/Makefile
@@ -40,6 +40,8 @@ include Makefile.python27
 include Makefile.python36
 include Makefile.python38
 include Makefile.python39
+include Makefile.python311
+include Makefile.python312
 include Makefile.go
 include Makefile.perl
 include Makefile.jsc-common
@@ -51,6 +53,8 @@ endif
 ifeq ($(OSVER), centos9)
 include Makefile.php
 include Makefile.python39
+include Makefile.python311
+include Makefile.python312
 include Makefile.go
 include Makefile.perl
 include Makefile.jsc-common
diff --git a/pkg/rpm/Makefile.python312 b/pkg/rpm/Makefile.python312
index c37069eb..e60f116d 100644
--- a/pkg/rpm/Makefile.python312
+++ b/pkg/rpm/Makefile.python312
@@ -13,7 +13,7 @@ MODULE_INSTARGS_python312=    python3.12-install
 MODULE_SOURCES_python312=      unit.example-python-app \
                        unit.example-python312-config

-BUILD_DEPENDS_python312=       python3-devel
+BUILD_DEPENDS_python312=       python3.12-devel

 BUILD_DEPENDS+=                $(BUILD_DEPENDS_python312)
javorszky commented 1 month ago

pinging @thresheek as you have the appropriate context to help us with this

thresheek commented 1 month ago

Thanks for the suggestion @tjmullicani

I think we can adapt RHEL builds to this change; we can use OSVER to distinguish between those in the Makefiles..

I need to check what steps we need to make on our packaging infra to get this done, but I think it's doable in general.