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

Patch CC and CCX entries in sysconfig for cross-compiled aarch64 Python distributions #12239

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Mar 17, 2025

Closes #12207

@zanieb zanieb added the bug Something isn't working label Mar 17, 2025
@zanieb zanieb changed the title Replace CXX entries with gnu-g++ in sysconfig Patch CC and CCX entries in sysconfig for cross-compiled Python distributions Mar 17, 2025
@zanieb
Copy link
Member Author

zanieb commented Mar 17, 2025

It turns out this is relevant for CC too

❯ docker run -it --rm ghcr.io/astral-sh/uv:0.6.5-bookworm-slim /bin/bash -c "uv run -p 3.13 -m sysconfig | grep CC"
	CC = "/usr/bin/aarch64-linux-gnu-gcc"

We just were never patching these (and it didn't matter because people are happy with GCC)

I broke this upstream in astral-sh/python-build-standalone#545 because I defined CXX as the host compiler instead of the target per this comment astral-sh/python-build-standalone#545 (comment) — we can change that upstream.

I'm unsure if it'd be disruptive to ship this change. It seems more correct.

@zanieb zanieb changed the title Patch CC and CCX entries in sysconfig for cross-compiled Python distributions Patch CC and CCX entries in sysconfig for cross-compiled aarch64 Python distributions Mar 17, 2025
@zanieb
Copy link
Member Author

zanieb commented Mar 17, 2025

This is also going to be a problem for other cross-compiles like, s390x, e.g., the values will be

  host_cc: /usr/bin/x86_64-linux-gnu-gcc
  host_cxx: /usr/bin/x86_64-linux-gnu-g++
  target_cc: /usr/bin/s390x-linux-gnu-gcc

@zanieb
Copy link
Member Author

zanieb commented Mar 17, 2025

Here's the upstream fix astral-sh/python-build-standalone#563

Though we may still want to pursue this — we'll need to handle more patterns for it to be robust.

@zanieb zanieb marked this pull request as draft March 17, 2025 14:17
@samypr100
Copy link
Collaborator

If we could define the authoritative list of variants being targets.yml, I wonder if we could use it to autogen the replacements on uv side automatically

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

Successfully merging this pull request may close these issues.

uv 0.6.6 fails to build arm64 packages in the CI?
3 participants