Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Uwp6.2: Port size on disk related fixes#31693

Merged
zacharycmontoya merged 5 commits intodotnet:release/uwp6.2from
MichalStrehovsky:portSizeFixesTo62
Aug 17, 2018
Merged

Uwp6.2: Port size on disk related fixes#31693
zacharycmontoya merged 5 commits intodotnet:release/uwp6.2from
MichalStrehovsky:portSizeFixesTo62

Conversation

@MichalStrehovsky
Copy link
Member

git cherry-pick 6867b6fc9327d2f9c3e36dd5889a0eb9c3991da5
git cherry-pick e5720ae475b90710586b734f149df2ded318cf73
git cherry-pick 5898cdd5b835fde14bb3c25c39755725de02f2b9
git cherry-pick d21453e1cfa2e2546deccbd3a4be46341e4ba5d1
git cherry-pick 39e96cd8e3b97f8b1a5fce86211cf8fec7ea478a

MichalStrehovsky and others added 5 commits August 10, 2018 12:52
This corrects the size on disk regression caused by dotnet#19912. After that pull request, all of the schema validation stuff would always be included for any app that depends on System.Private.Xml because during initial analysis we consider a lot of things in S.P.Xml necessary as a precaution for SG generating references to it. The RD.XML in S.P.Xml then roots things forever.

I spent some time getting a repro of the original failure and convinced myself this is not a scenario that would require RD.XML in the S.P.Xml assembly.

Here's the facts:
* This test uses a test hook to explicitly disable pregenerated serialization code for `XmlSchema`. (https://github.com/dotnet/corefx/blob/1afc5360013bedc4099875c836342f493b083e5f/src/System.Private.Xml/src/System/Xml/Schema/XmlSchema.cs#L175 that is on stack at the time of failure is an analysis slam dunk, so we do have pregenerated code, we just don't use it because of the hook)
* The test is then testing the reflection fallback path to serialize `XmlSchema`. This doesn't work. Reflection fallback path won't in general work for _any framework provided type_ because there's no RD.XML to root it. Reflection fallback really only works for user types because of our default RD.XML that roots all user types (we also use that for the CoreFX tests, which is why the other reflection fallback tests don't hit issues).
This adds [removable feature annotation](dotnet/designs#42) to `XmlDownloadManager`.

If the user specifies that they would like to remove support for this at publish/native compilation time, the linker/compiler is going to replace the method body of `CreateWebRequestOrThrowIfRemoved` with a throwing method body. The exception message is going to inform the user that the feature has been removed because they opted into the removal.

Contributes to #30597. Saves 1.2 MB of the size of the Windows UWP People app. This is a size on disk regression that came with NetStandard 2.0.
…t#31533)

This adds [removable feature annotation](dotnet/designs#42) to data
contract serialization.

If the user specifies that they would like to remove support for this
at publish/native compilation time, the linker/compiler is going to
replace the annotated method bodies with a throwing method body.
The exception message is going to inform the user that the feature
has been removed because they opted into the removal. The throwing
method body is significantly smaller than the transitive closure
of code reachable from the original method body.

Contributes to #30597. Turning this feature off in the UWP People app
saves 4% of size. This is a size on disk regression that came with
the new version of CoreFX and blocks the Windows team in picking up
the latest framework. There is a zero size growth goal.
This ports over the change from
dotnet/corert@0ac83cb.

When UsingResourceKeys is true and we stripped the resources, the
existing code would have returned null.
@MichalStrehovsky MichalStrehovsky added the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Aug 10, 2018
@MichalStrehovsky
Copy link
Member Author

cc @sergiy-k @zamont

I'll make a separate pull request for Stephen's changes around System.Linq. Unfortunately that one cannot be cleanly cherry picked because there are merge conflicts and build breaks.

@MichalStrehovsky MichalStrehovsky changed the title Port size on disk related fixes to UWP6.2 Uwp6.2: Port size on disk related fixes Aug 10, 2018
}
#endif

[RemovableFeature(ReflectionBasedSerializationFeature.Name)]
Copy link

@zacharycmontoya zacharycmontoya Aug 10, 2018

Choose a reason for hiding this comment

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

Should this RemovableFeatureAttribute be in an ifdef?

// This code is statically reachable from any place that uses XmlReaderSettings (i.e. every app that
// does something XML related is going to have this in their transitive call graph). People rarely need
// this functionality though.
[RemovableFeature("System.Xml.XmlUrlResolver.NonFileUrlSupport")]

Choose a reason for hiding this comment

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

Should this RemovableFeatureAttribute also be in an ifdef?

@zacharycmontoya
Copy link

The Linux x64 Release Build doesn't show any test failures in Jenkins, so I'm not sure why it returned as a failure.

@zacharycmontoya
Copy link

LGTM besides my two comments

@zacharycmontoya
Copy link

Turns out the Fedora.26.Amd configuration has reached end-of-life. I'll put that change on top of Morgan's existing PR and I hope that will be merged on Monday

@zacharycmontoya
Copy link

Morgan's PR was clean and is here for reference: #30886

Copy link

@zacharycmontoya zacharycmontoya left a comment

Choose a reason for hiding this comment

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

LGTM I'll merge this now

@zacharycmontoya zacharycmontoya merged commit c5d204f into dotnet:release/uwp6.2 Aug 17, 2018
@MichalStrehovsky MichalStrehovsky deleted the portSizeFixesTo62 branch August 18, 2018 06:31
@karelz karelz added this to the UWP6.2 milestone May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

* NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants