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

SCons: Silence MSVC output bloat without hiding errors #90551

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 11, 2024

Thanks to the SCons SPAWN feature, we can effectively catch stdout before it even calls to actions in the first place. This functionality is now more specialized to only care about cl/link calls, otherwise opting for the normal SPAWN with no changes. If the captured content is a single line, it's bloat & gets hidden. Multiple lines means it captured an error, and will redirect the content to stderr. As the behavior is now working as originally intended, #89159 was reverted to make silence_msvc enabled by default once more.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected (Windows 11 23H2, MSVC 2022). I also checked error messages still appear when they should by introducing an error and compiling.

A small nitpick is that the filename is still displayed on its own line when there's an error:

scons: Building targets ...
Compiling main\main.cpp ...
main.cpp
main\main.cpp(31): error C2006: '#include': expected "FILENAME" or <FILENAME>
main\main.cpp(31): fatal error C1083: Cannot open include file: '': No such file or directory
scons: *** [main\main.windows.editor.x86_64.obj] Error 2
scons: building terminated because of errors.

It could be interesting to strip the lone main.cpp from the error message, but it's not critical.

@Repiteo Repiteo force-pushed the scons/silence-msvc-for-real branch 2 times, most recently from b3a1f05 to 4665769 Compare April 12, 2024 00:11
@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 12, 2024

Somehow I didn't notice that the initial line of bloat was always there. Thankfully, this simplifies the logic a fair bit, making the stderr call a one-liner.

@Repiteo Repiteo force-pushed the scons/silence-msvc-for-real branch from 4665769 to b278cef Compare April 12, 2024 03:21
@akien-mga akien-mga modified the milestones: 4.4, 4.3 Apr 12, 2024
@akien-mga akien-mga changed the title SCons: Silence msvc output bloat without hiding errors SCons: Silence MSVC output bloat without hiding errors Apr 12, 2024
@akien-mga akien-mga merged commit cabb3ca into godotengine:master Apr 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

3 participants