Skip to content

Commit 83d4599

Browse files
zaniebsrinivasreddy
authored andcommitted
pythongh-100384: Error on unguarded-availability in macOS builds (python#128155)
Generate a build error on ``unguarded-availability`` in portable macOS builds (i.e. using MACOSX_DEPLOYMENT_TARGET), preventing invalid use of symbols that are not available in older versions of the OS.
1 parent f42b555 commit 83d4599

File tree

4 files changed

+51
-0
lines changed

4 files changed

+51
-0
lines changed

.github/workflows/reusable-macos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
brew link --overwrite tcl-tk@8
4646
- name: Configure CPython
4747
run: |
48+
MACOSX_DEPLOYMENT_TARGET=10.15 \
4849
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
4950
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
5051
./configure \
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Error on ``unguarded-availability`` in macOS builds, preventing invalid
2+
use of symbols that are not available in older versions of the OS.

configure

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,6 +2603,13 @@ AS_VAR_IF([ac_cv_gcc_compat], [yes], [
26032603
esac
26042604
AC_MSG_RESULT([$CC])
26052605
2606+
# Error on unguarded use of new symbols, which will fail at runtime for
2607+
# users on older versions of macOS
2608+
AX_CHECK_COMPILE_FLAG([-Wunguarded-availability],
2609+
[AS_VAR_APPEND([CFLAGS_NODIST], [" -Werror=unguarded-availability"])],
2610+
[],
2611+
[-Werror])
2612+
26062613
LIPO_INTEL64_FLAGS=""
26072614
if test "${enable_universalsdk}"
26082615
then

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy