require a consistent codegen backend when -Zllvm-target-feature is present - #160618
Open
RalfJung wants to merge 2 commits into
Open
require a consistent codegen backend when -Zllvm-target-feature is present#160618RalfJung wants to merge 2 commits into
RalfJung wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
RalfJung
force-pushed
the
llvm-target-feature-codegen-backends
branch
from
August 6, 2026 08:53
34238f6 to
6bf460d
Compare
bjorn3
reviewed
Aug 6, 2026
| checksum_hash_algorithm: Option<SourceFileHashAlgorithm> = (None, parse_cargo_src_file_hash, [TRACKED], | ||
| "hash algorithm of source files used to check freshness in cargo (`blake3` or `sha256`)"), | ||
| codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED], | ||
| codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED] { TARGET_MODIFIER: CodegenBackend }, |
Member
There was a problem hiding this comment.
This would encode the codegen backend path in the crate metadata if a path is passed to -Zcodegen-backend, right? That would both hurt reproducibility and give false positives if the codegen backend is at a different location on a different machine.
The CodegenBackend trait has a name method that can be used instead.
Member
Author
There was a problem hiding this comment.
Yeah looks like that is what happens.
Unfortunately I don't know how to record that name rather than the actual value of the flag...
This comment has been minimized.
This comment has been minimized.
RalfJung
force-pushed
the
llvm-target-feature-codegen-backends
branch
from
August 6, 2026 10:20
6bf460d to
ce5650d
Compare
52 tasks
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.
Finishes the implementation of #157753 by ensuring that we don't mix codegen backends when using backend-specific target features (as other backends would ignore those).
The 2nd commit customizes the error we get to be a bit more helpful. I don't know how to do that with the diagnostic structs, so I converted this to use the builder API, which also deduplicated some strings.
r? @folkertdev
Cc @davidtwco @azhogin I hope I am using target modifiers correctly :D