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

Add SuppressMetaPackage to break circular dependency during package restore #28042

Merged
merged 1 commit into from
Mar 15, 2018

Conversation

ahsonkhan
Copy link
Member

@ahsonkhan ahsonkhan commented Mar 14, 2018

See dotnet/corefxlab#2150 (comment) for context (where the issue was manifesting as a VS crash due to stackoverflow).

I tested this locally (by building and referencing the System.Threading.Tasks.Extensions/System.IO.Pipelines packages with this fix in a netstandard1.3 class library).

cc @weshaggard, @ericstj


<!-- this package is part of the implementation closure of NETStandard.Library
therefore it cannot reference NETStandard.Library -->
<SuppressMetaPackage Include="NETStandard.Library" />
Copy link
Member

Choose a reason for hiding this comment

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

Are there other packages this should be added to, as well?

Copy link
Member Author

@ahsonkhan ahsonkhan Mar 14, 2018

Choose a reason for hiding this comment

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

From my discussion with @ericstj yesterday, this was the only package that did not have it and needed it.

Other packages, like System.Buffers, System.Diagnostics.DiagnosticSource, etc. all have it already (https://github.com/dotnet/corefx/search?utf8=%E2%9C%93&q=SuppressMetaPackage&type=)

The remaining packages (for example those under Reflection.*) no longer publish newer versions.

A potential candidate for this could be System.Memory but so far no packages that are OOB (or partially OOB) reference System.Memory.

If, for instance, System.Threading.Tasks.Extensions were to reference System.Memory, we would probably need to add the property to System.Memory as well.

The validation tests that Eric mentioned should discover circular dependencies that we might miss in the future once we can get it up and running again.

Interestingly, System.Security.Cryptography.Cng does reference System.Memory, but doesn't trigger the circular dependency:

From System.Memory nuspec:

      <group targetFramework=".NETStandard1.1">
        <dependency id="NETStandard.Library" version="1.6.1" />
        <dependency id="System.Buffers" version="4.5.0-preview2-26313-0" exclude="Compile" />
        <dependency id="System.Runtime.CompilerServices.Unsafe" version="4.5.0-preview2-26313-0" exclude="Compile" />
      </group>

This is most likely because nothing in NETStandard.Library depends on System.Memory (not part of the implementation closure of NETStandard.Library, along with System.Security.Cryptography.Cng). Please let me know if I am mistaken.

Copy link
Member

@ericstj ericstj Mar 14, 2018

Choose a reason for hiding this comment

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

Interestingly, System.Security.Cryptography.Cng does reference System.Memory, but doesn't trigger the circular dependency:

That's because CNG isn't in the package closure of NETStandard.Library. The problem comes about when something in the closure of NETStandard.Library starts referencing NETStandard.Library. For everything subsumed by NETStandard.Library this isn't an issue since we no longer build packages for them. There were, however, a handful of packages which were previously in the implementation closure of NETStandard.Library, but not added to the NETStandard2.0 surface area (not subsumed):

  • System.Buffers
  • System.Diagnostics.DiagnosticSource
  • System.Threading.Tasks.Extensions
  • System.Reflection.Emit
  • System.Reflection.Emit.ILGeneration
  • System.Reflection.Emit.Lightweight
  • System.Reflection.TypeExtensions
  • System.Security.Cryptography.OpenSsl

For any of these we have to make sure that newer versions of the packages don't bring in a transitive reference to NETStandard.Library, otherwise it will create a cycle. The one that did introduce this was System.Threading.Tasks.Extensions > System.Runtime.CompilerServices.Unsafe > NETStandard.Library.

Copy link
Member Author

@ahsonkhan ahsonkhan Mar 14, 2018

Choose a reason for hiding this comment

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

The one that did introduce this was System.Reflection.TypeExtensions > System.Runtime.CompilerServices.Unsafe > NETStandard.Library.

Shouldn't it be System.Threading.Tasks.Extensions?

Copy link
Member

Choose a reason for hiding this comment

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

Right you are. Corrected.

@jkotas
Copy link
Member

jkotas commented Mar 14, 2018

Is this going to be necessary once we fix https://github.com/dotnet/corefx/issues/26145 ?

@weshaggard
Copy link
Member

Is this going to be necessary once we fix #26145 ?

Yes I do think this will still be needed after you fix #26145 as that only adds a netcoreapp configuration and the issue at hand is about a netstandard library, in partcular netstandard library less then v2.

@ahsonkhan did you verify the diff of the package/nuspec looks correct?

@ahsonkhan
Copy link
Member Author

did you verify the diff of the package/nuspec looks correct?

Before and after:
image

@ahsonkhan
Copy link
Member Author

OSX failure - https://github.com/dotnet/core-eng/issues/2913

I am not sure what is the cause of the Windows catastrophic failures (on Windows.81.Amd64.Open:Debug-x64 / Windows.7.Amd64.Open:Debug-x64). @dotnet/dnceng, is this a known issue?
https://mc.dot.net/#/user/ahsonkhan/pr~2Fjenkins~2Fdotnet~2Fcorefx~2Fmaster~2F/test~2Ffunctional~2Fcli~2F/a394c8d1d4af87f77631adee58cf75d38f89b5b5

DownloadError: Unable to download https://dotnetbuilddrops.blob.core.windows.net/build-8ca36596d1354b56b426b39eb6b890e1/SupplementalPayload.zip?sv=2015-04-05&sr=c&sig=XVKQ8bCIcGgWnnkwJFWkva3QCCxHcgQvsy0UJQmTh7I%3D&st=2018-03-14T19%3A12%3A01.6785122Z&se=2018-04-13T19%3A12%3A01.6795110Z&sp=r after retrying. Execution may be compromised.

@dotnet-bot test Windows x64 Debug Build
@dotnet-bot test OSX x64 Debug Build

@jonfortescue
Copy link
Contributor

@ahsonkhan That's just what the secret cycling error looks like on Windows. It's the same issue that's occurring on OSX stuff. It's "unable to download" bc it has improper auth tokens.

@MattGal
Copy link
Member

MattGal commented Mar 15, 2018

The issue looks fixed across the board but OSX is heavily backed up, give it some time to catch up.

@ahsonkhan
Copy link
Member Author

@dotnet-bot test OSX x64 Debug Build

1 similar comment
@ahsonkhan
Copy link
Member Author

@dotnet-bot test OSX x64 Debug Build

@ahsonkhan ahsonkhan merged commit e75c019 into dotnet:master Mar 15, 2018
@ahsonkhan ahsonkhan deleted the AddSuppressMetaPackage branch March 15, 2018 18:12
@karelz karelz added this to the 2.1.0 milestone Mar 18, 2018
ericstj pushed a commit to ericstj/corefx that referenced this pull request Mar 28, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
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.

8 participants