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

Add verbose debugging version reporting #590

Merged
merged 6 commits into from
Nov 22, 2023

Conversation

chrissimpkins
Copy link
Member

@chrissimpkins chrissimpkins commented Nov 21, 2023

Adds a new --vv option for verbose debugging version reporting of:

  • fontc version + git commit SHA hash
  • rustc host triple
  • rustc version + toolchain channel + short git commit SHA hash + commit date
  • llvm version
  • cargo profile (release / debug)
  • cargo optimization level

Adds a new fontc package vergen build dependency and build.rs file to set the environment variables required to define these strings at build time. Should continue to support deterministic builds with the data fields that I've included in this report.

Example output:

cargo nightly release build

$ target/release/fontc --vv
fontc 0.0.1 @ 39104650dd31603be7b97a169c468c39bc0e5674

x86_64-apple-darwin
rustc 1.76.0-nightly (channel: nightly, 3a85a5cfe 2023-11-20)
llvm 17.0
cargo profile: release
cargo optimization level: 3

GitHub UI formatting as pasted into the tracker:

fontc 0.0.1 @ 3910465

x86_64-apple-darwin
rustc 1.76.0-nightly (channel: nightly, 3a85a5cfe 2023-11-20)
llvm 17.0
cargo profile: release
cargo optimization level: 3

cargo stable debug build

$ target/debug/fontc --vv
fontc 0.0.1 @ 39104650dd31603be7b97a169c468c39bc0e5674

x86_64-apple-darwin
rustc 1.74.0 (channel: stable, 79e9716c9 2023-11-13)
llvm 17.0
cargo profile: debug
cargo optimization level: 0

GitHub UI formatting as pasted into the tracker:

fontc 0.0.1 @ 3910465

x86_64-apple-darwin
rustc 1.74.0 (channel: stable, 79e9716c9 2023-11-13)
llvm 17.0
cargo profile: debug
cargo optimization level: 0

supports setting compile-time environment data for verbose debug version reporting
@chrissimpkins
Copy link
Member Author

chrissimpkins commented Nov 21, 2023

We don't like the println! macro?

Error: The following Rust source files contain println! or eprintln! statements:
fontc/src/main.rs:[9](https://github.com/googlefonts/fontc/actions/runs/6938594342/job/18874561283?pr=590#step:7:10)5:     println!(
fontc/src/main.rs:101:     println!("{}", env!("VERGEN_RUSTC_HOST_TRIPLE"));
fontc/src/main.rs:102:     println!(
fontc/src/main.rs:[10](https://github.com/googlefonts/fontc/actions/runs/6938594342/job/18874561283?pr=590#step:7:11)7:     println!("llvm {}", env!("VERGEN_RUSTC_LLVM_VERSION"));
fontc/src/main.rs:109:         "true" => println!("cargo profile: debug"),
fontc/src/main.rs:[11](https://github.com/googlefonts/fontc/actions/runs/6938594342/job/18874561283?pr=590#step:7:12)0:         "false" => println!("cargo profile: release"),
fontc/src/main.rs:113:     println!(
Please remove or comment out the println! and eprintln! statements before pushing.
Error: Process completed with exit code 1.

@chrissimpkins chrissimpkins force-pushed the chrisimpkins-verbose-versions branch from 95fa591 to 46746c0 Compare November 21, 2023 03:05
@chrissimpkins
Copy link
Member Author

We don't like the println! macro?

Fixed with conversion to writeln! and error propagation in 583a8da

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it should be useful, thanks!

Copy link
Member

@anthrotype anthrotype left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks!

@anthrotype anthrotype added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit 59596e9 Nov 22, 2023
10 checks passed
@anthrotype anthrotype deleted the chrisimpkins-verbose-versions branch November 22, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants