Skip to content

2.7, 3.4: force C99 standard; 2.7.14-18: force OpenSSL 1 formula - #3448

Merged
native-api merged 6 commits into
pyenv:masterfrom
native-api:std_c99
May 14, 2026
Merged

native-api merged 6 commits into
pyenv:masterfrom
native-api:std_c99

Conversation

@native-api

@native-api native-api commented May 14, 2026 •

Copy link
Copy Markdown
Member

GCC 15+ uses C23 by default
(https://www.phoronix.com/news/GCC-15-Default-C23)

fixes "error: static declaration of ‘sinpi’ follows non-static declaration"
fixes "error: cannot use keyword ‘false’ as enumeration constant"

Make sure you have checked all steps below.

Prerequisite

Description

  • Here are some details about my PR
    see above

Tests

  • My PR adds the following unit tests (if any)
    N/A

Summary by cubic

Force C99 when building Python 2.7 and 3.4 in python-build to keep them compiling with GCC 15+. Also lock OpenSSL for late 2.7 to 1.x on Homebrew and MacPorts, removing the openssl fallback.

  • Bug Fixes

    • Export PYTHON_CFLAGS with -std=c99 across all 2.7.x and 3.4.x definitions.
    • Resolves GCC 15+ build failures:
      • “static declaration of ‘sinpi’ follows non-static declaration”
      • “cannot use keyword ‘false’ as enumeration constant”
  • Dependencies

    • Homebrew: for 2.7-dev and 2.7.14–2.7.18, default PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA to [email protected] [email protected] (only if unset); remove openssl fallback from 2.7.18; replace prefer_openssl11 where needed.
    • MacPorts: for 2.7-dev and 2.7.14–2.7.18, default PYTHON_BUILD_MACPORTS_OPENSSL_FORMULA to openssl11 openssl10 (only if unset).

Written for commit 3b83d8c. Summary will update on new commits.

GCC 15+ uses C23 by default
(https://www.phoronix.com/news/GCC-15-Default-C23)

fixes "error: static declaration of ‘sinpi’ follows non-static declaration"
fixes "error: cannot use keyword ‘false’ as enumeration constant"
@native-api
native-api requested review from a team as code owners May 14, 2026 01:46

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 32 files

Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/python-build/share/python-build/2.7.14">

<violation number="1" location="plugins/python-build/share/python-build/2.7.14:1">
P2: This hard-coded export changes `prefer_openssl11` semantics: it clobbers user OpenSSL formula overrides and drops the MacPorts OpenSSL preference setup. Use default-expansion so overrides still work and keep the MacPorts formula initialization.</violation>
</file>

<file name="plugins/python-build/share/python-build/2.7.15">

<violation number="1" location="plugins/python-build/share/python-build/2.7.15:1">
P2: Replacing `prefer_openssl11` with a hardcoded Homebrew export regresses behavior: it no longer sets the MacPorts OpenSSL preference and no longer preserves user overrides via `${VAR:-...}` defaults.

(Based on your team's feedback about setting expected env vars explicitly.) [FEEDBACK_USED]</violation>
</file>

Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Fix all with cubic

native-api and others added 3 commits May 14, 2026 04:55
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="plugins/python-build/share/python-build/2.7-dev">

<violation number="1" location="plugins/python-build/share/python-build/2.7-dev:1">
P2: This change drops the MacPorts OpenSSL preference that `prefer_openssl11` previously set, so `2.7-dev` can skip installed `openssl11` and fall back to building bundled OpenSSL instead.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic

@native-api native-api changed the title 2.7, 3.4: force C99 standard 2.7, 3.4: force C99 standard; 2.7.14-18: force OpenSSL 1 formula May 14, 2026
@native-api
native-api merged commit 06fd1ce into pyenv:master May 14, 2026
44 of 338 checks passed
@native-api
native-api deleted the std_c99 branch May 14, 2026 03:41
@Andrej730

Copy link
Copy Markdown
Contributor

Thank you for this fix!

A little note just to make this searchable - Ubuntu 26.04 is stuck with pyenv 2.6.8, so this fix is not available there (it landed in 2.6.32) and build for Python 2.7.18 fails with:

Last 10 log lines:
Python/ast.c:2631:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
 2631 |                 if (!import_alias)
      |                 ^~
Include/asdl.h:42:31: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   42 | #define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
      |                               ^
Python/ast.c:2633:21: note: in expansion of macro ‘asdl_seq_SET’
 2633 |                     asdl_seq_SET(aliases, i / 2, import_alias);
      |                     ^~~~~~~~~~~~
make: *** [Makefile:1382: Python/ast.o] Error 1

A workaround:

CFLAGS="-std=c99" pyenv install 2.7.18

social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
pyenv 2.6.32

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed
* Add miniconda3 26.3.2-2, miniforge3 26.3.2-0, 26.3.2-1 by @native-api in pyenv/pyenv#3445
* miniforge3 26.1, 26.3, add_miniforge: exclude bogus branches with .pkg installers by @native-api in pyenv/pyenv#3446
* miniforge 26, CI: switch check to 3.13 by @native-api in pyenv/pyenv#3447
* 2.7, 3.4: force C99 standard; 2.7.14-18: force OpenSSL 1 formula by @native-api in pyenv/pyenv#3448
* rehash: detect and remove a stale lockfile by @native-api in pyenv/pyenv#3450
* Add GraalPy 25.0.3 by @msimacek in pyenv/pyenv#3452
* 3.11.0+: Use the `--with-openssl-rpath' Configure option when possible by @native-api in pyenv/pyenv#3458
* python_build: Make `verify_python` verify `pythonX.Y' suffix by @native-api in pyenv/pyenv#3459
* Add micropython 1.22.0 to 1.28.0; add downstream patches to fix compilation errors by @native-api in pyenv/pyenv#3460
* Fix linking against a keg_only Homebrew OpenSSL when a a non-keg_only one is also installed by @native-api in pyenv/pyenv#3462
* Add missing CPython 3.14.2t by @native-api in pyenv/pyenv#3464
* 3.14.0-5: Support building against OpenSSL 4 by @native-api in pyenv/pyenv#3463


**Full Changelog**: https://github.com/pyenv/pyenv/compare/v2.6.31...v2.6.32</pre>
  <p>View the full release notes at <a href="https://github.com/pyenv/pyenv/releases/tag/v2.6.32">https://github.com/pyenv/pyenv/releases/tag/v2.6.32</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!9870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants