Skip to content

fix: require --logs, --reports, and --results to prevent NoneType crash in genMetrics#4065

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
ashnaaseth2325-oss:fix/genmetrics-required-args
Mar 28, 2026
Merged

fix: require --logs, --reports, and --results to prevent NoneType crash in genMetrics#4065
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
ashnaaseth2325-oss:fix/genmetrics-required-args

Conversation

@ashnaaseth2325-oss

Copy link
Copy Markdown
Contributor

1. SUMMARY

This PR makes --logs, --reports, and --results required CLI arguments in genMetrics.py to prevent runtime crashes caused by missing values.
The change is localized to argument parsing in flow/util/genMetrics.py and improves error handling without altering core logic.


2. FIX

# Before
parser.add_argument("--logs", help="Path to logs")
parser.add_argument("--reports", help="Path to reports")
parser.add_argument("--results", help="Path to results")

# After
parser.add_argument("--logs", required=True, help="Path to logs")
parser.add_argument("--reports", required=True, help="Path to reports")
parser.add_argument("--results", required=True, help="Path to results")

3. VERIFICATION

Ran the script without --logs, --reports, and --results to reproduce the issue—previously it crashed with a confusing TypeError. After the fix, it now fails immediately with a clear argparse message indicating the missing required arguments. When all three flags are provided, the script runs normally without errors.

Signed-off-by: Ashnaa Seth <ashnaaseth2325@gmail.com>
Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
@ashnaaseth2325-oss

Copy link
Copy Markdown
Contributor Author

Hi @maliberty @eder-matheus,
Kindly review this PR.
Thanks!

@maliberty maliberty enabled auto-merge March 28, 2026 15:08
@maliberty maliberty merged commit 88e4e11 into The-OpenROAD-Project:master Mar 28, 2026
9 checks passed
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