-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Conversation
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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
...braries/System.Security.Cryptography.OpenSsl/src/System.Security.Cryptography.OpenSsl.csproj
Show resolved
Hide resolved
@@ -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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this 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.
Fixes #40813
Fixing system.Drawing.package & some minor cleanup