Allow unsupported Python versions in RPM builds

epel10
Karolina Surma 10 months ago
parent e8d9601405
commit b9ab196aac

@ -0,0 +1,33 @@
From af6273b4fbc1c9439a9b1e69761838479ba4bd71 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Thu, 18 Apr 2024 09:48:04 +0200
Subject: [PATCH] Allow unsupported Python versions in RPM builds
Downstream-only patch: always allow unsupported versions of Python.
In Fedora, we constantly attempt to integrate alpha and beta releases of Python
and rebuild all dependent packages in Copr. We need to be able to build the
packages that use pyo3-ffi without patching each and every one of them,
hence we explicitly allow to skip version check when building RPMs.
---
build.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/build.rs b/build.rs
index 286767d..ef666d7 100644
--- a/build.rs
+++ b/build.rs
@@ -36,6 +36,11 @@ fn ensure_python_version(interpreter_config: &InterpreterConfig) -> Result<()> {
return Ok(());
}
+ // Skip version check when building RPMs - we want to build them with unsupported Python versions too
+ if std::env::var("RPM_BUILD_ROOT").as_deref().is_ok() {
+ return Ok(());
+ }
+
match interpreter_config.implementation {
PythonImplementation::CPython => {
let versions = SUPPORTED_VERSIONS_CPYTHON;
--
2.44.0

@ -16,6 +16,13 @@ Source: %{crates_source}
# * drop MSVC- and MinGW-only features # * drop MSVC- and MinGW-only features
Patch: pyo3-ffi-fix-metadata.diff Patch: pyo3-ffi-fix-metadata.diff
# Downstream-only patch: always allow unsupported versions of Python.
# We constantly attempt to integrate alpha and beta releases of Python
# and need to rebuild all dependent packages in Copr, also those that
# use pyo3-ffi without patching each and every one of them,
# hence we explicitly allow to skip version check when building RPMs.
Patch: Allow-unsupported-Python-versions-in-RPM-builds.patch
BuildRequires: cargo-rpm-macros >= 24 BuildRequires: cargo-rpm-macros >= 24
BuildRequires: python3-devel >= 3.7 BuildRequires: python3-devel >= 3.7

Loading…
Cancel
Save