-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add GCC and the GCC codegen backend to build-manifest and rustup #151156
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
Conversation
Can you confirm this is real preview? Historically I'm not sure we've had any components we actually managed to make installable only with -preview (by accident). @bors try=dist-x86_64-linux (Is that the right way to get a full dist build? If so I can kick a dev-static run off with the artifacts once it completes). |
|
Unknown command "try". Run |
|
@bors try jobs=dist-x86_64-linux |
This comment has been minimized.
This comment has been minimized.
Add GCC and the GCC codegen backend to build-manifest and rustup try-job: dist-x86_64-linux
|
Huh, indeed if I do I guess it's because rustup allows both the original name and the renamed name to be installed? |
|
Kicked off dev-static nightly with |
|
Looks released (didn't check for gcc presence):
Seems likely. I don't have a super strong opinion on whether we should try to "fix" that for gcc specifically -- maybe not -- but I think it's worth knowing when we describe state of the world. One option we've done elsewhere is to restrict creating the component on non-nightly channels (e.g., miri does this). That might make sense while we're still iterating -- it's another form of preview. |
|
It works! 🎉
Yup, we already do that! The GCC and cg-gcc components cannot be |
|
r=me if we're happy with testing done so far. I think we should add a note about preview to a tracking issue of some kind, though we'll probably remember to think about it regardless. |
…rk-Simulacrum
Add GCC and the GCC codegen backend to build-manifest and rustup
This PR adds the GCC codegen backend, and the GCC (libgccjit) component upon which it depends, to build-manifest, and thus also to (nightly) Rustup. I added both components in a single PR, because one can't work/isn't useful without the other.
Both components are marked as nightly-only and as `-preview`.
As a reminder, the GCC component is special; we need a separate component for every (host, target) compilation pair. This is not something that is really supported by rustup today, so we work around that by creating a separate component/package for each compilation target. So if we want to distribute GCC that can compile from {T1, T2} to {T2, T3}, we will create two separate components (`gcc-T2` and `gcc-T3`), and make both of them available on T1 and T2 hosts.
I tried to reuse the existing structure of `PkgType` in `build-manifest`, but added a target field to the `Gcc` package variant. This required some macro hackery, but at least it doesn't require making larger changes to `build-manifest`.
After this PR lands, unless I messed something up, starting with the following nightly, the following should work:
```bash
rustup +nightly component add rustc-codegen-gcc-preview gcc-x86_64-unknown-linux-gnu-preview
RUSTFLAGS="-Zcodegen-backend=gcc" cargo +nightly build
```
Note that it will work currently only on `x86_64-unknown-linux-gnu`, and only if not cross-compiling.
r? @Mark-Simulacrum
…uwer Rollup of 5 pull requests Successful merges: - #151010 (std: use `ByteStr`'s `Display` for `OsStr`) - #151156 (Add GCC and the GCC codegen backend to build-manifest and rustup) - #151219 (Fixed ICE when using function pointer as const generic parameter) - #151343 (Port some crate level attrs to the attribute parser) - #151463 (add x86_64-unknown-linux-gnuasan to CI) r? @ghost
Rollup merge of #151156 - Kobzol:build-manifest-cg-gcc, r=Mark-Simulacrum Add GCC and the GCC codegen backend to build-manifest and rustup This PR adds the GCC codegen backend, and the GCC (libgccjit) component upon which it depends, to build-manifest, and thus also to (nightly) Rustup. I added both components in a single PR, because one can't work/isn't useful without the other. Both components are marked as nightly-only and as `-preview`. As a reminder, the GCC component is special; we need a separate component for every (host, target) compilation pair. This is not something that is really supported by rustup today, so we work around that by creating a separate component/package for each compilation target. So if we want to distribute GCC that can compile from {T1, T2} to {T2, T3}, we will create two separate components (`gcc-T2` and `gcc-T3`), and make both of them available on T1 and T2 hosts. I tried to reuse the existing structure of `PkgType` in `build-manifest`, but added a target field to the `Gcc` package variant. This required some macro hackery, but at least it doesn't require making larger changes to `build-manifest`. After this PR lands, unless I messed something up, starting with the following nightly, the following should work: ```bash rustup +nightly component add rustc-codegen-gcc-preview gcc-x86_64-unknown-linux-gnu-preview RUSTFLAGS="-Zcodegen-backend=gcc" cargo +nightly build ``` Note that it will work currently only on `x86_64-unknown-linux-gnu`, and only if not cross-compiling. r? @Mark-Simulacrum
|
Should be available on nightly starting from 23 January 2026. |
This PR adds the GCC codegen backend, and the GCC (libgccjit) component upon which it depends, to build-manifest, and thus also to (nightly) Rustup. I added both components in a single PR, because one can't work/isn't useful without the other.
Both components are marked as nightly-only and as
-preview.As a reminder, the GCC component is special; we need a separate component for every (host, target) compilation pair. This is not something that is really supported by rustup today, so we work around that by creating a separate component/package for each compilation target. So if we want to distribute GCC that can compile from {T1, T2} to {T2, T3}, we will create two separate components (
gcc-T2andgcc-T3), and make both of them available on T1 and T2 hosts.I tried to reuse the existing structure of
PkgTypeinbuild-manifest, but added a target field to theGccpackage variant. This required some macro hackery, but at least it doesn't require making larger changes tobuild-manifest.After this PR lands, unless I messed something up, starting with the following nightly, the following should work:
rustup +nightly component add rustc-codegen-gcc-preview gcc-x86_64-unknown-linux-gnu-preview RUSTFLAGS="-Zcodegen-backend=gcc" cargo +nightly buildNote that it will work currently only on
x86_64-unknown-linux-gnu, and only if not cross-compiling.r? @Mark-Simulacrum