Skip to content

optionally collect compiler metrics #2812

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

syphar
Copy link
Member

@syphar syphar commented May 4, 2025

just a draft as a base for discussion.

Generally we want to separate the build output between builds / releases so I'm just using the target directory and copy over the json files afterwards.

What's missing is some kind of ICE protection, where we would retry the build without metrics in case of ICEs, or just collect metrics on the first try.

Also I would like to add tests.

@github-actions github-actions bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label May 4, 2025
if self.config.compiler_metrics_collection_path.is_some() {
// set the `./target/metrics/` directory inside the build container
// as a target directory for the metric files.
let flag = "-Zmetrics-dir=/opt/rustwide/target/metrics";
Copy link
Member

Choose a reason for hiding this comment

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

Were you able to make it work?

Copy link
Member Author

@syphar syphar May 4, 2025

Choose a reason for hiding this comment

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

yep, it works like this

Copy link
Member Author

Choose a reason for hiding this comment

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

( there are output files generated)

Copy link
Member

Choose a reason for hiding this comment

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

Even for:

#![feature(doc_cfg)]

//! ```
//! macro_rules! bla {
//!     ($($x:tt)*) => {}
//! }
//! ```

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have a crate / release on crates.io I can just run it with?

Copy link
Member

Choose a reason for hiding this comment

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

No, it's just a test I wrote locally. You can do so as well:

cargo new --lib foo
cd foo
# copy content into it
# run cargo doc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants