Skip to content

Add missing assemblies to ref pack #19161

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

Merged
merged 12 commits into from
Feb 20, 2020
Merged

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo JunTaoLuo commented Feb 19, 2020

This fixes the incorrect condition from #18380. The issue is that the CoreFx ref assemblies do not have the IsAssemblyReference metadata set. As a result, the assemblies were excluded from the AspNetCore.App.Ref ref pack.

This PR updates the condition so that only the assemblies with IsAssemblyReference set to false are excluded.

@@ -130,7 +130,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<!-- Exclude transitive external dependencies that are not directly referenced by projects in AspNetCore or Extensions -->
<AspNetCoreReferenceAssemblyPath
Include="@(ReferencePathWithRefAssemblies)"
Condition="'%(ReferencePathWithRefAssemblies.IsReferenceAssembly)' == 'true'"
Condition="'%(ReferencePathWithRefAssemblies.IsReferenceAssembly)' != 'false'"
Copy link
Contributor

Choose a reason for hiding this comment

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

Have trouble believing the previous Exclude item was wrong. Instead the ref/ project shouldn't provide metadata in @(ReferencePathWithRefAssemblies).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh, I think I now understand what you mean. We should probably investigate what's happening here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we need to exclude %(IsReferenceAssemblyProject) items from @(AspNetCoreAppReference) in the main @(Reference) item group at

<Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)" />
then add another with <ReferenceOutputAssembly>false</ReferenceOutputAssembly> for the @(AspNetCoreAppReference) items that are from ref/ projects. Might be possible to shorten the new code to

<ItemGroup>
  <Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)">
    <ReferenceOutputAssembly Condition=" '%(IsReferenceAssemblyProject)' == 'true' ">false</ReferenceOutputAssembly>
  </Reference>

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be fine to remove references to the ref/ projects entirely i.e. exclude @(AspNetCoreAppReference) and @(AspNetCoreAppReferenceAndPackage) items with '%(IsReferenceAssemblyProject)' == 'true' metadata. Of course, need to confirm that metadata is present. (Root cause here is those two item groups map names to projects and the names are ambiguous.)

@JunTaoLuo
Copy link
Contributor Author

Spot checking and it seems like the CoreFx binaries are now included in the ref pack:
image

@wtgodbe
Copy link
Member

wtgodbe commented Feb 19, 2020

This has the same content as the 3.1.0 ref pack now (the same 253 items). However, we now need to make sure that the updated ref assembly from System.IO.Pipelines 4.7.1 does not make it in to the 3.1.3 targeting pack, but we do need to include the patched implementation assembly in the runtime pack (see dotnet/corefx#42837). @dougbu @JunTaoLuo @ericstj any ideas?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 19, 2020

Convert

<ExternalAspNetCoreAppReference Include="System.IO.Pipelines" Version="$(SystemIOPipelinesPackageVersion)" />
<ExternalAspNetCoreAppReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlPackageVersion)" />
<!--
Transitive dependencies of other assemblies in the shared framework. These are listed separately and should not be included directly
when setting `<Reference>`. These are listed for the purpose of tests and servicing builds only.
If implementation details change and these assemblies are no longer showing up in the shared framework as a result of that,
it is okay to remove these transitive dependencies.
If these are needed as direct dependencies, it is okay to change them to ExternalAspNetCoreAppReference and move up into sections above.
-->
<_TransitiveExternalAspNetCoreAppReference Include="Microsoft.Win32.SystemEvents" Version="$(MicrosoftWin32SystemEventsPackageVersion)" />
<_TransitiveExternalAspNetCoreAppReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" />
<_TransitiveExternalAspNetCoreAppReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
<_TransitiveExternalAspNetCoreAppReference Include="System.Security.Cryptography.Pkcs" Version="$(SystemSecurityCryptographyPkcsPackageVersion)" />
<_TransitiveExternalAspNetCoreAppReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)" />
<_TransitiveExternalAspNetCoreAppReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" />
into 2 separate item groups, one for the latest versions and one for the PatchVersion=0 versions, which are used by the runtime pack & targeting pack respectively?

@JunTaoLuo
Copy link
Contributor Author

@wtgodbe can you try that approach and see what it looks like? Feel free to update this branch.

@wtgodbe
Copy link
Member

wtgodbe commented Feb 19, 2020

Took a crack at it with 903ddbd & cac1ed2. We'll need to wait until dotnet/corefx#42837 flows to AspNetCore to really be sure it worked.

@JunTaoLuo JunTaoLuo marked this pull request as ready for review February 19, 2020 22:13
@JunTaoLuo
Copy link
Contributor Author

looks like tests are passing, @wtgodbe can you check the targeting pack?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

@JunTaoLuo I'll check it once we take the CoreFx change that bumps System.IO.Pipelines to 4.7.1 (which should be very soon)

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

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

Other than @wtgodbe's extra newline (a nit 😈), code looks good. Of course, we want to be sure that part of the change works w/ new CoreFx packages before actual merge

@dougbu
Copy link
Contributor

dougbu commented Feb 20, 2020

Thanks @JunTaoLuo for banging this out and @wtgodbe for your additions as well as

I'll check it once we take the CoreFx change

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

Might not be able to validate this w/ the corefx change tonight, Maestro seems to be on the fritz - it hasn't opened any PRs in the last ~3 hours (@chcosta @riarenas @JohnTortugo @mmitche is it a known thing?)

@Pilchie Pilchie added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label Feb 20, 2020
@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

This is now ready to be validated once we have the build

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

/__w/1/s/src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj : error NU1605: Detected package downgrade: System.IO.Pipelines from 4.7.1 to 4.7.0. Reference the package directly from the project to select a different version. [/__t/dotnet/sdk/3.1.100/NuGet.targets]

I'll add NU1605 to the ref pack's NoWarn, but will we wind up transitively bringing in the higher version anyway? CC @dougbu @JunTaoLuo

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

##[error]eng/SharedFramework.External.props(10,18): error MSB4100: Expected "$(IsReferenceAssemblyProject)" to evaluate to a boolean instead of "", in condition "'$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref' OR $(IsReferenceAssemblyProject) ".

Looks like IsReferenceAssemblyProject isn't always set. Will update the condition

@JunTaoLuo
Copy link
Contributor Author

Which projects was resolving IsReferenceAssemblyProject as empty?

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

Which projects was resolving IsReferenceAssemblyProject as empty?

I'm not sure, the build for Doug's commit seems to have disappeared

@wtgodbe
Copy link
Member

wtgodbe commented Feb 20, 2020

The ref pack & runtime pack both look good! The ref pack has the same content as the 3.1.0, the same platform manifest as 3.1.2, and the 4.0.2.0 ref assembly for System.IO.Pipelines (rather than the newly versioned 4.0.2.1 version, which is in the 4.7.1 package we just ingested). The runtime pack has the same content as 3.1.2, and System.IO.Pipelines is versioned 4.0.2.1.

@dougbu @JunTaoLuo @ericstj anything else you'd like me to check on before merging?

@JunTaoLuo
Copy link
Contributor Author

:shipit:

@dougbu
Copy link
Contributor

dougbu commented Feb 20, 2020

:shipit:

Oh wait, who owns this now? I nominate @JunTaoLuo to do the final squash

@wtgodbe wtgodbe merged commit 042e642 into release/3.1 Feb 20, 2020
@wtgodbe wtgodbe deleted the johluo/always-the-ref-pack branch February 20, 2020 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants