Skip to content
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

Port changes from 6.0 for future servicing releases into main #62469

Merged
merged 3 commits into from Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 18 additions & 5 deletions eng/packaging.targets
Expand Up @@ -22,19 +22,26 @@
'$(IsRIDSpecificProject)' == 'true') and
'$(PreReleaseVersionLabel)' != 'servicing' and
'$(GitHubRepositoryName)' != 'runtimelab'">true</GeneratePackageOnBuild>
<GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' != 'true'">false</GeneratePackageOnBuild>
<!-- Search for the documentation file in the intellisense package and otherwise pick up the generated one. -->
<LibIntellisenseDocumentationFilePath>$(XmlDocFileRoot)1033\$(AssemblyName).xml</LibIntellisenseDocumentationFilePath>
<UseIntellisenseDocumentationFile Condition="'$(UseIntellisenseDocumentationFile)' == '' and Exists('$(LibIntellisenseDocumentationFilePath)')">true</UseIntellisenseDocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(ServicingVersion)' != ''">
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing'">
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
be calculated propertly, if we don't set it to 0, we would get the dependency version using the
product Patch Version -->
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>

<!-- Always update the package version in servicing. -->
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</VersionPrefix>
<Version>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</Version>
<Version Condition="'$(VersionSuffix)' != ''">$(Version)-$(VersionSuffix)</Version>
Copy link
Member

Choose a reason for hiding this comment

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

Weren't this things set in arcade before?

Copy link
Member

Choose a reason for hiding this comment

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

oh, but we are changing the default since we are using the servicing version, makes sense. I'd probably say ideally we should have that in arcade too as that also makes sense for other repos, but I'm fine with keeping as is on this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that'd make sense, but I believe other repos don't follow what we do, which is just ship the packages we service, from my understanding other repos ship all the OOB packages, so then this would no longer make sense on arcade.

cc: @mmitche for thoughts.

Copy link
Member

Choose a reason for hiding this comment

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

These are set by arcade in typical scenarios. This may have been related to pkgproj files, which are runtime/mono specific? IIRC the runtime repo had some non-standard behavior that required this be added during the servicing exercise. @Anipik for context.

Copy link
Member Author

@safern safern Dec 8, 2021

Choose a reason for hiding this comment

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

Yes the reason why we needed to add them is because of the way we calculate the package dependencies and because we don't build all packages as part of the build so the version is different for every package we build. In other repos the versions is always Major.Minor.Patch, no matter if the package has fixes or not, so for us we introduced a ServicingVersion which is set individually on every serviced package and then the version is Major.Minor.ServicingVersion. This is specific to the libraries partition as the rest of the repo service all the packages on every build.

<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
<_AssemblyInTargetingPack Condition="'$(IsNETCoreAppSrc)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true'">true</_AssemblyInTargetingPack>
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
<!-- Assembly version do not get updated in non-netfx ref pack assemblies. -->
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true' or '$(TargetFrameworkIdentifier)' == '.NETFramework'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
</PropertyGroup>

<ItemGroup Condition="'$(EnablePackageValidation)' == 'true'">
Expand Down Expand Up @@ -246,9 +253,15 @@
</Target>

<Target Name="ValidateAssemblyVersionsInRefPack"
Condition="$(_AssemblyInTargetingPack) == 'true' and '$(PreReleaseVersionLabel)' == 'servicing'"
Condition="'$(SkipValidateAssemblyVersion)' != 'true' and '$(_AssemblyInTargetingPack)' == 'true' and '$(PreReleaseVersionLabel)' == 'servicing'"
AfterTargets="CoreCompile" >
<Error Condition="'$(AssemblyVersion)' != '$(LastReleasedStableAssemblyVersion)'" Text="AssemblyVersion should match last released assembly version $(LastReleasedStableAssemblyVersion)" />
</Target>

<Target Name="ValidateServicingVersionIsPropertlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing'"
AfterTargets="GenerateNuspec">
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
</Target>

</Project>
3 changes: 3 additions & 0 deletions src/libraries/System.DirectoryServices/Directory.Build.props
Expand Up @@ -5,6 +5,9 @@
plan on shipping a new desktop version out of band. Instead add API
to a different assembly. -->
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<!-- Since this assembly version is pinned, we don't want to validate that it matches
the expected assembly version on the targeting pack. -->
<SkipValidateAssemblyVersion>true</SkipValidateAssemblyVersion>
safern marked this conversation as resolved.
Show resolved Hide resolved
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<SupportedOSPlatforms>windows</SupportedOSPlatforms>
</PropertyGroup>
Expand Down