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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃檵 Including rustc version in report #31

Open
phansch opened this issue May 4, 2018 · 6 comments 路 May be fixed by #81
Open

馃檵 Including rustc version in report #31

phansch opened this issue May 4, 2018 · 6 comments 路 May be fixed by #81
Labels
breaking-change enhancement Improve the expected
Milestone

Comments

@phansch
Copy link

phansch commented May 4, 2018

Expected Behavior

I was investigating human-panic for possible usage in Clippy because we usually get a lot of failures due to being on nightly and depending on a lot of internal APIs.

Is there a possibility to include the current rustc version in the report?
Ideally, that would include everything that's shown in rustc -vV.

Current Behavior

It's currently not included.

Possible Solution

I think executing rustc -vV, capturing the output and adding it to the report file should work, but not sure.
I'd be happy to work on this if you have nothing against including that in the report.

@spacekookie
Copy link
Collaborator

I'm not sure it's possible to get the version of the compiler a Rust binary was built with after compilation. At most we could try to include that statically in the binary.

Running rustc -vV in the panic handler isn't a super great idea in my opinion because it assumes that the user of a tool even has Rust installed and it also only really gives useful diagnostics if they compiled the tool themselves instead of pulling it from a binary package (or similar).

@killercup
Copy link
Collaborator

You might want to take a look at what build info the sentry crate gathers: https://github.com/getsentry/sentry-rust/blob/8dbda94b81b6efd92dfd9cfffb25414cffdaee17/build.rs

@yoshuawuyts
Copy link
Collaborator

Oh, interesting - looks like we could add a build script to this crate, and use https://crates.io/crates/rustc_version to include the version! Nice one @killercup.

@phansch
Copy link
Author

phansch commented May 7, 2018

I'm working on integrating a similar build script into clippy right now, once that's done I'm happy to attempt the same here 馃憤

@spacekookie spacekookie added this to the Beyond 1.0 milestone May 28, 2018
@spacekookie
Copy link
Collaborator

ping @phansch did you ever finish the build script so we can steal it? 馃檪

@phansch
Copy link
Author

phansch commented Oct 5, 2018

Oh, I didn't end up doing it in the end and Clippy is available on stable now. I think using the build.rs from sentry should work out of the box: https://github.com/getsentry/sentry-rust/blob/master/build.rs

It generates a constants.gen.rs with RUSTC_VERSION, RUSTC_CHANNEL, PLATFORM and ARCH constants. You should then be able to use i.e. constants::RUSTC_VERSION when you generate the report.

@spacekookie spacekookie modified the milestones: Beyond 1.0, 2.0.0 Oct 5, 2018
@TheTechRobo TheTechRobo linked a pull request Aug 18, 2022 that will close this issue
3 tasks
@epage epage added breaking-change enhancement Improve the expected labels Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change enhancement Improve the expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants