Skip to content

[release/9.0-staging] Fix inadvertently upgrading compiler warnings to errors #114331

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

Merged

Conversation

akoeplinger
Copy link
Member

Backport of #114323 to release/9.0-staging.

Don't inadvertently upgrade compiler warnings to errors in libs.native.

Customer Impact

  • Customer reported
  • Found internally

Building with a newer compilers can introduce new warnings, breaking the build unintentionally even though we explicitly tried to avoid this by disabling this behavior in release branches. This could especially affect source-build partners which don't use our build infrastructure.

Regression

  • Yes
  • No

No, we just forgot to apply this fix to the libs.native subset. It was there for coreclr and mono runtime builds already.

Testing

CI testing.

Risk

Low, this is a build-only change.

I noticed this while looking at an issue in the 9.0 branch with latest clang which runs into a couple warnings fixed in main with dotnet#108888.

We intentionally don't set `-Werror` in release branches to avoid breaking the build when newer compilers add warnings via https://github.com/dotnet/runtime/blob/37e4d45236e68946db9d264593aa31a9c00534bc/eng/native/configurecompiler.cmake#L564-L567

However this didn't work because msbuild's WarnAsError was still reading the console output of the native build and upgrading any line with "warning: " to an msbuild error and breaking the build.

Suppress this by setting IgnoreStandardErrorWarningFormat="true" on the Exec call. We already did this in the coreclr and mono runtime builds, we just missed it in libs.native.
@Copilot Copilot AI review requested due to automatic review settings April 7, 2025 14:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • src/native/libs/build-native.proj: Language not supported

@akoeplinger
Copy link
Member Author

Applying servicing-approved, infrastructure-only change required to build with newer compilers, tell mode.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

@akoeplinger akoeplinger added the Servicing-approved Approved for servicing release label Apr 7, 2025
@akoeplinger

This comment was marked as outdated.

This comment was marked as outdated.

@akoeplinger akoeplinger changed the title [release/9.0-staging] Fix inadvertently upgrading compiler warnings to errors (#114323) [release/9.0-staging] Fix inadvertently upgrading compiler warnings to errors Apr 7, 2025

This comment was marked as outdated.

@akoeplinger
Copy link
Member Author

/ba-g wasm failures are due to using a not-yet-published .net version, unrelated

@akoeplinger akoeplinger merged commit 5407686 into dotnet:release/9.0-staging Apr 8, 2025
107 of 112 checks passed
@akoeplinger akoeplinger deleted the 9.0-compiler-warning branch April 8, 2025 07:06
@github-actions github-actions bot locked and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants