Skip to content

Commit

Permalink
[0.72] Bump minimum VS version to 17.11.0 (#13585)
Browse files Browse the repository at this point in the history
This PR backports #13455 to 0.72.

## Description

This PR bumps the minimum version of VS that RNW expects to 17.11.0.

### Type of Change
- Bug fix (non-breaking change which fixes an issue)

### Why
To make sure users don't use the regressed builds of VS 2022.

Resolves #13339
Resolves #13374

### What
Bumped VS version checks for `run-windows` and `rnw-dependencies.ps1`. Updated ADO image to reflect updated images are no longer locked to VS v17.9.4.

## Screenshots
N/A

## Testing
`run-windows` now works with 17.11.0.

## Changelog
Should this change be included in the release notes: _yes_

Require Visual Studio 2022 >= v17.11.0
  • Loading branch information
jonthysell committed Aug 20, 2024
1 parent 74f506e commit becc1d3
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .ado/templates/react-native-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ steps:
displayName: Create bundle testcli
workingDirectory: $(Agent.BuildDirectory)\testcli

- ${{ if eq(parameters.runWack, true) }}:
# Temporarily disabling due to spurious failures in CI, see https://github.com/microsoft/react-native-windows/issues/13578
- ${{ if and(false, eq(parameters.runWack, true)) }}:
- template: ../templates/run-wack.yml
parameters:
packageName: ReactNative.InitTest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "[0.72] Bump minimum VS version to 17.11.0",
"packageName": "@react-native-windows/cli",
"email": "jthysell@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "[0.72] Bump minimum VS version to 17.11.0",
"packageName": "react-native-windows",
"email": "jthysell@microsoft.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion packages/@react-native-windows/cli/src/healthCheckList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const HealthCheckList = [
[true, "WindowsVersion", "Windows version >= 10.0.17763.0"],
[true, "DeveloperMode", "Developer mode is on"],
[true, "LongPath", "Long path support is enabled"],
[true, "VSUWP", "Visual Studio 2022 (>= 17.3) & req. components"],
[true, "VSUWP", "Visual Studio 2022 (>= 17.11.0) & req. components"],
[true, "Node", "Node.js (LTS, >= 16.0)"],
[true, "Yarn", "Yarn"],
[true, "DotNetCore", ".NET SDK (LTS, = 6.0)"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ export default class MSBuildTools {
'Microsoft.Component.MSBuild',
getVCToolsByArch(buildArch),
];
const minVersion = process.env.VisualStudioVersion || '17.0';
const minVersion =
process.env.MinimumVisualStudioVersion ||
process.env.MinimumVisualStudioVersion ||
process.env.VisualStudioVersion ||
'17.11.0';
const vsInstallation = findLatestVsInstall({
requires,
minVersion,
Expand All @@ -209,7 +213,16 @@ export default class MSBuildTools {
});

if (!vsInstallation) {
if (process.env.VisualStudioVersion != null) {
if (process.env.MinimumVisualStudioVersion != null) {
throw new CodedError(
'NoMSBuild',
`MSBuild tools not found for version ${process.env.MinimumVisualStudioVersion} (from environment). Make sure all required components have been installed`,
{
MinimumVisualStudioVersionFromEnv:
process.env.MinimumVisualStudioVersion,
},
);
} else if (process.env.VisualStudioVersion != null) {
throw new CodedError(
'NoMSBuild',
`MSBuild tools not found for version ${process.env.VisualStudioVersion} (from environment). Make sure all required components have been installed`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ export function enumerateVsInstalls(opts: {

if (minVersionSemVer) {
minVersion = minVersionSemVer.toString();
maxVersion = (minVersionSemVer.major + 1).toFixed(1);
maxVersion = `${minVersionSemVer.major + 1}.0`;
} else if (!Number.isNaN(minVersionNum)) {
minVersion = minVersionNum.toFixed(1);
maxVersion = (Math.floor(minVersionNum) + 1).toFixed(1);
minVersion = Number.isInteger(minVersionNum)
? `${minVersionNum}.0`
: minVersionNum.toString();
maxVersion = `${Math.floor(minVersionNum) + 1}.0`;
} else {
// Unable to parse minVersion and determine maxVersion,
// caller will throw error that version couldn't be found.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
<JsBundleEntry Include="..\Microsoft.ReactNative.IntegrationTests\ReactNativeHostTests.js" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="boost" Version="1.76.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<Midl Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\RedBoxHandler.idl" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.4" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="boost" Version="1.76.0.0" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
Expand Down
2 changes: 1 addition & 1 deletion vnext/Mso.UnitTests/Mso.UnitTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<None Include="future\futureTest.tt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion vnext/ReactCommon.UnitTests/ReactCommon.UnitTests.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<PackageReference Include="boost" Version="1.76.0.0" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.4" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion vnext/Scripts/rnw-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ $vsWorkloads = @('Microsoft.VisualStudio.Workload.ManagedDesktop',
$vsAll = ($vsComponents + $vsWorkloads);

# The minimum VS version to check for
$vsver = "17.3";
# Note: For install to work, whatever min version you specify here must be met by the current package available on choco.
# I.E. Do NOT specify a Preview version here because choco doesn't have VS Preview packages.
$vsver = "17.11.0";

# The exact .NET SDK version to check for
$dotnetver = "6.0";
Expand Down

0 comments on commit becc1d3

Please sign in to comment.