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

Tracking Issue for -Z src-hash-algorithm #70401

Open
1 of 3 tasks
arlosi opened this issue Mar 25, 2020 · 5 comments
Open
1 of 3 tasks

Tracking Issue for -Z src-hash-algorithm #70401

arlosi opened this issue Mar 25, 2020 · 5 comments
Labels
A-cli Area: Command line interface to the compiler. A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. S-tracking-needs-summary Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@arlosi
Copy link
Contributor

arlosi commented Mar 25, 2020

This is the tracking issue for the unstable option -Z src-hash-algorithm

Steps

Unresolved Questions

  • Should we have a separate option in the target specification to specify the preferred hash algorithm, or continue to use is_like_msvc?
  • Should continue to have a command line option to override the preferred option? Or is it acceptable to require users to create a custom target specification to override the hash algorithm?
@arlosi arlosi added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Mar 25, 2020
@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. B-unstable Blocker: Implemented in the nightly compiler and unstable. labels Mar 25, 2020
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 4, 2020
Add hash of source files in debug info

LLVM supports placing the hash of source files inside the debug info.
This information can be used by a debugger to verify that the source code matches
the executable.

This change adds support for both hash algorithms supported by LLVM, MD5 and SHA1, controlled by a target option.

* DWARF only supports MD5
* LLVM IR supports MD5 and SHA1 (and SHA256 in LLVM 11).
* CodeView (.PDB) supports MD5, SHA1, and SHA256.

Fixes rust-lang#68980.

Tracking issue: rust-lang#70401

rustc dev guide PR with further details: rust-lang/rustc-dev-guide#623
@est31
Copy link
Member

est31 commented Oct 8, 2020

#73526 has been merged, updating LLVM to 11 and making it possible to support SHA256 as well. I guess for now one still has to give compatibility for older LLVMs though, so one maybe has to place a few cfg's here and there.

m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 1, 2020
Add support for SHA256 source file hashing

Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11.

Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256.

r? @eddyb
cc rust-lang#70401 @est31
m-ou-se added a commit to m-ou-se/rust that referenced this issue Nov 3, 2020
Add support for SHA256 source file hashing

Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11.

Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256.

r? `@eddyb`
cc rust-lang#70401 `@est31`
@pierwill
Copy link
Member

Are there documentation changes needed for this? I'd be happy to help!

@pierwill
Copy link
Member

☝️ @eddyb

@arlosi
Copy link
Contributor Author

arlosi commented Oct 18, 2021

@pierwill It is currently documented as an unstable option here: https://doc.rust-lang.org/beta/unstable-book/compiler-flags/src-hash-algorithm.html

I think the next step here would be to make a stabilization PR and adjust the documentation move it to the stable list of codegen options.

@pnkfelix
Copy link
Member

pnkfelix commented Sep 9, 2022

Visited during T-compiler backlog bonanza

It sounds like this is either ready to stabilize as is (with a shift from a -Z option to something stable), or it should move into something that is specified as part of of the target specification, and we just aren't even sure which of those modes we want this in for the stable form.

Can we maybe get a summary of the current implementation status, as well as the tradeoffs between those two options, to inform that decision?

@rustbot label: S-tracking-needs-summary

@rustbot rustbot added the S-tracking-needs-summary Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation. label Sep 9, 2022
@workingjubilee workingjubilee added the A-cli Area: Command line interface to the compiler. label Mar 5, 2023
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 to the compiler. A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) B-unstable Blocker: Implemented in the nightly compiler and unstable. C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. S-tracking-needs-summary Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation. 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

7 participants