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

--sysroot ignored by -vV #135165

Open
bjorn3 opened this issue Jan 6, 2025 · 0 comments
Open

--sysroot ignored by -vV #135165

bjorn3 opened this issue Jan 6, 2025 · 0 comments
Labels
A-CLI Area: Command-line interface (CLI) to the compiler A-cranelift Things relevant to the [future] cranelift backend C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 6, 2025

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`

let sysroot = filesearch::materialize_sysroot(opts.maybe_sysroot.clone());
needs to be changed to manually parse the --sysroot flag rather than taking opts.maybe_sysroot from Options::default().

@bjorn3 bjorn3 added A-cranelift Things relevant to the [future] cranelift backend C-bug Category: This is a bug. labels Jan 6, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 6, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-CLI Area: Command-line interface (CLI) to the compiler and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: Command-line interface (CLI) to the compiler A-cranelift Things relevant to the [future] cranelift backend C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants