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

Print printchplenv warnings at the end of the output #26272

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jabraham17
Copy link
Member

@jabraham17 jabraham17 commented Nov 20, 2024

Changes how printchplenv prints warnings so that the warnings are outputed last.

Prior to this PR, printchplenv warnings could get lost if the terminal scrolled past. This PR puts the warnings last so that users can be more directly notified. The exception is in the error case. If there was an error and printchplenv is going to exit, all to the warnings are printed before the errors, so that users can see warnings that may have lead to the error being produced.

Note: if a user throws --ignore-errors, no warning buffering is done, otherwise printchplenv may crash without dumping the buffer out.

Testing:

  • CHPL_LLVM_VERSION=2 printchplenv --all shows the warning at the bottom
  • CHPL_DEVELOPER=1 CHPL_TARGET_COMPILER=gnu CHPL_TARGET_CC=clang CHPL_LLVM_VERSION=2 printchplenv --all shows the warning and then the exception
  • CHPL_DEVELOPER=0 CHPL_TARGET_COMPILER=gnu CHPL_TARGET_CC=clang CHPL_LLVM_VERSION=2 printchplenv --all shows the warning and then prints the error
  • CHPL_TARGET_COMPILER=gnu CHPL_TARGET_CC=clang CHPL_LLVM_VERSION=2 printchplenv --all --ignore-errors does no buffering

[Reviewed by @vasslitvinov]

util/chplenv/utils.py Outdated Show resolved Hide resolved
util/chplenv/utils.py Outdated Show resolved Hide resolved
Copy link
Member

@vasslitvinov vasslitvinov left a comment

Choose a reason for hiding this comment

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

Great, thanks!

Signed-off-by: Jade Abraham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants