Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. #33254

Merged
merged 2 commits into from
Nov 13, 2018

Conversation

joperezr
Copy link
Member

@joperezr joperezr commented Nov 5, 2018

Fixes #32457

These changes will remove the reference assets from the packages which have runtime-specific dependencies which are causing RAR to not see a conflict, and won't generate binding redirects to address the conflict. As part of this, we will also add validation that will ensure future packages won't hit the same problem either (that will come in a buildtools PR). Marking it as No Merge since we have to follow the shiproom process to get this in.

cc: @ericstj @natemcmaster

@joperezr joperezr added the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Nov 5, 2018
@joperezr joperezr added this to the 2.1.x milestone Nov 5, 2018
@joperezr joperezr requested a review from ericstj November 5, 2018 20:05
@ericstj
Copy link
Member

ericstj commented Nov 5, 2018

Did you consider adding the target to detect these?

We may want to do an assembly diff between the changes that this causes so that we can understand how this might impact consumers of these libraries.

@joperezr
Copy link
Member Author

joperezr commented Nov 5, 2018

Did you consider adding the target to detect these?

I did but didn't want to add that on corefx directly, which is why in the description I mentioned that this will be added in buildtools. I'll add it there now in a PR and then update this one to ingest those new changes.

We may want to do an assembly diff between the changes that this causes

Agreed, I'll do that today for those 9 packages and ensure everything is ok.

@joperezr
Copy link
Member Author

joperezr commented Nov 6, 2018

@ericstj I did a full Api diff comparing the old reports with the new ones after my change, and I didn't notice any possible problems except for one small issue with System.Security.Cryptography.Cng. The problem was for .NET Framework 4.6.1, since there are some types that were on the contract but are not present in the implementation assembly. I chatted with @bartonjs about this, and it looks like this is a known issue since the missing types where simply not present in .NET 4.6.1, so current users targetting that framework and using the package would be able to compile against the types, but get runtime errors for missing types. ApiCompat doesn't flag this because we have a baseline file for this known issue:

# The .NET 4.6.3 targeting pack (1.0.1) doesn't have the new members added for ECDsa import/export yet.
MembersMustExist : Member 'Microsoft.Win32.SafeHandles.SafeNCryptHandle..ctor(System.IntPtr, System.Runtime.InteropServices.SafeHandle)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle..ctor(System.IntPtr, System.Runtime.InteropServices.SafeHandle)' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Security.Cryptography.AesCng' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Security.Cryptography.CngAlgorithm.ECDiffieHellman.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Security.Cryptography.CngAlgorithm.ECDsa.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Security.Cryptography.CngKeyBlobFormat.EccFullPrivateBlob.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Security.Cryptography.CngKeyBlobFormat.EccFullPublicBlob.get()' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Security.Cryptography.DSACng' does not exist in the implementation but it does exist in the contract.
TypesMustExist : Type 'System.Security.Cryptography.TripleDESCng' does not exist in the implementation but it does exist in the contract.

So what we've done with this change is to move a runtime error into a compile time error, which in my opinion is much better. Other than that, I didn't notice any problems this change would have API-wise.

@ericstj
Copy link
Member

ericstj commented Nov 6, 2018

Interesting, so we had a net4x reference with type forwards for the existing types and type-defs for the missing ones, eh? That's rather odd but I see how that would have happened. I guess there could be someone who wrote light-up code that needed those type-defs to compile but guarded it with a runtime check. We could always add it back if folks reported such an issue. @bartonjs what do you think?

@bartonjs
Copy link
Member

bartonjs commented Nov 7, 2018

