Skip to content

Conversation

@layomia
Copy link
Contributor

@layomia layomia commented Jun 6, 2020

Fixes #35527.

@layomia layomia added this to the 5.0 milestone Jun 6, 2020
@layomia layomia requested review from eerhardt and joperezr June 6, 2020 10:43
@layomia layomia self-assigned this Jun 6, 2020
@ghost
Copy link

ghost commented Jun 6, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.

Have you confirmed .locals init is appropriately not being output?

<When Condition="'$(ShouldSkipLocalsInit)' == 'true' and '$(IsNETCoreApp)' == 'true'">
<PropertyGroup >
<!-- This is needed to use the SkipLocalsInitAttribute. -->
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this from some .csproj files as a result?

Copy link
Member

Choose a reason for hiding this comment

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

@layomia and I checked offline and we really only want to add this attribute to net5.0 configurations, as we were only using the linker to remove locals init for those configurations. I would totally agree with you in removing duplicate properties if all configurations applied, but because it is only netcoreappcurrent then I think it will be messy to have this property basically have conditions in projects that say '$(TargetFramework)' != '$(NetCoreAppCurrent)' so I would probably suggest to live this as is for now.

@layomia
Copy link
Contributor Author

layomia commented Jun 9, 2020

Have you confirmed .locals init is appropriately not being output?

Yes, I've double-checked with various assemblies.

@layomia layomia requested review from eerhardt and joperezr June 9, 2020 18:26
Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

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

This LGTM other than that one small comment about probably renaming the attribute file. Thanks for fixing this @layomia 😄

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for getting this done.

@layomia layomia merged commit e2ed363 into dotnet:master Jun 10, 2020
@layomia layomia deleted the skiplocalsinit branch June 10, 2020 02:18
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to 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.

Use [SkipLocalsInit] in dotnet/runtime

6 participants