Description
I tried this:
Put a custom codegen backend in a custom sysroot and call rustc -vV --sysroot /path/to/sysroot -Zcodegen-backend=my_backend
.
I expected to see this happen: Among other things the version of the custom codegen backend is printed.
Instead, this happened: After rustc's own version, it prints error: unsupported builtin codegen backend `my_backend`
and exits with an error code.
This is blocking me from putting a locally built cg_clif in a custom sysroot and then using profile.dev.codegen-backend = "cranelift"
as opposed to using RUSTFLAGS="-Zcodegen-backend=/path/to/librustc_codegen_cranelift.so"
. Cargo only supports setting the codegen backend using profiles for codegen backends that are part of a sysroot, but configuring the codegen backend on a per-package basis requires using a cargo profile setting rather than RUSTFLAGS
.
Meta
rustc --version --verbose
:
rustc 1.86.0-nightly (b3b368a18 2025-01-05)
binary: rustc
commit-hash: b3b368a1833a26f5d48f51c45159f46e6cd01711
commit-date: 2025-01-05
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
error: unsupported builtin codegen backend `my_backend`
rust/compiler/rustc_driver_impl/src/lib.rs
Line 922 in 243d2ca
--sysroot
flag rather than taking opts.maybe_sysroot
from Options::default()
.