winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ce6d0d57a85692045aed56bc1747e42ceaeacdd2
parent 1b24d12bf6b1360cb47e07dfdbf2910ecc678e5f
Author: yao-msft <50888816+yao-msft@users.noreply.github.com>
Date:   Mon, 19 May 2025 12:14:36 -0700

Fix debug build with latest VS version (#5461)

The u8"" string literal causes a new compiler warning 5321 with latest
update, disable it in the project level.

Also updated fuzzing path, again.

Diffstat:
M.github/actions/spelling/expect.txt | 1+
Msrc/AppInstallerCLI.sln | 14+++++++-------
Msrc/AppInstallerCLICore/AppInstallerCLICore.vcxproj | 4++--
Msrc/AppInstallerCLITests/AppInstallerCLITests.vcxproj | 4++--
Msrc/AppInstallerCLITests/Dependencies.cpp | 6+++---
Msrc/AppInstallerCLITests/TestRestRequestHandler.cpp | 5++---
Msrc/AppInstallerCommonCore/Authentication/WebAccountManagerAuthenticator.cpp | 11+++++++++--
Msrc/Microsoft.Management.Deployment/PackageManager.cpp | 5++---
Msrc/WinGetYamlFuzzing/OneFuzzConfig.json | 2+-
9 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt @@ -116,6 +116,7 @@ Dcom debian decompressor dedupe +DEFT deigh deleteifnotneeded deliveryoptimization diff --git a/src/AppInstallerCLI.sln b/src/AppInstallerCLI.sln @@ -606,23 +606,23 @@ Global {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|ARM64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|x64.ActiveCfg = Release|Any CPU {846FB88B-BF1B-4F33-9883-E589CEC99739}.TestRelease|x86.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|ARM64.ActiveCfg = Debug|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x64.ActiveCfg = Debug|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x64.Build.0 = Debug|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x86.ActiveCfg = Debug|x86 {68808357-902B-406C-8C19-E8E26A69DE8A}.Debug|x86.Build.0 = Debug|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|ARM64.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|x64.ActiveCfg = Release|Any CPU + {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|ARM64.ActiveCfg = Release|x64 + {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Fuzzing|x86.ActiveCfg = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|ARM64.ActiveCfg = Release|ARM64 + {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|ARM64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x64.Build.0 = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x86.ActiveCfg = Release|x86 {68808357-902B-406C-8C19-E8E26A69DE8A}.Release|x86.Build.0 = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|ARM64.ActiveCfg = Release|Any CPU - {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|x64.ActiveCfg = Release|Any CPU + {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|ARM64.ActiveCfg = Release|x64 + {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.ReleaseStatic|x86.ActiveCfg = Release|x86 - {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|ARM64.ActiveCfg = Release|ARM64 + {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|ARM64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|x64.ActiveCfg = Release|x64 {68808357-902B-406C-8C19-E8E26A69DE8A}.TestRelease|x86.ActiveCfg = Release|x86 {2046B5AF-666D-4CE8-8D3E-C32C57908A56}.Debug|ARM64.ActiveCfg = Debug|ARM64 diff --git a/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj b/src/AppInstallerCLICore/AppInstallerCLICore.vcxproj @@ -176,6 +176,7 @@ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile> <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>Level4</WarningLevel> + <DisableSpecificWarnings>5321;%(DisableSpecificWarnings)</DisableSpecificWarnings> <AdditionalOptions>%(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING</AdditionalOptions> </ClCompile> </ItemDefinitionGroup> @@ -498,4 +499,4 @@ <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorTextNuget)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props'))" /> <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorTextNuget)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets'))" /> </Target> -</Project>- \ No newline at end of file +</Project> diff --git a/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj b/src/AppInstallerCLITests/AppInstallerCLITests.vcxproj @@ -116,6 +116,7 @@ <PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile> <PreprocessorDefinitions>_CONSOLE;WIN32_LEAN_AND_MEAN;WINRT_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>Level4</WarningLevel> + <DisableSpecificWarnings>5321;%(DisableSpecificWarnings)</DisableSpecificWarnings> <AdditionalOptions>%(AdditionalOptions) /permissive- /bigobj /D _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING</AdditionalOptions> </ClCompile> </ItemDefinitionGroup> @@ -1054,4 +1055,4 @@ <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.props'))" /> <Error Condition="!Exists('$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\Microsoft.Windows.CppWinRT.2.0.230706.1\build\native\Microsoft.Windows.CppWinRT.targets'))" /> </Target> -</Project>- \ No newline at end of file +</Project> diff --git a/src/AppInstallerCLITests/Dependencies.cpp b/src/AppInstallerCLITests/Dependencies.cpp @@ -38,7 +38,7 @@ TEST_CASE("DependencyGraph_BFirst", "[dependencyGraph][dependencies]") DependencyList rootDependencies; std::for_each(installers.begin(), installers.end(), [&](ManifestInstaller installer) { rootDependencies.Add(installer.Dependencies); }); - DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency node) + DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency) { DependencyList dependencyList; auto dependencyManifest = CreateFakeManifestWithDependencies(manifest.Id); @@ -72,7 +72,7 @@ TEST_CASE("DependencyGraph_InStackNoLoop", "[dependencyGraph][dependencies]") DependencyList rootDependencies; std::for_each(installers.begin(), installers.end(), [&](ManifestInstaller installer) { rootDependencies.Add(installer.Dependencies); }); - DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency node) + DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency) { DependencyList dependencyList; auto dependencyManifest = CreateFakeManifestWithDependencies(manifest.Id); @@ -106,7 +106,7 @@ TEST_CASE("DependencyGraph_EasyToSeeLoop", "[dependencyGraph][dependencies]") DependencyList rootDependencies; std::for_each(installers.begin(), installers.end(), [&](ManifestInstaller installer) { rootDependencies.Add(installer.Dependencies); }); - DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency node) { + DependencyGraph graph(rootAsDependency, rootDependencies, [&](Dependency) { DependencyList dependencyList; auto dependencyManifest = CreateFakeManifestWithDependencies(manifest.Id); diff --git a/src/AppInstallerCLITests/TestRestRequestHandler.cpp b/src/AppInstallerCLITests/TestRestRequestHandler.cpp @@ -9,7 +9,7 @@ std::shared_ptr<TestRestRequestHandler> GetTestRestRequestHandler( const web::http::status_code statusCode, const utility::string_t& sampleResponseString, const utility::string_t& mimeType) { - return std::make_shared<TestRestRequestHandler>([statusCode, sampleResponseString, mimeType](web::http::http_request request) -> + return std::make_shared<TestRestRequestHandler>([statusCode, sampleResponseString, mimeType](web::http::http_request) -> pplx::task<web::http::http_response> { web::http::http_response response; @@ -68,4 +68,4 @@ std::shared_ptr<TestRestRequestHandler> GetHeaderVerificationHandler( response.set_status_code(statusCode); return pplx::task_from_result(response); }); -}- \ No newline at end of file +} diff --git a/src/AppInstallerCommonCore/Authentication/WebAccountManagerAuthenticator.cpp b/src/AppInstallerCommonCore/Authentication/WebAccountManagerAuthenticator.cpp @@ -219,8 +219,15 @@ namespace AppInstaller::Authentication AICLI_LOG(Core, Error, << "CreateTokenRequest returned empty request"); return {}; } - - return HandleGetTokenResult(WebAuthenticationCoreManager::GetTokenSilentlyAsync(request).get()); + + if (webAccount) + { + return HandleGetTokenResult(WebAuthenticationCoreManager::GetTokenSilentlyAsync(request, webAccount).get()); + } + else + { + return HandleGetTokenResult(WebAuthenticationCoreManager::GetTokenSilentlyAsync(request).get()); + } } AuthenticationResult WebAccountManagerAuthenticator::HandleGetTokenResult(WebTokenRequestResult requestResult) diff --git a/src/Microsoft.Management.Deployment/PackageManager.cpp b/src/Microsoft.Management.Deployment/PackageManager.cpp @@ -898,8 +898,7 @@ namespace winrt::Microsoft::Management::Deployment::implementation std::unique_ptr<Execution::OrchestratorQueueItem> CreateQueueItemForRepair( std::unique_ptr<::AppInstaller::CLI::Execution::COMContext> comContext, - winrt::Microsoft::Management::Deployment::CatalogPackage package, - winrt::Microsoft::Management::Deployment::RepairOptions options) + winrt::Microsoft::Management::Deployment::CatalogPackage package) { // Add installed version AddInstalledVersionToContext(package.InstalledVersion(), comContext.get()); @@ -956,7 +955,7 @@ namespace winrt::Microsoft::Management::Deployment::implementation } else if constexpr (std::is_same_v<TOptions, winrt::Microsoft::Management::Deployment::RepairOptions>) { - queueItem = CreateQueueItemForRepair(std::move(comContext), package, options); + queueItem = CreateQueueItemForRepair(std::move(comContext), package); } Execution::ContextOrchestrator::Instance().EnqueueAndRunItem(queueItem); diff --git a/src/WinGetYamlFuzzing/OneFuzzConfig.json b/src/WinGetYamlFuzzing/OneFuzzConfig.json @@ -24,7 +24,7 @@ "Org": "microsoft", "Project": "OS", "AssignedTo": "ranm@microsoft.com", - "AreaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\InstaDev", + "AreaPath": "OS\\Windows Client and Services\\WinPD\\DFX-Developer Fundamentals and Experiences\\DEFT\\InstaDev", "IterationPath": "OS" }, "codeCoverage": {