Skip to content

Commit

Permalink
React to dotnet/runtime#47684, a new transport package (#30405)
Browse files Browse the repository at this point in the history
* React to dotnet/runtime#47684, a new transport package
  - handle Microsoft.Extensions.Internal.Transport -> 'Microsoft.AspNetCore.Internal.Transport name change
  - remove `$(...V0Version)` / `%(RTMVersion)` workarounds
  - remove mention of System.Security.AccessControl package; only need transitive references to that
  - confirm content of Microsoft.AspNetCore.Internal.Transport package
    - missing Microsoft.Extensions.DependencyModel assembly

* Remove unnecessary `using`s
  - namespace previously available due to Microsoft.Extensions.Internal.Transport dependency
  - no need for Microsoft.AspNetCore.Internal.Transport dependency

* nit: Clean up "Extensions" naming in Ref project

* Correct targeting pack content
  - intersection w/ `@(ExternalAspNetCoreAppReference)` items added nothing
  - excluded assemblies now included in transport package
  • Loading branch information
dougbu authored Feb 26, 2021
1 parent b090e91 commit 550bd15
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 128 deletions.
6 changes: 1 addition & 5 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ and are generated based on the last package release.
<LatestPackageReference Include="System.Reflection.Metadata" />
<LatestPackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<LatestPackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
<!-- System.Security.AccessControl should only be referenced in Dependencies.props and RepoTasks.csproj. -->
<LatestPackageReference Include="System.Security.AccessControl" />
<LatestPackageReference Include="System.Security.Cryptography.Cng" />
<LatestPackageReference Include="System.Security.Cryptography.Pkcs" />
<LatestPackageReference Include="System.Security.Cryptography.Xml" />
Expand Down Expand Up @@ -109,6 +107,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.5.0.x64" />
<LatestPackageReference Include="Microsoft.AspNetCore.AzureAppServices.SiteExtension.5.0.x86" />
<LatestPackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Runtime" />
<LatestPackageReference Include="Microsoft.AspNetCore.Internal.Transport" />
<LatestPackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Design" />
Expand All @@ -124,7 +123,6 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" />
<LatestPackageReference Include="Microsoft.IdentityModel.Protocols.WsFederation" />
<LatestPackageReference Include="Microsoft.Internal.AspNetCore.H2Spec.All" />
<LatestPackageReference Include="Microsoft.Extensions.Internal.Transport" />
<LatestPackageReference Include="Microsoft.NETCore.Windows.ApiSets" />
<LatestPackageReference Include="Microsoft.NETCore.BrowserDebugHost.Transport" />
<LatestPackageReference Include="Microsoft.Owin.Security.Cookies" />
Expand Down Expand Up @@ -202,10 +200,8 @@ and are generated based on the last package release.
<!-- Get versions. -->
<LatestPackageReference Update="@(LatestPackageReference)">
<Version>$(%(VersionName)Version)</Version>
<RTMVersion>$(%(VersionName)V0Version)</RTMVersion>

<!-- Remove excess metadata. -->
<RTMVersion Condition=" '%(Version)' == '%(RTMVersion)' " />
<VersionName />
</LatestPackageReference>

