Skip to content

[release/7.0] Prevent warning for implicit ILCompiler reference - #79870

Merged
carlossanlop merged 1 commit into
dotnet:release/7.0from
sbomer:fixPackageWarning7
Jan 5, 2023
Merged

[release/7.0] Prevent warning for implicit ILCompiler reference#79870
carlossanlop merged 1 commit into
dotnet:release/7.0from
sbomer:fixPackageWarning7

Conversation

@sbomer

@sbomersbomer commented Dec 21, 2022

Copy link
Copy Markdown
Member

Backport of #79240. Since I am touching this, I'm also backporting a change to the warning message from #75043.

Customer Impact

Context: dotnet/sdk#28823

PublishAot with .NET 8 SDK targeting net7.0 produces the following warning:

Set PublishAot property to true and delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file. Explicit 'Microsoft.DotNet.ILCompiler' package reference can run into version errors.

The 7.0 ILCompiler package produces this warning. This is by design for 7.0 scenarios, but the .NET 8 SDK uses an implicit PackageReference to reference the 7.0 ILCompiler, which should not warn.

This fix removes the warning in the .NET 8 SDK scenario, and rewords the warning when using an explicit PackageReference (a 7.0 scenario) to avoid recommendation to set PublishAot, since this is only reachable when PublishAot is already set.

Testing

There are existing tests for the unchanged behavior in https://github.com/dotnet/sdk/blob/7663c1f4d5896acfb71067be3fb9510be7bde4f1/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs#L266.
Tests are being added for the 8.0 behavior in dotnet/sdk#29393.

Risk

Very low. The implicit packagereference didn't exist in 7.0, so only the warning message changes when using the NET 7 SDK.

@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #79240. Since I am touching this, I'm also backporting a change to the warning message from #75043.

Customer Impact

Necessary to fix dotnet/sdk#28823 when targeting 7.0 from a .NET 8 SDK.

Testing

There are existing tests for the unchanged behavior in https://github.com/dotnet/sdk/blob/7663c1f4d5896acfb71067be3fb9510be7bde4f1/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs#L266.
Tests are being added for the 8.0 behavior in dotnet/sdk#29393.

Risk

Very low. The implicit packagereference didn't exist in 7.0, so only the warning message changes in 7.0.

Author:sbomer
Assignees:-
Labels:

area-NativeAOT-coreclr

Milestone:-

@sbomersbomer added the Servicing-consider Issue for next servicing release review label Dec 21, 2022
@marek-safarmarek-safar added this to the 7.0.x milestone Dec 22, 2022
@jeffschwMSFTjeffschwMSFT removed the Servicing-consider Issue for next servicing release review label Jan 3, 2023

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

approved. please get a code review and we will take for consideration in 7.0.x

@jeffschwMSFTjeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jan 3, 2023

@LakshanFLakshanF left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@rbhandarbhanda modified the milestones: 7.0.x, 7.0.3Jan 5, 2023
@rbhandarbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 5, 2023
@carlossanlop

Copy link
Copy Markdown
Contributor

Approved by Tactics (7.0.3).
Signed off by area owners.
No OOB changes needed.
CI is green.
Ready to merge. :shipit:

@carlossanlop
carlossanlop merged commit 4769ff2 into dotnet:release/7.0Jan 5, 2023
@ghostghost locked as resolved and limited conversation to collaborators Feb 5, 2023
@sbomer
sbomer deleted the fixPackageWarning7 branch November 3, 2023 18:37
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-NativeAOT-coreclrServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@sbomer@carlossanlop@LakshanF@jeffschwMSFT@marek-safar@rbhanda