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

Use optimized versions of managed Python on Linux #4775

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

Di-Is
Copy link
Contributor

@Di-Is Di-Is commented Jul 3, 2024

Fix #4774.

Summary

Change the python interpreter for linux installed with uv python to an optimized one.

Test Plan

I ran the following command on Linux (glibc) to confirm that an optimized (not debug built) Python is installed.

# install python
uv python install 3.12.3

# check build type
uv run python -c "import sysconfig;print(sysconfig.get_config_var('Py_DEBUG'))"
0

@Di-Is Di-Is changed the title Replace linux python downloaded by uv python command with optimized one Replace python interpreter for linux downloaded by uv python command with optimized one Jul 3, 2024
@zanieb
Copy link
Member

zanieb commented Jul 3, 2024

:D of course I see this after I've debugged it and found this is the problem. Glad we agree though! Thanks for opening a pull request.

@zanieb zanieb changed the title Replace python interpreter for linux downloaded by uv python command with optimized one Use optimized versions of managed Python on Linux Jul 3, 2024
@zanieb zanieb added bug Something isn't working preview Experimental behavior labels Jul 3, 2024
@zanieb zanieb merged commit dc4ff84 into astral-sh:main Jul 3, 2024
47 checks passed
zanieb added a commit that referenced this pull request Jul 3, 2024
This fell out of my investigation of
#4774 but the bug was fixed by the
reporter in #4775

- Adds support for `GH_TOKEN` authentication again — basically needed to
avoid rate limits when hacking on this.
- Clarifies some handling and logging of flavors
@Di-Is Di-Is deleted the use-opt-python-in-linux branch July 3, 2024 21:41
Comment on lines -21 to +22
"url": "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3%2B20240415-aarch64-unknown-linux-gnu-debug-full.tar.zst",
"sha256": "24daaf20123ac4b2b8657c1ac8227d391d2e5769d81237b68ee674569d307ad0"
"url": "https://github.com/indygreg/python-build-standalone/releases/download/20240415/cpython-3.12.3%2B20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst",
"sha256": "a4f17d1e3b4ea0e4c2a3664f232c0857979522936af582f7de92b57050220f74"
Copy link

@helderco helderco Jul 5, 2024

Choose a reason for hiding this comment

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

The archive for lto is more than 3 times the size of debug.

Looking at the docs, there's an Install Only Archive. Does uv need the full variant?

cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-debug-full.tar.zst	48MB
cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-lto-full.tar.zst	178MB
cpython-3.12.3+20240415-aarch64-unknown-linux-gnu-install_only.tar.gz	24.4MB

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure why Rye opted not to use these (and our download preferences are based on the implementation over there). Here's an issue for discussion #4834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The python interpreter for linux installed by uv toolchain is debug built.
3 participants