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 FileCheck mode #354

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add FileCheck mode #354

wants to merge 2 commits into from

Conversation

clubby789
Copy link
Contributor

This allows using, e.g. cargo-bisect-rustc --start 1.70.0 --filecheck src/lib.rs --preserve --regress success to investigate codegen regressions/improvements

@clubby789 clubby789 force-pushed the filecheck branch 3 times, most recently from ec02d48 to 5823c18 Compare November 12, 2024 14:54
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not really sure why this changed

Copy link
Contributor

Choose a reason for hiding this comment

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

These files are autogenerated by trycmd when running tests, based on the content of the cli options.

I forgot the details, but in tests/README.md I added some info a while ago

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant I'm not sure specifically why the formatting of the help output changed here - descriptions are now all placed on the following line

Copy link
Contributor

Choose a reason for hiding this comment

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

I did some bisection of your patchset. The change that trigger this is the new command line argument

    #[arg(long, help = "Path to LLVM FileCheck")]
    filecheck_path: Option<PathBuf>,

if you remove the underscore from the parameter name (for example to filecheckpath), the help output does not add a newline anymore.

So, the issue is with clap. I quickly skimmed the changelog but couldn't find anything explaining this strange thing. Feel free to investigate further 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah it's not the underscore, it's the name length - I think when the size of the longest arg name + the longest help string are such that having all arguments inline would be very long, it's wrapped round to a new line
Repro: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ba39c32190f89d5b28976c14b28e58cb
Remove the S from the argument name and it'll be in-line

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.

2 participants