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

Fix packaging for the browser #40814

Merged
merged 3 commits into from
Aug 18, 2020
Merged

Fix packaging for the browser #40814

merged 3 commits into from
Aug 18, 2020

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Aug 14, 2020

Fixes #40813

Fixing system.Drawing.package & some minor cleanup

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@@ -5,14 +5,14 @@
<WarningsNotAsErrors>CS0618</WarningsNotAsErrors>
<DefineConstants Condition="'$(TargetsWindows)' == 'true'">$(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS</DefineConstants>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;netcoreapp3.0-Windows_NT;netcoreapp3.0-Unix</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-Windows_NT;netcoreapp3.0-Unix;netcoreapp3.0</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

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

Why are we adding netcoreappp3.0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want anybody using system.Drawing.common package on browser to have pnse, which is not the case currently. net5.0 is not included in the package, only netcoreapp3.0-win & netcoreapp3.0-unix.

Adding a version less config netcoreapp3.0 will have pnse for browser or any other os not a child of windows & unix.

Copy link
Member

Choose a reason for hiding this comment

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

net5.0 is not included in the package

That's the part I was missing. Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

Before this would have resolved to the netstandard2.0 lib which is harvested, but presumably that was a ref-def mismatch because it was lower version than the 3.0 ref?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes thats a correct. The 3.0 contains some api changes which are not in netstandard2.0

@@ -14,7 +14,6 @@
<OmitResources Condition="$(TargetFramework.StartsWith('net4'))">true</OmitResources>
<!-- Currently the netstandard build is locked to the net472 API -->
<AssemblyVersion Condition="$(TargetFramework.StartsWith('netstandard'))">4.0.4.0</AssemblyVersion>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsBrowser)' == 'true'">SR.SystemSecurityCryptographyPkcs_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
Copy link
Member

Choose a reason for hiding this comment

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

Same as above - Crypto doesn't work on Browser, so we should be generating PNSE.

If we are really removing this - then we should also remove the SystemSecurityCryptographyPkcs_PlatformNotSupported string from the Strings.resx.

Copy link
Contributor Author

@Anipik Anipik Aug 14, 2020

Choose a reason for hiding this comment

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

'$(TargetsBrowser)' == 'true' will never be true as the current tfms doesnt target browser specific config

If we want to add pnse for crypto here, we need to add a new tfm.

cc @marek-safar

Copy link
Member

Choose a reason for hiding this comment

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

cc @lewing and @steveisok as well - since they are working on adding [UnsupportedOSPlatform] attributes for browser.

Copy link
Member

Choose a reason for hiding this comment

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

Also note that we have ExcludeCurrentNetCoreAppFromPackage so if we add NetCoreAppCurrent-Browser we need to include current tfm in the package.

Copy link
Member

Choose a reason for hiding this comment

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

I take it we would no longer be throwing PNSE out of here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there something that we need to do in this pr ?

Copy link
Contributor

Choose a reason for hiding this comment

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

When running System.Security.Cryptography.Pkcs.Tests library test suite on Browser Wasm, there is the following result:
Tests run: 813, Errors: 0, Failures: 728, Skipped: 19. Time: 2.13732s.
Most of the failures are System.PlatformNotSupportedException : System.Security.Cryptography.Encoding is not supported on this platform. and System.PlatformNotSupportedException : System.Security.Cryptography.Algorithms is not supported on this platform.

Copy link
Member

Choose a reason for hiding this comment

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

Is there something that we need to do in this pr ?

@Anipik I don't think so.

Copy link
Member

Choose a reason for hiding this comment

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

Is the SystemSecurityCryptographyPkcs_PlatformNotSupported resource still being used? If not can you delete it?

@steveisok - will these APIs get ‘UnsupportedOSPlatform(“browser”) attributes on them?

Copy link
Contributor

@MaximLipnin MaximLipnin Aug 18, 2020

Choose a reason for hiding this comment

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

They already have it- #40612

@Anipik Anipik requested a review from ericstj August 17, 2020 19:38
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 good to me. Thanks for answering my questions @Anipik.

@Anipik Anipik merged commit a7278fd into dotnet:master Aug 18, 2020
@Anipik Anipik deleted the browser branch August 18, 2020 20:37
Anipik added a commit that referenced this pull request Aug 19, 2020
* Fix packaging for the browser

* fix wasm leg

* remove unused resource
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 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.

Correct configurations in packages for Browser tfm
8 participants