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

Run ILC after ComputeResolvedFilesToPublishList #111514

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Jan 16, 2025

Fixes #108909

Needs more testing, but seems to work with a small repro so far.

@MichalStrehovsky
Copy link
Member

Did you consider using the scheme that ILLink/R2R/SingleFile use right now?

It feels like it would make the sequencing most "standard". We'd probably need to wait for the new SDK to flow to this repo but we just did an upgrade and we could do another one.

@sbomer
Copy link
Member Author

sbomer commented Jan 17, 2025

This moves us in that direction - now this target will be sequenced appropriately - and we can change from AfterTargets to DependsOnTargets in a later change. I'm looking at the native aot targets all-up to see if there's other logic that needs cleanup, but wanted to start with this piece.

-->
<Target Name="ComputeLinkedFilesToPublish"
BeforeTargets="ComputeResolvedFilesToPublishList"
AfterTargets="ComputeResolvedFilesToPublishList"
Copy link
Member

Choose a reason for hiding this comment

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

ha ha nice catch

@@ -92,40 +118,4 @@

</Target>

<Target Name="CopyNativeBinary" AfterTargets="Publish">
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for getting rid of this

</PropertyGroup>

<ItemGroup Condition="'$(CopyOutputSymbolsToPublishDirectory)' == 'true'">
<_symbolRecursivePath Include="$(NativeOutputPath)$(TargetName)$(_symbolExt)/**/*" />
Copy link
Member

Choose a reason for hiding this comment

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

I think it may be possible to simplify this -- I'll have to refresh my MSbuild knowledge to remember if it's easy to just track everything in a subdir.

Comment on lines +49 to +58
Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>

<!-- Add folder otherwise -->
<ResolvedFileToPublish Include="@(_symbolRecursivePath)"
Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)/%(RecursiveDir)%(Filename)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
Copy link
Member

@am11 am11 Jan 17, 2025

Choose a reason for hiding this comment

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

nit: limit the scope of condition

Suggested change
Condition="'$(_symbolIsFile)' == 'true' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
<!-- Add folder otherwise -->
<ResolvedFileToPublish Include="@(_symbolRecursivePath)"
Condition="'$(_symbolIsFile)' == 'false' and Exists('$(_symbolSourcePath)')">
<RelativePath>$(TargetName)$(_symbolExt)/%(RecursiveDir)%(Filename)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
Condition="Exists('$(_symbolSourcePath)')">
<!-- If the symbol is a dSYM bundle, it's a folder not a file. -->
<RelativePath Condition="'$(NativeSymbolExt)' != '.dSYM'">$(TargetName)$(_symbolExt)</RelativePath>
<RelativePath Condition="'$(NativeSymbolExt)' == '.dSYM'">$(TargetName)$(_symbolExt)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

Comment on lines +39 to +41
<!-- If the symbol is a dSYM bundle, it's a folder not a file. -->
<_symbolIsFile Condition="'$(NativeSymbolExt)' == '.dSYM'">false</_symbolIsFile>
<_symbolIsFile Condition="'$(_symbolIsFile)' == ''">true</_symbolIsFile>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<!-- If the symbol is a dSYM bundle, it's a folder not a file. -->
<_symbolIsFile Condition="'$(NativeSymbolExt)' == '.dSYM'">false</_symbolIsFile>
<_symbolIsFile Condition="'$(_symbolIsFile)' == ''">true</_symbolIsFile>

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.

ILC should run after ComputeResolvedFilesToPublishList
4 participants