Skip to content

Commit 3a806b1

Browse files
authored
[3.9] Fail the CI if an optional module fails to compile (GH-27466). (GH-27482)
(cherry picked from commit 7cad0be) Co-authored-by: Pablo Galindo Salgado <[email protected]>
1 parent 168879e commit 3a806b1

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ jobs:
133133
runs-on: macos-latest
134134
needs: check_source
135135
if: needs.check_source.outputs.run_tests == 'true'
136+
env:
137+
PYTHONSTRICTEXTENSIONBUILD: 1
136138
steps:
137139
- uses: actions/checkout@v2
138140
- name: Configure CPython
@@ -151,6 +153,7 @@ jobs:
151153
if: needs.check_source.outputs.run_tests == 'true'
152154
env:
153155
OPENSSL_VER: 1.1.1k
156+
PYTHONSTRICTEXTENSIONBUILD: 1
154157
steps:
155158
- uses: actions/checkout@v2
156159
- name: Install Dependencies

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
# Set rpath with env var instead of -Wl,-rpath linker flag
1919
# OpenSSL ignores LDFLAGS when linking bin/openssl
2020
- LD_RUN_PATH="${OPENSSL_DIR}/lib"
21+
- PYTHONSTRICTEXTENSIONBUILD=1
2122

2223
branches:
2324
only:

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ def print_three_column(lst):
540540
"APIs, https://github.com/libressl-portable/portable/issues/381")
541541
print()
542542

543+
if os.environ.get("PYTHONSTRICTEXTENSIONBUILD") and (self.failed or self.failed_on_import):
544+
raise RuntimeError("Failed to build some stdlib modules")
545+
543546
def build_extension(self, ext):
544547

545548
if ext.name == '_ctypes':

0 commit comments

Comments
 (0)