Skip to content

Conversation

@Anipik
Copy link
Contributor

@Anipik Anipik commented Sep 23, 2021

This step is being added as an extra precaution to avoid incrementing the assembly versions for assemblies in the ref pack.
We already automatically calculate it.

@ghost
Copy link

ghost commented Sep 23, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

This step is being added as an extra precaution to avoid incrementing the assembly versions for assemblies in the ref pack.
We already automatically calculate it.

Author: Anipik
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@Anipik
Copy link
Contributor Author

Anipik commented Sep 23, 2021

The failure be like this

C:\git\runtime\eng\packaging.targets(261,5): error : AssemblyVersion should match last released assembly version 6.0.0.0 
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:04.82

C:\git\runtime>dotnet build src\librarie

@safern
Copy link
Member

safern commented Sep 23, 2021

Maybe include the project on the error for easier diagnostic?

@Anipik
Copy link
Contributor Author

Anipik commented Sep 23, 2021

I think the error got trimmed. The eol contains the csproj name

C:\git\runtime\eng\packaging.targets(262,5): error : AssemblyVersion should match last released assembly version 6.0.0.0 [C:\git\runtime\src\libraries\System.Diagnostics.EventLog\src\System.Diagnostics.EventLog.csproj]

Co-authored-by: Viktor Hofer <[email protected]>
@Anipik
Copy link
Contributor Author

Anipik commented Sep 24, 2021

cc @safern @ViktorHofer can you approve this one.

@Anipik Anipik merged commit e52378b into dotnet:release/6.0 Sep 24, 2021
@Anipik
Copy link
Contributor Author

Anipik commented Sep 24, 2021

/backport to main

@github-actions
Copy link
Contributor

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

Choose a reason for hiding this comment

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

This only runs for source assemblies. I assume that is desired?

Copy link
Contributor Author

@Anipik Anipik Sep 27, 2021

Choose a reason for hiding this comment

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

yes we never change ref assembly versions. They are pinned.

Copy link
Member

Choose a reason for hiding this comment

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

I assumed this code piece prevents someone from overriding the assembly version. If that's the case, what happens when someone overrides the assembly version in a library's Directory.Build.props file? Wouldn't the ref assembly be overridden then as well?

Copy link
Member

Choose a reason for hiding this comment

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

I thought that _AssemblyInTargetingPack was only set to true on ref assemblies as Targeting Pack is the term for the ref pack and runtime pack for the package that carries the source assemblies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that's the case, what happens when someone overrides the assembly version in a library's Directory.Build.props file?

i hope to catch these in the code review. This was basically to test the automatic update of assembly version that we do for the source assembies

Copy link
Contributor Author

Choose a reason for hiding this comment

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

_AssemblyInTargetingPack is true for assemblies that in ref pack but we version source assemblies using this property. ref assemblies are always pinned.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@Anipik Anipik deleted the refAssemblyVersionCheck branch November 10, 2021 18:57
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.

3 participants