Skip to content

Clean up AOT publish process - #73416

Merged
LakshanF merged 29 commits into
dotnet:mainfrom
LakshanF:CleanPublishAot
Aug 15, 2022
Merged

Clean up AOT publish process#73416
LakshanF merged 29 commits into
dotnet:mainfrom
LakshanF:CleanPublishAot

Conversation

@LakshanF

Copy link
Copy Markdown
Contributor

Fixes#72415, the plan is in the comments.

@sbomersbomer 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.

Nice! I noticed one thing I missed in #72346 - I think file Microsoft.DotNet.ILCompiler.targets should be renamed to not match the package name. Otherwise with a packagereference, those targets will be imported twice, once via nuget, and once by the SDK.

On the SDK side, I think the PublishAot condition should also be removed here: https://github.com/dotnet/sdk/blob/e8dc19097ac6b20ba1c8fc87500251e815e5e984/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L1166

Comment threadsrc/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Outdated
Comment threadsrc/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Outdated
Comment threadsrc/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Outdated
Comment threadsrc/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Outdated
LakshanFand others added 3 commits August 5, 2022 05:46
Comment threadsrc/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets Outdated
@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF

Copy link
Copy Markdown
ContributorAuthor

/azp run runtime-extra-platforms

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@LakshanF
LakshanF merged commit 06339dc into dotnet:mainAug 15, 2022
@LakshanF
LakshanF deleted the CleanPublishAot branch August 15, 2022 21:54
lewing added a commit that referenced this pull request Aug 16, 2022
github-actionsBot pushed a commit that referenced this pull request Aug 17, 2022

<PropertyGroup>
<!-- Set the publishAot property to true if not set-->
<PublishAot Condition="'$(PublishAot)' == ''">true</PublishAot>

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.

If I understand it correctly, this was needed because we do the ".targets included from a .props file" antipattern - I think we discussed this in one of the past pull request - to do the real fix, we likely need to break up Microsoft.DotNet.ILCompiler.targets into Microsoft.DotNet.ILCompiler.targets and Microsoft.DotNet.ILCompiler.props as needed.

(The convention is that .props are included before the user project, .targets get included after the user provided stuff - we would see PublishAot being set there if the user wants it.)

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.

Most of the stuff that is already in .targets should be in .targets. We wouldn't probably have much (if anything?) in the props.

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.

I don't think it's because we are importing targets from props (if we are, that should probably be fixed) - this was needed to preserve the OOB package behavior where the packagereference was all that was needed to turn on AOT publish (you didn't need to set PublishAot explicitly).

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.

Ah, you're right. I saw .targets in a .props and I thought it's an Import, but it's just storing it in a property for later.

@ghostghost locked as resolved and limited conversation to collaborators Sep 16, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NativeAOT] Clean up AOT Publishing

4 participants

@LakshanF@radical@sbomer@MichalStrehovsky