Skip to content

python-build: advise user with no c compiler#3294

Merged
native-api merged 1 commit intopyenv:masterfrom
exurd:no-c-compiler-check
Apr 1, 2026
Merged

python-build: advise user with no c compiler#3294
native-api merged 1 commit intopyenv:masterfrom
exurd:no-c-compiler-check

Conversation

@exurd
Copy link
Copy Markdown
Contributor

@exurd exurd commented Aug 1, 2025

Prerequisite

  • Please consider implementing the feature as a hook script or plugin as a first step.
    • pyenv has some powerful support for plugins and hook scripts. Please refer to Authoring plugins for details and try to implement it as a plugin if possible.
  • Please consider contributing the patch upstream to rbenv, since we have borrowed most of the code from that project.
    • We occasionally import the changes from rbenv. In general, you can expect changes made in rbenv will be imported to pyenv too, eventually.
    • Generally speaking, we prefer not to make changes in the core in order to keep compatibility with rbenv.
  • My PR addresses the following pyenv issue (if any)

Description

This checks if no acceptable C compiler found is in the last 10 lines of the failed build logs and guides the user to check if they correctly installed the build dependencies. It also prints the URL to the Wiki page relating to build environments.

~ pyenv install 3.15-dev 
Cloning https://github.com/python/cpython...
Installing Python-3.15-dev...

BUILD FAILED (Debian 12 using python-build 2.6.5)

Inspect or clean up the working tree at /tmp/python-build.20250801164958.4177
Results logged to /tmp/python-build.20250801164958.4177.log

Last 10 log lines:
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking for --with-app-store-compliance... not patching for app store compliance
checking for gcc... no
checking for cc... no
checking for cl.exe... no
checking for clang... no
configure: error: in '/tmp/python-build.20250801164958.4177/Python-3.15-dev':
configure: error: no acceptable C compiler found in $PATH
See 'config.log' for more details

Are the build dependencies for Python correctly installed?
Please consult to the Wiki page for more info.
https://github.com/pyenv/pyenv/wiki#suggested-build-environment

Tests

  • N/A

this checks if "no acceptable C compiler found" is in the last 10 lines of the log, and asks if the user has correctly installed the build dependencies.
@exurd exurd requested review from a team as code owners August 1, 2025 16:08
Copy link
Copy Markdown
Member

@native-api native-api left a comment

Choose a reason for hiding this comment

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

@native-api
Copy link
Copy Markdown
Member

In fact, in may be worth running pyenv doctor on a build error if it's present and show its output if it is able to identify any issues!

@native-api native-api merged commit ce49100 into pyenv:master Apr 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants