Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make theAssemblyVersion does not change for servicing releases#24667

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
daxian-dbw merged 4 commits intoPowerShell:masterfromdaxian-dbw:assembly_version
Jan 8, 2025

Conversation

daxian-dbw
Copy link
Member

@daxian-dbwdaxian-dbw commentedDec 12, 2024
edited
Loading

PR Context

Make theAssemblyVersion does not change for servicing releases.

Today, theAssemblyVersion of the PowerShell assemblies keeps changing when there is a new servicing release, for example, for PowerShell v7.4.3, theAssemblyVersion is7.4.3.500, and for PowerShell v7.4.4, it becomes7.4.4.500. Accordingly, theAssemblyVersion of the reference assembly from the NUGET packages released from each servicing release also keeps changing.

This causes a problem: for a module that depends on PowerShell 7+ NUGET packages, every time it moves to a newer version of NUGET package, it would require a higher version of PowerShell to work. For example, when a module is built against the v7.4.4 of theSystem.Management.Automation NUGET package, the user would need to have PowerShell v7.4.4 or higher to use the module.

However, in most cases, we need to update the dependency of a module only due to the compliance requirements -- you need to use the most recent version of a NUGET package when it's available, but the module itself doesn't have any security issue and should work just fine on any v7.4.x PowerShell. Requiring the user to always on the latest PowerShell to use a module is unnecessary.

.NET keeps theAssemblyVersion of their framework assemblies unchanged for servicing releases (8.0.0.0 forSystem.Private.CoreLib.dll orSystem.Threading.Thread.dll for .NET 8.0.10), and so should we. This PR updates the build a bit to make theAssemblyVerseion of PowerShell assemblies unchanged for servicing releases, so that moving to a newer version of NUGET package to build a module doesn't require a higher version of PowerShell for the module to work.

PR Summary

Explicitly set theFileVersion andAssemblyVersion properties when the release tag is passed in.FileVersion is kept the same asPSCoreFileVersion like before, andAssemblyVersion is set to bePSCoreFileVersion with theBuild field setting to 0.

BREAKING CHANGE

This will be a breaking change if we back port the change to PowerShell 7.4.
A module or an application that is built targeting an existing 7.4.x PowerShell NUGET package will not work with a new servicing release after porting this change to 7.4, because the newAssemblyVersion will become7.4.0.500 but the module/application depends on7.4.4.500 for example, which is higher.
However, we can make it non-breaking to 7.4 by change theBuild field to500 (for example) when backporting to 7.4.

This isNOT a breaking change for 7.6 preview or for back porting to PowerShell 7.5.

Build Validation

Coordinated package build:https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=550558&view=results
Packages pipeline:https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=550722&view=results

The build branch name isrelease/v7.4.9, and theAssemblyVersion of PowerShell assemblies is7.4.0.500, and the reference assembly produced in the nupkg build step also hasAssemblyVersion to be7.4.0.500

PR Checklist

@daxian-dbwdaxian-dbw removed the request for review fromanmenagaDecember 12, 2024 20:27
@daxian-dbwdaxian-dbw added BackPort-7.5.x-Done BackPort-7.5.x-Consider CL-BuildPackagingIndicates that a PR should be marked as a build or packaging change in the Change Log and removed BackPort-7.5.x-Done labelsDec 12, 2024
@daxian-dbwdaxian-dbw self-assigned thisDec 12, 2024
- make 'FileVersion' the same as 'PSCoreFileVersion'
- make 'AssemblyVersion' be the 'PSCoreFileVersion' with the 'Build' field set to 0, so the assembly version doesn't change for servicing releases -->
<FileVersion>$(PSCoreFileVersion)</FileVersion>
<AssemblyVersion>$([System.Version]::Parse($(PSCoreFileVersion)).Major).$([System.Version]::Parse($(PSCoreFileVersion)).Minor).0.$([System.Version]::Parse($(PSCoreFileVersion)).Revision)</AssemblyVersion>
Copy link
Collaborator

Choose a reason for hiding this comment

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

After a number of changes, this code has become somewhat confusing.
If now we have to manually construct version strings maybe simplify the code?
Below there is my commented-out code for version parts. We could move it on top and construct versions strings in more clear ways.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So far, we only need special case theAssemblyVersion. Other version properties are the same as before.

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Review - NeededThe PR is being reviewed labelDec 20, 2024
@TravisEz13TravisEz13 added CL-BreakingChangeIndicates that a PR should be marked as a breaking change in the Change Log and removed CL-BreakingChangeIndicates that a PR should be marked as a breaking change in the Change Log labelsJan 8, 2025
@microsoft-github-policy-servicemicrosoft-github-policy-servicebot removed the Review - NeededThe PR is being reviewed labelJan 8, 2025
@daxian-dbwdaxian-dbw merged commite051748 intoPowerShell:masterJan 8, 2025
43 of 45 checks passed
@daxian-dbwdaxian-dbw deleted the assembly_version branchJanuary 8, 2025 19:47
@microsoft-github-policy-serviceMicrosoft GitHub Policy Service
Copy link
Contributor

microsoft-github-policy-servicebot commentedJan 8, 2025
edited by unfurl-linksbot
Loading

📣 Hey@daxian-dbw, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗https://aka.ms/PSRepoFeedback

@TravisEz13
Copy link
Member

TravisEz13 commentedJan 14, 2025
edited
Loading

@PowerShell/powershell-maintainers There is no value in waiting for testing is 7.6 preview. Taking for servicing.

Dongbo will create PR for 7.4 to deal with existing releases.

Standard back-port process can be used for 7.5.

TravisEz13 added a commit that referenced this pull requestJan 15, 2025
@jshigetomijshigetomi mentioned this pull requestJan 17, 2025
21 tasks
daxian-dbw added a commit to daxian-dbw/PowerShell that referenced this pull requestJan 18, 2025
TravisEz13 added a commit that referenced this pull requestJan 18, 2025
…leases 7.4.7 and onward (#24821)* Make the `AssemblyVersion` not change for servicing releases (#24667)* Keep `AssemblyVersion` unchanged for servicing releases 7.4.7 and plus---------Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iSazonoviSazonoviSazonov left review comments

@adityapatwardhanadityapatwardhanadityapatwardhan approved these changes

@TravisEz13TravisEz13Awaiting requested review from TravisEz13

Assignees

@daxian-dbwdaxian-dbw

Labels
BackPort-7.4.x-DoneBackPort-7.5.x-DoneCL-BuildPackagingIndicates that a PR should be marked as a build or packaging change in the Change Log
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@daxian-dbw@TravisEz13@adityapatwardhan@iSazonov

[8]ページ先頭

©2009-2025 Movatter.jp