Skip to content

Commit

Permalink
Fail the CI if an optional module fails to compile (pythonGH-27466)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal authored Jul 30, 2021
1 parent f4367ba commit 7cad0be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ def print_three_column(lst):
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':
Expand Down

0 comments on commit 7cad0be

Please sign in to comment.