Nothing Special   »   [go: up one dir, main page]

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

Updates for Pyodide builds after pyodide-build was unvendored #2090

Conversation

agriyakhetarpal
Copy link
Contributor
@agriyakhetarpal agriyakhetarpal commented Nov 21, 2024

Description

This PR has been split off from #2002, where it has been attempted to allow the use of a build-time flag to build and test a Pyodide version that is not available with cibuildwheel, since the cibuildwheel version couples the Pyodide version available within it.

This PR is, rather, more limited in its approach. The key changes here are:

  • Post Unvendor pyodide-build pyodide/pyodide#4882, pyodide-build is now hosted in its own repository, and updates to it are not made in sync with updates to the Pyodide version, allowing pyodide-build to move faster with changes to it. Hence, the pyodide-build version (currently at 0.29.0) is now what is used to fetch the Pyodide xbuildenv for Pyodide builds.
  • Updated to the recently released Pyodide version 0.26.4, which now uses Python 3.12.7 (but we reflect just 3.12 and don't reflect the patch version). The Emscripten version stays the same at 3.1.58 and there is no ABI break.

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
pyodide_root = (
CIBW_CACHE_PATH
/ f".pyodide-xbuildenv-{pyodide_version}/{pyodide_version}/xbuildenv/pyodide-root"
/ f".pyodide-xbuildenv-{pyodide_build_version}/{pyodide_version}/xbuildenv/pyodide-root"
Copy link
Contributor
@henryiii henryiii Nov 21, 2024

Choose a reason for hiding this comment

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

This will not respect overrides (like latest or pip installing a new version), but will always be the one hard-coded. Was that intentional?

Copy link
Contributor Author
@agriyakhetarpal agriyakhetarpal Nov 21, 2024

Choose a reason for hiding this comment

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

Yes, this is intentional, since we don't have any ways to override here (no environment variables or the like, etc.). We should be fine with the hardcoded version. We know that users can still override pyodide-build using their constraint files if they like, but that won't be of much use (unless there's a bug in pyodide-build or if they want to use a fork or for any other reasons to use a constraint). I plan to rebase #2002 after this gets reviewed/merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, just saw your edit. How do we ensure that we use the version of pyodide-build that users install themselves, e.g., in before-build?

Copy link
Contributor

Choose a reason for hiding this comment

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

Constraint flags apply when it is setting up the environment. If a user installs it themselves, that will happen after the constrained version has already set up a new environment. Do we need the pyodide-build version in the env path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if I understood that correctly 😅 If I got it right,

the constrained version has already set up a new environment

Is "environment" here the cibuildwheel venv that will be used for the build? If these changes constrain the pyodide-build version in this environment and constraints files will have no effect, I'd definitely like to try out a different method. Could you give me a pointer on how I could proceed?

Also, a side note – after thinking a bit more about this, I think it would be great not to hardcode the Pyodide version, too (not in this PR, though). In case we release a new version of pyodide-build, say, X, that drops compatibility with the Pyodide version Y listed in build-platforms.toml, overriding the version here with constraints to use X would make it unable to work with Pyodide version Y.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the xbuildenv gets set up with the constrained versions, but before-build runs after the xbuildenv is setup, so it can't affect the version used to setup the xbuildenv. After that I believe you can change it, so it's only the pyodide-build version used for the xbuildenv setup that's a little harder to control.

@henryiii henryiii merged commit 109020e into pypa:main Nov 22, 2024
25 checks passed
@agriyakhetarpal
Copy link
Contributor Author

Thanks for the review and merge! I'm sorry I didn't see this sooner, and more notifications got in the way later. I think we can think of more solutions as part of #2002 in case users want more flexible constraints. But most of the discussion seems to point to the fact that cibuildwheel is still going to remain a bit rigid and pyodide/pyodide-actions#12 could be the way forward if users want more flexibility.

@agriyakhetarpal agriyakhetarpal deleted the pyodide-build-has-been-unvendored-from-pyodide branch November 22, 2024 21:25
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