I discussed it with @joperezr this morning (er, yesterday, since I didn't hit Comment), and my thoughts are that we should just rip the band-aid (make it a compile error).

  • Abandon this project: Callers get a TypeNotFoundException. They could be doing lightup to try and do a fallback, but seems unlikely.
  • Make PNSE-throwing wrappers: Doesn't change anyone who wasn't calling it. Breaks lightup callers looking for TypeNotFoundException, continues to power anyone with open exception drains for lightup.
  • Make an explicit thing that throws TypeNotFoundException: I feel like the runtime team will give us the evil eye.
  • Use ILMerge (or something) to write type forwards we know won't resolve: Keeps the TypeNotFoundException, don't know what it does to compiling. Or VS.
  • Leave the types out: Compile break in lightup code. Guess they have to switch to reflection?

Leaving the types out is the easiest, and the easiest to describe.

@ericstj
Copy link
Member

ericstj commented Nov 7, 2018

Leave the types out: Compile break in lightup code. Guess they have to switch to reflection?

Or target netstandard 😛

I agree with you that its unlikely for folks to break, especially given that they would have needed a runtime facade with the typeforwards for that lightup to work. I'm ok with this.

@joperezr
Copy link
Member Author

joperezr commented Nov 7, 2018

@dotnet-bot test OSX x64 Debug Build please

@joshfree
Copy link
Member

joshfree commented Nov 9, 2018

@joperezr can this be merged now?

@joperezr
Copy link
Member Author

joperezr commented Nov 9, 2018

Release/2.1 branch is currently locked which is why I have the NO MERGE label on this. Once the branch is unlocked we can merge this in.

@joperezr joperezr removed the * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) label Nov 13, 2018
@joperezr joperezr merged commit 03bad43 into dotnet:release/2.1 Nov 13, 2018
@joperezr joperezr deleted the RemovingRefsFromPackages branch November 13, 2018 19:00
joperezr added a commit to joperezr/corefx that referenced this pull request Nov 14, 2018
…c dependencies when targeting Desktop. (dotnet#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property
joperezr added a commit that referenced this pull request Nov 16, 2018
…c dependencies when targeting Desktop. (#33510)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property

* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.

* Update package index to contain the right versions

* Fixing packaging build errors
danmoseley pushed a commit that referenced this pull request Dec 3, 2018
* Added additional OIDs for RSA-SSA-PKCS1.5 CMS signatures

This enables processing documents which use the X.509 hybrid identifier (e.g. `sha256WithRSAEncryption`) instead of `rsaEncryption`.

* Allow transporting an indefinite-length encoding for content in SignedCms

SignedCms reads BER, because the spec says to, and writes DER, to provide
better interop.  If the incoming message used an indefinite length encoding
for SignedData.encapContentInfo.eContent's ANY value the call to Encode
will throw (as will any mutation operations which internally use Encode).

With this change, if writing DER fails then assemble the output in pieces to leave
the encapsulated content as-is while DER-normalizing the rest of the structure.

* Package authoring for servicing change

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property

* Rebranding for 2.1.7 (#33471)

* Undoing the ref removal on two packages that didn't need this change (#33536)

* Fixes extract out of directory by ensuring trailing separator for nested paths. (#32165)

Related to PR #32127

* Change release/2.1 to new test queues

Centos.73.Amd64 => Centos.7.Amd64
RedHat.69.Amd64 => RedHat.6.Amd64
RedHat.73.Amd64 => RedHat.7.Amd64
Debian.87.Amd64 => Debian.8.Amd64
-Debian.90.Amd64 (redundant to Debian.9.Amd64)
OpenSuse.423.Amd64 => OpenSuse.42.Amd64

* Update CoreClr, CoreFx, CoreSetup to servicing-27120-02, servicing-27120-07, servicing-27120-02, respectively

* Update Japanese Calendar tests

This change is to have the Japanese calendar tests work as expected with the new interoduced era for this calendar.

* Fix the failing calendar tests on NetFx
jlennox pushed a commit to jlennox/corefx that referenced this pull request Dec 16, 2018
…c dependencies when targeting Desktop. (dotnet#33510)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property

* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.

* Update package index to contain the right versions

* Fixing packaging build errors
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…c dependencies when targeting Desktop. (dotnet/corefx#33510)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet/corefx#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property

* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.

* Update package index to contain the right versions

* Fixing packaging build errors


Commit migrated from dotnet/corefx@6832425
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants