-
Notifications
You must be signed in to change notification settings - Fork 20
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
Removes emojis from messages on Windows, adds 'SystemInfo' class to retain imutable information about the SO environment #93
Conversation
Hey, thanks for tackling this one. I'm happy to test this on mac once you get this cleaned up and passing CI. |
Make logs messages more concise during 'install' cmd. Small tweaks on messages spacing and new lines to turn output more dense and cohesive. Fixes messages printed right after progress display clashing with it.
'SystemInfo' has runtime information about the system, like the OS, CPU architecture.
6e0f2e0
to
09acb86
Compare
Ready for review. |
09acb86
to
6c7aaf7
Compare
@edassis Thank you for tackling all of this, it seems like a lot of really nice (but painful to implement) quality-of-life improvements. I'm going to try and get to testing this locally on my mac in the next few days — just been really busy. |
Okay :), no problem at all. Let me know in case it needs some adjustments. |
@edassis I've got a big ol' sticky note on my desk reminding me to get to reviews for this tonight / this weekend. That you for all the awesome contributions. I imagine there will be a few things we'll need to adjust, but nothing major. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cleaned up really nicely. The only really refactor I'd like to see is putting SystemInfo in the execution context so you don't have to pass it in to create logs. Other than that and a few stragglers, we're looking really good here.
8d1214e
to
1629ed3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you 💜
Hi,
This is a patch originated from the desire to fix the messages logs with broken emojis when running on Windows, as it's
console
doesn't useUTF-8
encoding (good reference aboutcmd
it here: https://stackoverflow.com/a/75788701/8903027, documented this link in theLog
class for future reference).To make it work, the
Log.Output()
class now checks if the system running is Windows, if it is, removes from the messageallleading non-ASCII (emojis) chars before printing.To do this, the Log class needs system information.
The way I approached it, avoiding changing a bunch of methods/interfaces signatures, was to create a class that holds these informations, and that's howSystemInfo
static class came about. The idea it's that the information inside it should be ready when the program starts (class initialization) and should not change during run-time. I thought of making it arecord
, but as it has a constructor, I keep it as a class (but maybe we can refactor it to something more elegant or that better fit with the code). Anyway, I think it's a new idea in the codebase that others systems could benefit of.The abstraction
SystemInformation
was created, containing CPU and OS information that should not change during runtime. I tried to create it as a static class previously to avoid having to change signatures in multiple layers, but it showed very cumbersome to manage theSystemInfo
lifecycle and to mock it during tests. So I scratched that and now, it's a normal class created at themain
method that is being propagated to the others objects from there.Another change was in the logs. Changed the
Info()
color tocyan
to make it more visible, adjustedinstall
command messages to make them more concise and dense:Info (cyan)
;white
). Some messages that could be considered details of the step were being printed asInfo
, but this diminishes the importance of the real importantInfo
messages (as it tends to fall into normality for the human eyes). So, I tried to use more sparingly theInfo
type in the messages;Success
.Windows preview
Main branch:

Patched:

Linux preview
Main branch:

Patched:

One point I'm having some difficult to understand it's how the progress text works for the
Godot extraction process
. During my tests, seems to me that the string message sent byProgress<double>((percent) => { ... }
stays in the stream output, and clashes with the output of the next message. But I think I circumvented it by makinglog.Print("")
to output a new line followed bylog.ClearCurrentLine()
to reset the cursor to the beginning of the line.Another bug that I may be found: the extraction process not reaches 100%, despite the process having completed the text doesn't reach 100%:
Extracting text not reaches 100%
This PR delivers a fix in the Windows symlink creation routine. At the beginning, we were creating a symbolic link to point to Godot's binary, but to offer desktop shortcut support, we added the creation of hard links used by the desktop shortcut, and the symbolic link stayed. As having the hardlink covers the previous usage for the symbolic link, I removed the symbolic link creation on Windows and standardized that: on Windows, if it's not a directory link, it will be a hard link.
WIP:
Let me know what you think.
Hope the holidays were good for you! 😎