-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
Add details about JIT build infrastructure and updating dependencies to Tools/jit
#141167
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
Open
savannahostrowski
wants to merge
2
commits into
python:main
Choose a base branch
from
savannahostrowski:jit-deps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+31
−0
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # JIT Build Infrastructure | ||
|
|
||
| This document includes details about the intricacies of the JIT build infrastructure. | ||
|
|
||
| ## Updating LLVM | ||
|
|
||
| When we update LLVM, we need to also update the LLVM release artifact for Windows builds. This is because Windows builds automatically pull prebuilt LLVM binaries in our pipelines (e.g. notice that `.github/workflows/jit.yml` does not explicitly download LLVM or build it from source). | ||
|
|
||
| To update the LLVM release artifact for Windows builds, follow these steps: | ||
| 1. Go to the [LLVM releases page](https://github.com/llvm/llvm-project/releases). | ||
| 1. Download x86_64 Windows artifact for the desired LLVM version (e.g. `clang+llvm-21.1.4-x86_64-pc-windows-msvc.tar.xz`). | ||
| 1. Extract and repackage the tarball with the correct directory structure. For example: | ||
| ```bash | ||
| tar -xf clang+llvm-21.1.4-x86_64-pc-windows-msvc.tar.xz | ||
| mv clang+llvm-21.1.4-x86_64-pc-windows-msvc llvm-21.1.4.0 | ||
| tar -cf - llvm-21.1.4.0 | pv | xz > llvm-21.1.4.0.tar.xz | ||
savannahostrowski marked this conversation as resolved.
Show resolved
Hide resolved
savannahostrowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
| The tarball must contain a top-level directory named `llvm-{version}.0/`. | ||
| 1. Go to [cpython-bin-deps](https://github.com/python/cpython-bin-deps). | ||
| 1. Create a new release with the updated LLVM artifact. | ||
| - Create a new tag to match the LLVM version (e.g. `llvm-21.1.4.0`). | ||
| - Specify the release title (e.g. `LLVM 21.1.4 for x86_64 Windows`). | ||
| - Upload the asset (you can leave all other fields the same). | ||
|
|
||
| ### Other notes | ||
| - You must make sure that the name of the artifact matches exactly what is expected in `Tools/jit/_llvm.py` and `PCbuild/get_externals.py`. | ||
| - We don't need multiple release artifacts for each architecture because LLVM can cross-compile for different architectures on Windows; x86_64 is sufficient. | ||
savannahostrowski marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - You must have permissions to create releases in the `cpython-bin-deps` repository. If you don't have permissions, you should contact one of the organization admins. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generic question: can this be avoided at all?
IIUC, we are doing all of this just to set the right directory within the archive. Can we actually deal with the original directory structure in CPython?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts here: https://github.com/python/cpython/pull/141167/files#r2504767448
...but TL;DR: yes, we could potentially automate the creation of LLVM release artifacts in cpython-bin-deps and make tarball extraction smarter. I'd tackle this in pieces and as a separate issue though!
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean, can we avoid to use
cpython-bin-depsat all? Can we deal with whatever structure the original tar ball has in https://github.com/llvm/llvm-project/releases ?What we are doing is a just a repackaging with a different directory structure. Cannot we do it at all and fetch the original tarball from the llvm project?
Here I'm debating the existence of that extra project and the existence of this documentation :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, there's extra context here. In order for the JIT to be in the Windows release, this was necessary as all dependencies for Windows release builds have to be in
cpython-bin-deps. That's why this is the status quo. More on this in #137604 (comment).That said, Emma, Itamar and I are working on a PEP to improve this experience. See https://discuss.python.org/t/pre-pep-redesigning-cpython-source-binary-dependencies/101824