Expand Down
9 changes: 2 additions & 7 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>12ec2197ed3999c98f49c006a27ee761282df168</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Internal.Transport" Version="6.0.0-preview.2.21106.9">
<Dependency Name="Microsoft.AspNetCore.Internal.Transport" Version="6.0.0-preview.3.21125.3">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>afd1d33db716e185c6ef77af569db5cfc3ef183a</Sha>
<Sha>12ec2197ed3999c98f49c006a27ee761282df168</Sha>
</Dependency>
<Dependency Name="Microsoft.Win32.Registry" Version="6.0.0-preview.3.21125.3">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down Expand Up @@ -233,11 +233,6 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>12ec2197ed3999c98f49c006a27ee761282df168</Sha>
</Dependency>
<!-- System.Security.AccessControl should only be referenced in Dependencies.props and RTMVersions.csproj. -->
<Dependency Name="System.Security.AccessControl" Version="6.0.0-preview.3.21125.3">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>12ec2197ed3999c98f49c006a27ee761282df168</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.Cng" Version="6.0.0-preview.3.21125.3">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>12ec2197ed3999c98f49c006a27ee761282df168</Sha>
Expand Down
34 changes: 1 addition & 33 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<MicrosoftExtensionsOptionsDataAnnotationsVersion>6.0.0-preview.3.21125.3</MicrosoftExtensionsOptionsDataAnnotationsVersion>
<MicrosoftExtensionsOptionsVersion>6.0.0-preview.3.21125.3</MicrosoftExtensionsOptionsVersion>
<MicrosoftExtensionsPrimitivesVersion>6.0.0-preview.3.21125.3</MicrosoftExtensionsPrimitivesVersion>
<MicrosoftExtensionsInternalTransportVersion>6.0.0-preview.2.21106.9</MicrosoftExtensionsInternalTransportVersion>
<MicrosoftAspNetCoreInternalTransportVersion>6.0.0-preview.3.21125.3</MicrosoftAspNetCoreInternalTransportVersion>
<SystemComponentModelAnnotationsVersion>6.0.0-preview.3.21125.3</SystemComponentModelAnnotationsVersion>
<SystemDiagnosticsDiagnosticSourceVersion>6.0.0-preview.3.21125.3</SystemDiagnosticsDiagnosticSourceVersion>
<SystemDiagnosticsEventLogVersion>6.0.0-preview.3.21125.3</SystemDiagnosticsEventLogVersion>
Expand All @@ -119,8 +119,6 @@
<SystemReflectionMetadataVersion>6.0.0-preview.3.21125.3</SystemReflectionMetadataVersion>
<SystemResourcesExtensionsVersion>6.0.0-preview.3.21125.3</SystemResourcesExtensionsVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0-preview.3.21125.3</SystemRuntimeCompilerServicesUnsafeVersion>
<!-- System.Security.AccessControl should only be referenced in Dependencies.props and RepoTasks.csproj. -->
<SystemSecurityAccessControlVersion>6.0.0-preview.3.21125.3</SystemSecurityAccessControlVersion>
<SystemSecurityCryptographyCngVersion>6.0.0-preview.3.21125.3</SystemSecurityCryptographyCngVersion>
<SystemSecurityCryptographyPkcsVersion>6.0.0-preview.3.21125.3</SystemSecurityCryptographyPkcsVersion>
<SystemSecurityCryptographyXmlVersion>6.0.0-preview.3.21125.3</SystemSecurityCryptographyXmlVersion>
Expand Down Expand Up @@ -161,36 +159,6 @@
-->
<MicrosoftNETCoreAppRuntimeVersion>$(MicrosoftNETCoreAppRuntimewinx64Version)</MicrosoftNETCoreAppRuntimeVersion>
</PropertyGroup>
<!--
We ship ref/ assemblies for runtime packages in our targeting targeting pack. When servicing that targeting pack,
these assemblies must not change. Must also compile our assemblies against the initial ref/ assemblies for runtime
packages. But, need to test against the latest implementation assemblies and ship them in our shared framework.
Upshot is we need Major.Minor.0 runtime packages for compilation and the targeting pack and Major.Minor.Latest
runtime packages for everything else. This is not an issue for assemblies available in Microsoft.NETCore.App.Ref or
Microsoft.Extensions.Internal.Transport because it is next to impossible we would service those packages.
System.Security.AccessControl should only be referenced in Dependencies.props and RepoTasks.csproj. Because
it's a transitive reference, we reship the ref/ assembly in Microsoft.AspNetCore.App.Ref. dotnet/runtime ships
the implementation assemblies in Microsoft.NETCore.App.Runtime.* packages.
If testing this configuration prior to servicing, update the versions of dependencies too. E.g. change
`$(SystemSecurityPrincipalWindowsV0PackageVersion)` if you change `$(SystemSecurityAccessControlV0PackageVersion)`
because System.Security.AccessControl will otherwise be loadable. This should not be necessary in servicing.
-->
<PropertyGroup Condition=" '$(IsServicingBuild)' == 'true' ">
<MicrosoftWin32RegistryV0Version>$(MicrosoftWin32RegistryVersion.Split('.')[0]).$(MicrosoftWin32RegistryVersion.Split('.')[1]).0</MicrosoftWin32RegistryV0Version>
<MicrosoftWin32SystemEventsV0Version>$(MicrosoftWin32SystemEventsVersion.Split('.')[0]).$(MicrosoftWin32SystemEventsVersion.Split('.')[1]).0</MicrosoftWin32SystemEventsV0Version>
<SystemDiagnosticsEventLogV0Version>$(SystemDiagnosticsEventLogVersion.Split('.')[0]).$(SystemDiagnosticsEventLogVersion.Split('.')[1]).0</SystemDiagnosticsEventLogV0Version>
<SystemDrawingCommonV0Version>$(SystemDrawingCommonVersion.Split('.')[0]).$(SystemDrawingCommonVersion.Split('.')[1]).0</SystemDrawingCommonV0Version>
<SystemIOPipelinesV0Version>$(SystemIOPipelinesVersion.Split('.')[0]).$(SystemIOPipelinesVersion.Split('.')[1]).0</SystemIOPipelinesV0Version>
<SystemSecurityAccessControlV0Version>$(SystemSecurityAccessControlVersion.Split('.')[0]).$(SystemSecurityAccessControlVersion.Split('.')[1]).0</SystemSecurityAccessControlV0Version>
<SystemSecurityCryptographyCngV0Version>$(SystemSecurityCryptographyCngVersion.Split('.')[0]).$(SystemSecurityCryptographyCngVersion.Split('.')[1]).0</SystemSecurityCryptographyCngV0Version>
<SystemSecurityCryptographyPkcsV0Version>$(SystemSecurityCryptographyPkcsVersion.Split('.')[0]).$(SystemSecurityCryptographyPkcsVersion.Split('.')[1]).0</SystemSecurityCryptographyPkcsV0Version>
<SystemSecurityCryptographyXmlV0Version>$(SystemSecurityCryptographyXmlVersion.Split('.')[0]).$(SystemSecurityCryptographyXmlVersion.Split('.')[1]).0</SystemSecurityCryptographyXmlV0Version>
<SystemSecurityPermissionsV0Version>$(SystemSecurityPermissionsVersion.Split('.')[0]).$(SystemSecurityPermissionsVersion.Split('.')[1]).0</SystemSecurityPermissionsV0Version>
<SystemSecurityPrincipalWindowsV0Version>$(SystemSecurityPrincipalWindowsVersion.Split('.')[0]).$(SystemSecurityPrincipalWindowsVersion.Split('.')[1]).0</SystemSecurityPrincipalWindowsV0Version>
<SystemWindowsExtensionsV0Version>$(SystemWindowsExtensionsVersion.Split('.')[0]).$(SystemWindowsExtensionsVersion.Split('.')[1]).0</SystemWindowsExtensionsV0Version>
</PropertyGroup>
<PropertyGroup Label="Manual">
<!-- Packages from dotnet/roslyn -->
<MicrosoftNetCompilersToolsetVersion>3.8.0-5.20519.18</MicrosoftNetCompilersToolsetVersion>
Expand Down
51 changes: 6 additions & 45 deletions eng/targets/ResolveReferences.targets
Original file line number Diff line number Diff line change
Expand Up @@ -244,45 +244,6 @@
Text="Could not resolve this reference. Could not locate the package or project for &quot;%(Reference.Identity)&quot;. Did you update baselines and dependencies lists? See docs/ReferenceResolution.md for more details." />
</Target>

