Skip to content

Pin assembly versions to prevent revving those in servicing releases - #6667

Merged
RussKie merged 1 commit into
dotnet:release/6.0from
RussKie:pin_versions
Feb 15, 2022
Merged

RussKie merged 1 commit into
dotnet:release/6.0from
RussKie:pin_versions

Conversation

@RussKie

@RussKie RussKie commented Feb 10, 2022 •

Copy link
Copy Markdown
Contributor

Resolves #6663

Proposed changes

Reasons:

  • If we revert to the version number 6.0.0, then all DLLs built using the 6.0.2 reference assemblies will be broken. I don't think there would be any other workaround besides rebuilding, so any NuGet packages published like this would be irreversibly broken and would need to be updated.
  • If we leave the version number at 6.0.2, there is a workaround that lets you build an app or library that can run on 6.0.0 or 6.0.1, documented here: Issue building with Windows Desktop 6.0.2 core#7176
  • Whichever change we make, it won't be until next month's release, so by then a lot more of the runtimes should have been updated to at least 6.0.2 anyway.

So that's some of the reasoning behind why we think the least bad thing to do is to probably leave the version numbers at 6.0.2.

Customer Impact

Currently Windows Forms applications built against 6.0.2 won't run on 6.0 GA or 6.0.1
With the fix applications, libraries or NuGets built against 6.0.2 or later can work. Any applications built on 6.0.2 or later that need to target 6.0.0 or 6.0.1 will need to use the workaround provided in dotnet/core#7176. It is not ideal, but is believed to have a lesser impact than going back to 6.0.0.0 versions, and have 6.0.2 broken.

Regression?

  • Yes

Risk

  • Medium. With this fix we'll stop supporting the folks that compiled against 6.0.2 or later and target 6.0.0 or 6.0.1 without the workaround.
    In general, since 6.0.1 and 6.0.2 are security releases, customers are encouraged to update to the latest version.

Screenshots

Before

6.0.1
image
image

6.0.2
image
image

After

A private built for this fix:
image
image
image

Microsoft Reviewers: Open in CodeFlow

@RussKie RussKie added the servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria label Feb 10, 2022
@RussKie RussKie added this to the 6.0.3 milestone Feb 10, 2022
@RussKie
RussKie requested a review from a team as a code owner February 10, 2022 01:31
@RussKie RussKie self-assigned this Feb 10, 2022
@RussKie
RussKie requested a review from ericstj February 10, 2022 01:31
Comment thread eng/Versions.props Outdated
<VersionPrefix>$(MajorVersion).$(MinorVersion).$(PatchVersion)</VersionPrefix>
<!-- Set assembly version to align with major and minor version,
as for the patches and revisions should be manually updated per assembly if it is serviced. -->
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>

@ericstj ericstj Feb 10, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that this will be a downgrade from 6.0.2 and will make it so applications/libraries compiled against the 6.0.2 ref pack will fail to run on this version.

if you had a way to only do this to reference assemblies that would be less breaking in servicing.

@ericstj ericstj Feb 10, 2022 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, if you build any components that aren't exposed as references in the targeting pack those should rev so that they can exist side-by-side. In particular analyzers/generators -- the compiler relies on different version to change assembly version for caching purposes. dotnet/runtime#58836. MSBuild tasks might have a similar requirement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you.
I update the logic and added a validation step when we run packaging to verify that the assemblies we package into the transport package are correctly versioned.

Comment thread Directory.Build.targets Resolved
@RussKie

RussKie commented Feb 11, 2022

Copy link
Copy Markdown
Contributor Author

@RussKie

RussKie commented Feb 11, 2022

Copy link
Copy Markdown
Contributor Author

I've spoken with @dsplaisted, and determined that we should lock at 6.0.2.0 so that any applications, libraries or NuGets built against 6.0.2 or later can work. Any applications built on 6.0.2 or later that need to target 6.0.0 or 6.0.1 will need to use the workaround provided in dotnet/core#7176. It is not ideal, but is believed to have a lesser impact than going back to 6.0.0.0 versions, and have 6.0.2 broken.
In general, since 6.0.1 and 6.0.2 are security releases, customers are encouraged to update to the latest version.

Comment thread Directory.Build.props Outdated
those issues can be mitigated with a workaround described in https://github.com/dotnet/core/issues/7176.
-->
<PropertyGroup Condition="'$(IsAnalyzerProject)' != 'true'">
<AssemblyVersion>$(MajorVersion).$(MinorVersion).2.0</AssemblyVersion>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We only want to use the .2 patch for 6.0... for 7.0 and onwards the ref assemblies should use the .0 patch.

Suggested change
<AssemblyVersion>$(MajorVersion).$(MinorVersion).2.0</AssemblyVersion>
<AssemblyVersion>$(MajorVersion).$(MinorVersion).0.0</AssemblyVersion>
<AssemblyVersion Condition="'$(MajorVersion).$(MinorVersion)' == '6.0'">6.0.2.0</AssemblyVersion>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a 6.0 branch. For the 7.0 branch it is locked at Major.Minor.0.0, see #6668.
Is there a situation where you expect 6.0 spill into another branch?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In our repos we merge changes forward. If you don't do that it should be fine, but if that's the case it might as well just be hardcoded to 6.0.2.0 instead of $(MajorVersion).$(MinorVersion).2.0.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We never merge forward, and always do dual check ins for the release branches.
I'll burn 6.0.2.0 in.

@RussKie RussKie added servicing-approved .NET Shiproom approved the PR for merge servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria and removed servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria labels Feb 15, 2022
@RussKie

RussKie commented Feb 15, 2022

Copy link
Copy Markdown
Contributor Author

Approved over the email

@RussKie RussKie removed the servicing-consider .NET Shiproom label indicating a PR seeks to enter into a branch under Tell-Mode criteria label Feb 15, 2022
@RussKie
RussKie merged commit f7295a4 into dotnet:release/6.0 Feb 15, 2022
@RussKie
RussKie deleted the pin_versions branch February 15, 2022 05:51
@ghost ghost locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Infrastructure servicing-approved .NET Shiproom approved the PR for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants