Skip to content

Conversation

@Narfinger
Copy link
Contributor

@Narfinger Narfinger commented Sep 15, 2025

The command-line help output for -Z and `DebugOptions were out of sync again. This change makes sure they match again.

Testing: No tests necessary as this mainly just updates the help output.
Fixes: #39311

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 15, 2025
@mukilan mukilan removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 15, 2025
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Sep 15, 2025
Copy link
Member

@mukilan mukilan left a comment

Choose a reason for hiding this comment

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

Thank you!

//! from command line arguments.
use std::default::Default;
use std::fmt::Debug;
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't seem to be used anywhere. Is this needed?

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 16, 2025
Comment on lines 179 to 237
pub fn print_help(app: &str) {
fn print_option(name: &str, description: &str) {
println!("\t{:<35} {}", name, description);
}
println!(
"Usage: {} debug option,[options,...]\n\twhere options include\n\nOptions:",
app
);
print_option(
"convert-mouse-to-touch",
"Send touch events instead of mouse events",
);
print_option(
"disable-share-style-cache",
"Disable the style sharing cache.",
);
print_option(
"dump-display-list",
"Print the display list after each layout.",
);
print_option(
"dump-stacking-context-tree",
"Print the stacking context tree after each layout.",
);
print_option(
"dump-flow-tree",
"Print the fragment tree after each layout.",
);
print_option(
"dump-rule-tree",
"Print the style rule tree after each layout.",
);
print_option(
"dump-style-tree",
"Print the DOM with computed styles after each restyle.",
);
print_option("dump-style-stats", "Print style stats after each restyle.");
print_option("dump-scroll-tree", "Print scroll tree after each layout.");
print_option("gc-profile", "Log GC passes and their durations.");
print_option(
"profile-script-events",
"Enable profiling of script-related events.",
);
print_option(
"relayout-event",
"Print notifications when there is a relayout.",
);
print_option(
"signpost",
"Emit native OS signposts for profile events (currently macOS only)",
);
print_option(
"trace-layout",
"Write layout trace to an external file for debugging.",
);
print_option("wr-stats", "Show WebRender profiler on screen.");

println!();
}
Copy link
Member

Choose a reason for hiding this comment

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

This was moved to servoshell as Opts doesn't handle command-line arguments and thus shouldn't be responsible for dumping help output for them. I think it makes sense to keep this in servoshell.

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 think the problem is that it will always be out of sync if it is not close. I think if we really want to keep it in servo she'll, I can at least add a comment to the DebugOptions struct.

Copy link
Member

Choose a reason for hiding this comment

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

They shouldn't be out of sync for long, as I have plans to integrate these options into the Servo API via a ServoLoggingSettings struct that will have parsing capability as well. Once that happens this code will likely go away. For the moment, I think it's better to keep all of the command-line parsing and help code together though.

@Narfinger I'm happy to do this as you are on vacation now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok that makes sense.
Feel free to do it.

@servo-highfive servo-highfive added the S-needs-code-changes Changes have not yet been made that were requested by a reviewer. label Sep 16, 2025
@servo-highfive servo-highfive added S-needs-rebase There are merge conflict errors. S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-rebase There are merge conflict errors. labels Sep 17, 2025
@mrobinson mrobinson changed the title Use the current debug options to sync the debug options help. servoshell: Update the debug options (-Z) help to reflect current set of options Sep 17, 2025
@servo-highfive servo-highfive added S-needs-rebase There are merge conflict errors. and removed S-needs-rebase There are merge conflict errors. labels Sep 17, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Sep 17, 2025
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-rebase There are merge conflict errors. labels Sep 17, 2025
@mrobinson mrobinson added this pull request to the merge queue Sep 17, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 17, 2025
Merged via the queue into servo:main with commit 76645e5 Sep 17, 2025
28 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some servoshell debug options ( -Z) are broken.

4 participants