Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support installing CPython 3.13.0a2+ with the --disable-gil flag #2851

Closed
5 tasks done
edgarrmondragon opened this issue Nov 25, 2023 · 5 comments
Closed
5 tasks done

Comments

@edgarrmondragon
Copy link
Contributor

Too many issues will kill our team's development velocity, drastically.
Make sure you have checked all steps below.

Prerequisite

  • Make sure your problem is not listed in the common build problems.
  • Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
  • Make sure you are not asking us to help solving your specific issue.
    • GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
  • Make sure your problem is not derived from packaging (e.g. Homebrew).
    • Please refer to the package documentation for the installation issues, etc.
  • Make sure your problem is not derived from plugins.
    • This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.

Description

CPython 3.13.0a2+ supports a build time --disable-gil flag. It would be great if pyenv install supported installing a GIL-less CPython either with a flag similar to the existing -g/--debug flag or with new, GIL-less, versions like 3.13.0a2-nogil.

@edgarrmondragon edgarrmondragon changed the title Support building CPython 3.13.0a2+ with the --disable-gil flag Support installing CPython 3.13.0a2+ with the --disable-gil flag Nov 25, 2023
@native-api
Copy link
Member

native-api commented Nov 25, 2023

You can pass any custom Configure options via the PYTHON_CONFIGURE_OPTS envvar. See https://github.com/pyenv/pyenv/blob/master/plugins/python-build/README.md#special-environment-variables .

@edgarrmondragon
Copy link
Contributor Author

edgarrmondragon commented Nov 25, 2023

@native-api Gotcha, that seemed to work. For reference:

$ PYTHON_CONFIGURE_OPTS='--disable-gil' pyenv install 3.13-dev
$ pyenv shell 3.13-dev
$ python3.13 -c 'import sysconfig; print(sysconfig.get_config_var("Py_GIL_DISABLED"))'
1

Thanks!

@ZmicierGT
Copy link

Is there a way to install two 3.13-dev versions but to different directories to test builds both with enabled and disabled gil? Pyenv-alias plugin does not work any more, just renaming folders will break the installation.

@native-api
Copy link
Member

Is there a way to install two 3.13-dev versions but to different directories to test builds both with enabled and disabled gil? Pyenv-alias plugin does not work any more, just renaming folders will break the installation.

It is possible by calling Python-build directly. See its --help and README.

@ZmicierGT
Copy link

ZmicierGT commented Mar 29, 2024

@native-api Thank you, it helped. Some details for those who'll search for it in the future. You may find python-build readme here. The sequence of commands I used:

% python-build 3.13-dev /Users/zmicier/.pyenv/versions/3.13-dev_gil
% PYTHON_CONFIGURE_OPTS='--disable-gil' pyenv install 3.13-dev
% pyenv shell 3.13-dev_gil
% python3.13 -c 'import sysconfig; print(sysconfig.get_config_var("Py_GIL_DISABLED"))'
0
% pyenv shell 3.13-dev
% python3.13 -c 'import sysconfig; print(sysconfig.get_config_var("Py_GIL_DISABLED"))'
1

However, seems that the current nogil implementation is less stable than the experimental nogil 3.9.10 fork.

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

No branches or pull requests

4 participants