Allow configuring arbitrary codegen backends#15562
Merged
weihanglo merged 1 commit intorust-lang:masterfrom May 19, 2025
Merged
Allow configuring arbitrary codegen backends#15562weihanglo merged 1 commit intorust-lang:masterfrom
weihanglo merged 1 commit intorust-lang:masterfrom
Conversation
Rather than just builtin codegen backends. This is perma-unstable on the rustc side, but is useful to enable a codegen backend built separately from rustc to be used without overwriting RUSTFLAGS as well as to allow configuring the codegen backend on a per-package basis.
Collaborator
bjorn3
commented
May 19, 2025
| name, | ||
| codegen_backend, | ||
| ); | ||
| } |
Member
Author
There was a problem hiding this comment.
If preferred I can also keep this check on the cargo side when nightly features are disabled.
Member
There was a problem hiding this comment.
How arbitrary you'd like to have for codegen-backend name? What is the real use case here?
The change seems fine to me though, as a nightly feature.
Member
Author
There was a problem hiding this comment.
Basically -Zcodegen-backend allows either of the following:
- The name of a builtin codegen backend. This will eventually be stabilized once one of the non-LLVM backends gets stabilized.
- The full path to a dylib implementing a codegen backend. This will never be stable. It exists to allow codegen backends not shipped as part of rustc to be used. For example cg_clif uses it when you locally build it or when using the version from its CI rather than the rustup distributed version (the CI version is newer). Same for cg_gcc when you locally build it.
Member
There was a problem hiding this comment.
Thanks for the info! It makes sense to relax it a bit for now.
When stabilization, Cargo should only allow a set of known backends. We should track it somewhere, though we dont really have a Cargo tracking issue for codegen-backend right now.
Member
There was a problem hiding this comment.
weihanglo
approved these changes
May 19, 2025
bors
added a commit
to rust-lang/rust
that referenced
this pull request
May 23, 2025
Update cargo 9 commits in 47c911e9e6f6461f90ce19142031fe16876a3b95..68db37499f2de8acef704c73d9031be6fbcbaee4 2025-05-14 17:53:17 +0000 to 2025-05-22 14:27:15 +0000 - chore(gh): Add new-lint issue template (rust-lang/cargo#15575) - fix(toml): Remove workaround for rustc frontmatter support (rust-lang/cargo#15570) - fix(vendor)!: vendor files with .rej/.orig suffix (rust-lang/cargo#15569) - fix(vendor)!: direct extraction for registry sources (rust-lang/cargo#15514) - chore(deps): update msrv (1 version) to v1.87 (rust-lang/cargo#15530) - Fix comment for cargo/core/compiler/fingerprint/mod.rs (rust-lang/cargo#15565) - fix: remove unnecessary workaround in standard_lib test (rust-lang/cargo#15522) - Allow configuring arbitrary codegen backends (rust-lang/cargo#15562) - Update dependencies (rust-lang/cargo#15557) r? ghost
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
May 25, 2025
Update cargo 9 commits in 47c911e9e6f6461f90ce19142031fe16876a3b95..68db37499f2de8acef704c73d9031be6fbcbaee4 2025-05-14 17:53:17 +0000 to 2025-05-22 14:27:15 +0000 - chore(gh): Add new-lint issue template (rust-lang/cargo#15575) - fix(toml): Remove workaround for rustc frontmatter support (rust-lang/cargo#15570) - fix(vendor)!: vendor files with .rej/.orig suffix (rust-lang/cargo#15569) - fix(vendor)!: direct extraction for registry sources (rust-lang/cargo#15514) - chore(deps): update msrv (1 version) to v1.87 (rust-lang/cargo#15530) - Fix comment for cargo/core/compiler/fingerprint/mod.rs (rust-lang/cargo#15565) - fix: remove unnecessary workaround in standard_lib test (rust-lang/cargo#15522) - Allow configuring arbitrary codegen backends (rust-lang/cargo#15562) - Update dependencies (rust-lang/cargo#15557) r? ghost
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Rather than just builtin codegen backends. This is perma-unstable on the rustc side, but is useful to enable a codegen backend built separately from rustc to be used without overwriting RUSTFLAGS as well as to allow configuring the codegen backend on a per-package basis.