-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add support for downloading GCC from CI #138051
base: master
Are you sure you want to change the base?
Conversation
This PR modifies If appropriate, please update
This PR modifies If appropriate, please update |
This comment has been minimized.
This comment has been minimized.
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.
This is super cool, thanks a lot for all your work on this!
☔ The latest upstream changes (presumably #138058) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Is it possible to have some coverage (similar to ci-llvm and ci-rustc) on core of this implementation?
☔ The latest upstream changes (presumably #138267) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebased and refactored the download logic a bit. I'm not sure what would the tests check, to be honest. We don't have any complex logic as of yet (such as "if-unchanged"), just download/no-download. Any suggestions? :) |
This comment has been minimized.
This comment has been minimized.
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.
I'm not sure what would the tests check, to be honest. We don't have any complex logic as of yet (such as "if-unchanged"), just download/no-download. Any suggestions? :)
I thought "if-unchanged" was involved, I guess it's fine then.
LGTM other than 2 notes
Added the test cfg. |
This comment has been minimized.
This comment has been minimized.
Hmm, this is annoying, in test there is a bunch of unused methods and imports :/ I don't want to mark them as |
What about |
This comment has been minimized.
This comment has been minimized.
Ok, CI is green now. |
@bors r+ |
Add support for downloading GCC from CI This PR adds a new bootstrap config section called `gcc` and implements a single config `download-ci-gcc`. Its behavior is similar to `download-ci-llvm`. Since rust-lang#137667, we distribute a CI component that contains the prebuilt `libgccjit.so` library on x64 Linux. With `download-ci-gcc`, this component is downloaded from CI to avoid building GCC locally. This is an MVP of this functionality, designed for local usage. This PR does not enable this functionality on the LLVM 18 PR CI job which builds `cg_gcc`, and does not implement more complex detection logic. It simply uses `false` (build locally) or `true` (download from CI if you're on the right target, if CI download fails, then bootstrap fails). The original LLVM CI download functionality has a lot of features and complexity, which we don't need for GCC (yet). I don't like how the LLVM CI stuff is threaded through multiple parts of bootstrap, so with GCC I would like to take a more centralized approach, where the `build::Gcc` step handles download from CI internally. This means that: - For the rest of bootstrap, it should be transparent whether GCC was built locally or downloaded from CI. - GCC is not downloaded eagerly unless you actually requested GCC (either you requested `x build gcc` or you asked to build/test the GCC backend). This approach will require some modifications once we extend this feature, but so far I like this approach much more than putting this stuff into `Config[::parse]`, which already does a ton of stuff that it arguably shouldn't (but it's super difficult to extract its logic out). This PR is an alternative to rust-lang#130749, which did a more 1:1 copy of the `download-ci-llvm` logic. r? `@onur-ozkan`
Add support for downloading GCC from CI This PR adds a new bootstrap config section called `gcc` and implements a single config `download-ci-gcc`. Its behavior is similar to `download-ci-llvm`. Since rust-lang#137667, we distribute a CI component that contains the prebuilt `libgccjit.so` library on x64 Linux. With `download-ci-gcc`, this component is downloaded from CI to avoid building GCC locally. This is an MVP of this functionality, designed for local usage. This PR does not enable this functionality on the LLVM 18 PR CI job which builds `cg_gcc`, and does not implement more complex detection logic. It simply uses `false` (build locally) or `true` (download from CI if you're on the right target, if CI download fails, then bootstrap fails). The original LLVM CI download functionality has a lot of features and complexity, which we don't need for GCC (yet). I don't like how the LLVM CI stuff is threaded through multiple parts of bootstrap, so with GCC I would like to take a more centralized approach, where the `build::Gcc` step handles download from CI internally. This means that: - For the rest of bootstrap, it should be transparent whether GCC was built locally or downloaded from CI. - GCC is not downloaded eagerly unless you actually requested GCC (either you requested `x build gcc` or you asked to build/test the GCC backend). This approach will require some modifications once we extend this feature, but so far I like this approach much more than putting this stuff into `Config[::parse]`, which already does a ton of stuff that it arguably shouldn't (but it's super difficult to extract its logic out). This PR is an alternative to rust-lang#130749, which did a more 1:1 copy of the `download-ci-llvm` logic. r? ``@onur-ozkan``
This PR adds a new bootstrap config section called
gcc
and implements a single configdownload-ci-gcc
. Its behavior is similar todownload-ci-llvm
. Since #137667, we distribute a CI component that contains the prebuiltlibgccjit.so
library on x64 Linux. Withdownload-ci-gcc
, this component is downloaded from CI to avoid building GCC locally.This is an MVP of this functionality, designed for local usage. This PR does not enable this functionality on the LLVM 18 PR CI job which builds
cg_gcc
, and does not implement more complex detection logic. It simply usesfalse
(build locally) ortrue
(download from CI if you're on the right target, if CI download fails, then bootstrap fails).The original LLVM CI download functionality has a lot of features and complexity, which we don't need for GCC (yet). I don't like how the LLVM CI stuff is threaded through multiple parts of bootstrap, so with GCC I would like to take a more centralized approach, where the
build::Gcc
step handles download from CI internally. This means that:x build gcc
or you asked to build/test the GCC backend).This approach will require some modifications once we extend this feature, but so far I like this approach much more than putting this stuff into
Config[::parse]
, which already does a ton of stuff that it arguably shouldn't (but it's super difficult to extract its logic out).This PR is an alternative to #130749, which did a more 1:1 copy of the
download-ci-llvm
logic.r? @onur-ozkan