-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[turborepo] Logging colors are non-deterministic #2564
Comments
I believe this is not deterministic because the order of tasks running is also not deterministic (by design). We could base the color on the task name itself to make it deterministic, but I'm not sure how we'd support an unbounded number of colors (I'm sure it's possible, just not sure off the top of my head what's available) The code is here: |
wouldn't have to be unbound could just hash to an integer and modulus to the number of colors to least stay consistent. just a thought (i noticed this even for a single task) |
I just had a build fail and was left typing invisible characters into the shell prompt. My background was black, so maybe the characters were also black. |
What's even more undesirable is even the replayed output from a I'd imagine with the port to rust it would be a good idea to make the color be derived from the package/task name. cc @anthonyshew since were talking about this the other day. |
@Shaharking was awesome and got this fixed up in #9023. While task colors aren't fully deterministic at all times with this change, they're deterministic when you run the same graph multiple times, which is likely what most folks are looking for and what we're reasonably capable of doing. Thanks again, @Shaharking! |
What version of Turborepo are you using?
1.6.3
What package manager are you using / does the bug impact?
Yarn v1
What operating system are you using?
Mac
Describe the Bug
CLI colors are changing between runs for the same package.
It sure looks pretty for VC demos, but is very confusing, as a user expects the package name to have the same color between consecutive runs.
Expected Behavior
Colors of a package name in the CLI must remain the same no matter when or where you run the CLI
To Reproduce
Run a turbo repo command twice, the colours will randomly change.
Reproduction Repo
No response
The text was updated successfully, but these errors were encountered: