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

[Bug]: Calling platform build name --help starts a build #708

Closed
makubacki opened this issue Dec 16, 2023 · 1 comment · Fixed by #714
Closed

[Bug]: Calling platform build name --help starts a build #708

makubacki opened this issue Dec 16, 2023 · 1 comment · Fixed by #714
Assignees
Labels
bug Something isn't working new Issue not yet reviewed

Comments

@makubacki
Copy link
Member

Contact Details

No response

Describe the Bug

With edk2-pytool-extensions 0.26.3 calling python Platforms/QemuQ35Pkg/PlatformBuild.py results in a build being started instead of printing help.

What Python version are you using?

Python 3.12

Reproduction steps

  • Install Python 3.12
  • Install edk2-pytool-extensions 0.26.3
  • Clone mu_tiano_platforms and set up the workspace
  • Call python Platform/QemuQ35Pkg/PlatformBuild.py --help
    • A build is started instead of printing help text

Reverting commit dc5b3cd locally restores previous behavior.

Expected behavior

Print help text when --help is given.

Execution Environment

No response

Pip packages

edk2-pytool-extensions 0.26.3
edk2-pytool-library 0.19.7

Additional context

No response

@Javagedes
Copy link
Contributor

Thanks for bringing this to my attention. This is because there are two rounds of parsers. The first round is to find the build module use it to gather it's command line arguments. The second round of parsing is to parse for those command line arguments and then execute.

In the situation where the build module is provided, the first round of parsing consumes the --help argument, so when the second round of parsing occurs, the help flag does not exist and print help is not triggered.

PR #714 adds back in the "--help" flag to sys.argv if it was detected in the first round of parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Issue not yet reviewed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants