-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add unstable support for outputting file checksums for use in cargo #126930
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
Changes from all commits
bb5a827
6ff7a3e
081661b
dba814a
e3089c7
6708d56
6fd9ef6
0069649
4d9fa6f
15efbc6
b48c5f1
58c5ac4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -418,7 +418,9 @@ mod desc { | |
"one of: `legacy`, `v0` (RFC 2603), or `hashed`"; | ||
pub(crate) const parse_opt_symbol_visibility: &str = | ||
"one of: `hidden`, `protected`, or `interposable`"; | ||
pub(crate) const parse_src_file_hash: &str = "either `md5` or `sha1`"; | ||
pub(crate) const parse_cargo_src_file_hash: &str = | ||
"one of `blake3`, `md5`, `sha1`, or `sha256`"; | ||
pub(crate) const parse_src_file_hash: &str = "one of `md5`, `sha1`, or `sha256`"; | ||
pub(crate) const parse_relocation_model: &str = | ||
"one of supported relocation models (`rustc --print relocation-models`)"; | ||
pub(crate) const parse_code_model: &str = | ||
|
@@ -1288,6 +1290,19 @@ mod parse { | |
true | ||
} | ||
|
||
pub(crate) fn parse_cargo_src_file_hash( | ||
slot: &mut Option<SourceFileHashAlgorithm>, | ||
v: Option<&str>, | ||
) -> bool { | ||
match v.and_then(|s| SourceFileHashAlgorithm::from_str(s).ok()) { | ||
Some(hash_kind) => { | ||
*slot = Some(hash_kind); | ||
} | ||
_ => return false, | ||
} | ||
true | ||
} | ||
|
||
pub(crate) fn parse_target_feature(slot: &mut String, v: Option<&str>) -> bool { | ||
match v { | ||
Some(s) => { | ||
|
@@ -1688,6 +1703,8 @@ options! { | |
"instrument control-flow architecture protection"), | ||
check_cfg_all_expected: bool = (false, parse_bool, [UNTRACKED], | ||
"show all expected values in check-cfg diagnostics (default: no)"), | ||
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`)"), | ||
Comment on lines
+1706
to
+1707
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What will happened if md5 passed here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, at least help message mentions only blake3 and sha256, while actually accepting something else too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm… still seeing "cargo" mentioned here and elsewhere. Not really critical but would love to see we make the option more general than a Cargo-specific compiler flag (though in fact it was made for Cargo 😆) |
||
codegen_backend: Option<String> = (None, parse_opt_string, [TRACKED], | ||
"the backend to use"), | ||
combine_cgu: bool = (false, parse_bool, [TRACKED], | ||
|
Uh oh!
There was an error while loading. Please reload this page.