<!--
Change @(ResolvedCompileFileDefinitions) items between generation and use in order to compile against RTM lib/
or ref/ assemblies. The approach works for all TFMs because it happens after a specific assembly is chosen for
compilation; no need to restrict this to (say) the default TFM.
This target could get confused if the layout changes for one of the dozen special-cased packages during servicing.
E.g. ResolvePackageAssets picks a compatible assembly from the 5.0.1 package and _UseRTMReferenceAssemblies
changes the path to one not present in the 5.0.0 package. Fortunately, this will break the build with complaints
about the "invalid strong name".
-->
<Target Name="_UseRTMReferenceAssemblies"
Condition=" '$(MSBuildProjectName)' != 'RepoTasks' "
AfterTargets="ResolvePackageAssets"
BeforeTargets="GenerateBuildDependencyFile;GeneratePublishDependencyFile;ILLink;ResolveLockFileReferences"
DependsOnTargets="ResolvePackageAssets">
<Error Condition=" !EXISTS('$(RepoRoot)artifacts\obj\RepoTasks\RepoTasks.csproj.nuget.g.props') "
Text="The eng/tools/RepoTasks project must be restored before building other projects." />

<JoinItems Left="@(ResolvedCompileFileDefinitions)"
Right="@(LatestPackageReference->HasMetadata('RTMVersion'))"
LeftKey="Filename"
ItemSpecToUse="Left"
LeftMetadata="*"
RightMetadata="RTMVersion;Version">
<Output TaskParameter="JoinResult" ItemName="_ResolvedCompileFileDefinitionsToChange" />
</JoinItems>

