summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2021-07-30 15:21:09 +0100
committerGitHub <noreply@github.com>2021-07-30 16:21:09 +0200
commit7cad0bee80a536c7e47f54cf43174175834f30a0 (patch)
tree99a374e52a5f29194e463b81c04350b9259a01d7
parentf4367ba3c533fc2dc9e32aa431d674f715b911f2 (diff)
downloadcpython-git-7cad0bee80a536c7e47f54cf43174175834f30a0.tar.gz
Fail the CI if an optional module fails to compile (GH-27466)
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--.travis.yml1
-rw-r--r--setup.py3
3 files changed, 8 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3d79999b22..4081b36f92 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -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
diff --git a/.travis.yml b/.travis.yml
index 4b85da1a44..b2f7e27458 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -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:
diff --git a/setup.py b/setup.py
index 78eb68b849..59b2548810 100644
--- 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':