Skip to content

gh-156764: Fix safety configure option defaults - #156767

Open
lpyu001 wants to merge 10 commits into
python:mainfrom
lpyu001:configure
Open

lpyu001 wants to merge 10 commits into
python:mainfrom
lpyu001:configure

Conversation

@lpyu001

@lpyu001 lpyu001 commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Preserve the default enabled safety configuration while correctly handling enable, disable, and invalid values for both safety options.

Preserve the default enabled safety configuration while correctly handling enable, disable, and invalid values for both safety options.
@lpyu001

lpyu001 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Hi, could you take a look at this PR when you get a chance @corona10

@read-the-docs-community

read-the-docs-community Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35569044 | 📁 Comparing b3f6a9e against main (a6b4aa6)

  🔍 Preview build  

135 files changed · + 1 added · ± 134 modified

+ Added

± Modified

@lpyu001

lpyu001 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

I've updated this PR. Both options now stay disabled by default, as decided in gh-124064.

  • configure.ac / configure: use $enableval, so --disable-safety and --disable-slower-safety no longer enable the options. Invalid values are rejected.
  • Doc/using/configure.rst and Doc/whatsnew/3.14.rst: document --enable-safety (off by default) instead of the old --disable-safety.

This affects 3.14 and 3.15 as well, so it should be backported.

@lpyu001

lpyu001 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

cc @AA-Turner

@maaz7409 maaz7409 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good, the --disable-* fix works in my Linux checks. Also, would it make sense to keep accepting values such as =1, =true and an empty =? These currently enable the flags, so rejecting them could break existing build scripts after a backport.

Comment thread configure.ac Outdated
Comment on lines +2596 to +2598
[AS_CASE([$enableval],
[yes|no], [enable_safety=$enableval],
[AC_MSG_ERROR([invalid --enable-safety option: expected "yes" or "no"])])],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would treating any value other than no as enabled work here? This would keep --enable-safety=1, =true and an empty = working while honoring --disable-safety:

Suggested change
[AS_CASE([$enableval],
[yes|no], [enable_safety=$enableval],
[AC_MSG_ERROR([invalid --enable-safety option: expected "yes" or "no"])])],
[AS_VAR_IF([enable_safety], [no], [], [enable_safety=yes])],

Comment thread configure.ac Outdated
Comment on lines +2615 to +2617
[AS_CASE([$enableval],
[yes|no], [enable_slower_safety=$enableval],
[AC_MSG_ERROR([invalid --enable-slower-safety option: expected "yes" or "no"])])],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the same approach could work for --enable-slower-safety too? If these suggestions are used, configure would also need regenerating.

Suggested change
[AS_CASE([$enableval],
[yes|no], [enable_slower_safety=$enableval],
[AC_MSG_ERROR([invalid --enable-slower-safety option: expected "yes" or "no"])])],
[AS_VAR_IF([enable_slower_safety], [no], [], [enable_slower_safety=yes])],

@lpyu001

lpyu001 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the great suggestion! I'll update my code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants