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

Made compilation error colors come through et. #57174

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

Conversation

gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Dec 12, 2024

fixes flutter/flutter#147931

environment variable documented in github issue: ninja-build/ninja#2196

screenshot of results

Screenshot 2024-12-13 at 10 18 15 AM

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@gaaclarke
Copy link
Member Author

Ahhhh, nertz! This breaks the gcc path fix since it breaks the regular expression. I'm putting this back into Draft and removing reviewers.

@gaaclarke gaaclarke marked this pull request as draft December 12, 2024 23:56
@flutter-dashboard
Copy link

This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again.

@gaaclarke gaaclarke marked this pull request as ready for review December 13, 2024 18:19
environment: rbeConfig.environment,
environment: {
...rbeConfig.environment,
'CLICOLOR_FORCE': '1',
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is correct, that is, if this should be conditionally set if the current environment is an ANSI terminal with color support.

If it was conditionally set, would we need the parsing and massaging you did above?

Copy link
Member Author

Choose a reason for hiding this comment

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

The behavior most people follow is if you aren't connected to a tty you don't emit ansi escape sequences. That's the behavior ninja was doing. I can emulate it. It's only a problem if someone wants to run et as a subprocess.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, now we only show the colors if stdout supports it or if it has been overwritten with CLICOLOR_FORCE.

Copy link
Member Author

Choose a reason for hiding this comment

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

If it was conditionally set, would we need the parsing and massaging you did above?

Yes, we still need it because the gcc path fix is a whole different thing that assumed no ansi escape sequences.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

It's good practice with colors to have some way to disable them on the command line. Is there a ninja command line option (that could be plumbed into extraNinjaArgs in another PR) that will override the environment variable?

@gaaclarke
Copy link
Member Author

It's good practice with colors to have some way to disable them on the command line. Is there a ninja command line option (that could be plumbed into extraNinjaArgs in another PR) that will override the environment variable?

I'll duplicate ninja's behavior and use the environment variable. One sec, it's also related to matans comment.

@gaaclarke
Copy link
Member Author

It's good practice with colors to have some way to disable them on the command line. Is there a ninja command line option (that could be plumbed into extraNinjaArgs in another PR) that will override the environment variable?

Done, see #57174 (comment)

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.

[et] compilation errors aren't colorful
3 participants