[release/v7.5] Fix build to only enable ready-to-run for the Release configuration#26795
Conversation
There was a problem hiding this comment.
Pull request overview
Backport to release/v7.5 intended to ensure ReadyToRun is only enabled for Release builds (so Debug builds remain debuggable), by adding configuration-conditional MSBuild properties in PowerShell.Common.props.
Changes:
- Add
PublishReadyToRun/PublishReadyToRunEmitSymbolsproperty groups conditioned on$(Configuration) == 'Release'forFxDependentDeploymentandSelfContaineddeployments. - Adjust whitespace/formatting near the end of
PowerShell.Common.props.
| <PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' And '$(Configuration)' == 'Release' "> | ||
| <PublishReadyToRun>true</PublishReadyToRun> | ||
| <PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols> | ||
| >>>>>>> b0507ca4c (Fix build to only enable ready-to-run for the Release configuration (#26290)) |
There was a problem hiding this comment.
There is an unresolved merge conflict marker (>>>>>>> ...) in the file, which makes the MSBuild props invalid XML and will break builds. Resolve the conflict and remove the marker, keeping only the intended PropertyGroup block(s).
| >>>>>>> b0507ca4c (Fix build to only enable ready-to-run for the Release configuration (#26290)) |
| </PropertyGroup> | ||
|
|
||
| <!-- Enable ready-to-run only for Release configuration --> | ||
| <PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' And '$(Configuration)' == 'Release' "> | ||
| <PublishReadyToRun>true</PublishReadyToRun> | ||
| <PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols> | ||
| >>>>>>> b0507ca4c (Fix build to only enable ready-to-run for the Release configuration (#26290)) | ||
| </PropertyGroup> | ||
|
|
There was a problem hiding this comment.
This stray </PropertyGroup> appears without a matching opening tag in the surrounding context, which will also invalidate the props file. After resolving the conflict, ensure all <PropertyGroup> elements are properly balanced and nested.
| </PropertyGroup> | |
| <!-- Enable ready-to-run only for Release configuration --> | |
| <PropertyGroup Condition=" '$(AppDeployment)' == 'SelfContained' And '$(Configuration)' == 'Release' "> | |
| <PublishReadyToRun>true</PublishReadyToRun> | |
| <PublishReadyToRunEmitSymbols>true</PublishReadyToRunEmitSymbols> | |
| >>>>>>> b0507ca4c (Fix build to only enable ready-to-run for the Release configuration (#26290)) | |
| </PropertyGroup> |
Backport of #26290 to release/v7.5
Triggered by @daxian-dbw on behalf of @daxian-dbw
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Customer Impact
Issue found internally during development - ready-to-run was being enabled even for Debug configuration, making it impossible to debug code.
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The fix was tested by building PowerShell in Debug configuration and verifying that ready-to-run is not enabled, allowing proper debugging. Release builds continue to have ready-to-run enabled.
Risk
REQUIRED: Check exactly one box.
This change adds proper configuration conditions to only enable ready-to-run for Release builds, while leaving Debug builds unchanged. This makes debugging possible again without affecting release builds.
Merge Conflicts
Resolved conflict in PowerShell.Common.props by accepting the new structure that conditionally enables ready-to-run only for Release configuration.