]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.9] Fail the CI if an optional module fails to compile (GH-27466). (GH-27482)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 30 Jul 2021 14:51:13 +0000 (15:51 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Jul 2021 14:51:13 +0000 (15:51 +0100)
(cherry picked from commit 7cad0bee80a536c7e47f54cf43174175834f30a0)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
.github/workflows/build.yml
.travis.yml
setup.py

index a4efb42f5aa0645ad2973bcf0cf4bc53b8e5bc3c..3c0a41478e2ed191e74a0efc88eff623ee53f4c0 100644 (file)
@@ -133,6 +133,8 @@ jobs:
     runs-on: macos-latest
     needs: check_source
     if: needs.check_source.outputs.run_tests == 'true'
+    env:
+      PYTHONSTRICTEXTENSIONBUILD: 1
     steps:
     - uses: actions/checkout@v2
     - name: Configure CPython
@@ -151,6 +153,7 @@ jobs:
     if: needs.check_source.outputs.run_tests == 'true'
     env:
       OPENSSL_VER: 1.1.1k
+      PYTHONSTRICTEXTENSIONBUILD: 1
     steps:
     - uses: actions/checkout@v2
     - name: Install Dependencies
index 02b2afa4816c77ae8ce628da574402e60b50c7a1..171e4d053917ebaea3f6645a5ed9f99a0d454b57 100644 (file)
@@ -18,6 +18,7 @@ env:
     # Set rpath with env var instead of -Wl,-rpath linker flag
     # OpenSSL ignores LDFLAGS when linking bin/openssl
     - LD_RUN_PATH="${OPENSSL_DIR}/lib"
+    - PYTHONSTRICTEXTENSIONBUILD=1
 
 branches:
   only:
index 1ac68df888d96ccff61a625c94e912d2f214e618..06fd9be194b2fbf770332dd250d453d1368e09ff 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -540,6 +540,9 @@ class PyBuildExt(build_ext):
                   "APIs, https://github.com/libressl-portable/portable/issues/381")
             print()
 
+        if os.environ.get("PYTHONSTRICTEXTENSIONBUILD") and (self.failed or self.failed_on_import):
+            raise RuntimeError("Failed to build some stdlib modules")
+
     def build_extension(self, ext):
 
         if ext.name == '_ctypes':