]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fail the CI if an optional module fails to compile (GH-27466)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 30 Jul 2021 14:21:09 +0000 (15:21 +0100)
committerGitHub <noreply@github.com>
Fri, 30 Jul 2021 14:21:09 +0000 (16:21 +0200)
.github/workflows/build.yml
.travis.yml
setup.py

index 3d79999b229ba7840c32af59a9954803084d7184..4081b36f926a2af8bbbbc9982257f9d40c615754 100644 (file)
@@ -119,6 +119,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
@@ -137,6 +139,7 @@ jobs:
     if: needs.check_source.outputs.run_tests == 'true'
     env:
       OPENSSL_VER: 1.1.1k
+      PYTHONSTRICTEXTENSIONBUILD: 1
     steps:
     - uses: actions/checkout@v2
     - name: Register gcc problem matcher
@@ -227,6 +230,7 @@ jobs:
     if: needs.check_source.outputs.run_tests == 'true'
     env:
       OPENSSL_VER: 1.1.1k
+      PYTHONSTRICTEXTENSIONBUILD: 1
       ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
     steps:
     - uses: actions/checkout@v2
index 4b85da1a44c0368029397efc4d90a5b5ef11f5e3..b2f7e2745871137dd29012896e4fcc564c59416d 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 78eb68b8492f3d7d2a04a52596e5a02c562aafc5..59b2548810cbf0dac6a9f9c1aa2a1e6dc2da1d0c 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -571,6 +571,9 @@ class PyBuildExt(build_ext):
                 print("Custom linker flags may require --with-openssl-rpath=auto")
             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':