<ItemGroup>
<ResolvedCompileFileDefinitions Remove="@(_ResolvedCompileFileDefinitionsToChange)" />

<!-- Ignore %(NuGetPackageVersion) when doing substitution because some projects use downlevel packages. -->
<_ResolvedCompileFileDefinitionsToChange
HintPath="$([System.String]::new('%(Identity)').Replace('\%(Version)\', '\%(RTMVersion)\').Replace('/%(Version)/', '/%(RTMVersion)/'))" />
<ResolvedCompileFileDefinitions Include="@(_ResolvedCompileFileDefinitionsToChange -> '%(HintPath)')" />

<_ResolvedCompileFileDefinitionsToChange Remove="@(_ResolvedCompileFileDefinitionsToChange)" />
</ItemGroup>
</Target>

<PropertyGroup>
<_CompileTfmUsingReferenceAssemblies>false</_CompileTfmUsingReferenceAssemblies>
<_CompileTfmUsingReferenceAssemblies
Expand All @@ -296,24 +257,24 @@
'$(MSBuildProjectName)' != 'RepoTasks' AND
($(_CompileTfmUsingReferenceAssemblies) OR
('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) ">
<PackageReference Include="Microsoft.Extensions.Internal.Transport"
Version="$(MicrosoftExtensionsInternalTransportVersion)"
<PackageReference Include="Microsoft.AspNetCore.Internal.Transport"
Version="$(MicrosoftAspNetCoreInternalTransportVersion)"
IsImplicitlyDefined="true"
IncludeAssets="Compile"
PrivateAssets="All"
GeneratePathProperty="true" />
</ItemGroup>

<!--
Remove compile-time assets for packages that overlap Microsoft.Extensions.Internal.Transport. Serviced packages
Remove compile-time assets for packages that overlap Microsoft.AspNetCore.Internal.Transport. Serviced packages
may otherwise increase the referenced version. Avoid this because change reduces compatible runtime versions.
That's not a big deal within the shared framework but can cause problems for shipped packages. Leave test
projects and Ignitor alone because they may transitively reference newer netstandard assemblies and need a
net5.0 assembly with the same version. (This can happen in implementation projects but is less likely.)
-->
<Target Name="RemoveExtensionsCompileAssets"
AfterTargets="ResolvePackageAssets"
Condition=" '$(PkgMicrosoft_Extensions_Internal_Transport)' != '' AND
Condition=" '$(PkgMicrosoft_AspNetCore_Internal_Transport)' != '' AND
'$(IsServicingBuild)' == 'true' AND
'$(IsImplementationProject)' == 'true' AND
'$(MSBuildProjectName)' != 'Ignitor' AND
Expand All @@ -322,8 +283,8 @@
('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref')) ">
<ItemGroup>
<ResolvedCompileFileDefinitions Remove="@(ResolvedCompileFileDefinitions)"
Condition=" '%(NuGetPackageId)' != 'Microsoft.Extensions.Internal.Transport' AND
EXISTS('$(PkgMicrosoft_Extensions_Internal_Transport)\ref\$(TargetFramework)\%(Filename).dll') AND
Condition=" '%(NuGetPackageId)' != 'Microsoft.AspNetCore.Internal.Transport' AND
EXISTS('$(PkgMicrosoft_AspNetCore_Internal_Transport)\ref\$(TargetFramework)\%(Filename).dll') AND
$([System.String]::new('%(Directory)').Contains('$(TargetFramework)')) " />
</ItemGroup>
</Target>
Expand Down
10 changes: 0 additions & 10 deletions eng/tools/RepoTasks/RepoTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@
<ItemGroup>
<PackageReference Include="NuGet.Packaging" Version="5.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />

<!--
Gather project references for compilation against RTM packages. %(RTMVersion) is set for about a dozen packages
in all servicing builds. Cannot reference two versions of a package, mandating this separation from projects
using the relevant packages.
-->
<PackageReference Include="@(LatestPackageReference->HasMetadata('RTMVersion'))"
IncludeAssets="None"
PrivateAssets="All"
Version="%(RTMVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Globalization;
using System.Linq;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.DependencyModel;
using Xunit;

namespace Microsoft.AspNetCore.Components.Test.Routing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyModel;
using Microsoft.Extensions.Logging;
using Microsoft.JSInterop;
using Microsoft.JSInterop.WebAssembly;
using Moq;
using Xunit;

Expand Down
Loading

0 comments on commit 550bd15

Please sign in to comment.