Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 bootstrapper #18241

Merged
merged 12 commits into from
May 13, 2022
Merged

Arm64 bootstrapper #18241

merged 12 commits into from
May 13, 2022

Conversation

yuyoyuppe
Copy link
Contributor

@yuyoyuppe yuyoyuppe commented May 12, 2022

Summary of the Pull Request

What is this about:
This PR is a first part of adding the arm64 support for bootstrapper. Known issues:

  • wix doesn't have arm platform -> using x86 instead, resulting in wrong default installation dir and inability to detect dotnet 605
  • current winappsdk 1.0.3 installer is corrupted -> contains x64 packages
  • we're still using hardcoded vcredist for some modules -> coming as a separate PR

What is included in the PR:

  • PowerToys.sln configuration cleanup
  • PowerToysSetup.sln configuration cleanup
  • conditional packages for bootstrapper
  • update to dotnet 6.0.5

How does someone test / validate:

  • comment WindowsAppRuntimeInstall ExePackage, since currently it fails to install
  • build installer and bootstrapper
  • add arm64 configuration for StylesReportTool

Quality Checklist

  • Linked issue: Support ARM platform #490
  • Communication: I've discussed this with core contributors in the issue.
  • Tests: Added/updated and all pass
  • Installer: Added/updated and all pass
  • Localization: All end user facing strings can be localized
  • Docs: Added/ updated
  • Binaries: Any new files are added to WXS / YML

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

yuyoyuppe added 2 commits May 11, 2022 23:40
known issues:
- wix doesn't have arm platform -> using x86 instead, resulting in wrong default installation dir and inability to detect 605
- current winappsdk 1.0.3 installer is corrupted -> contains x64 packages
- we're still using hardcoded vcredist for some modules
@yuyoyuppe
Copy link
Contributor Author

@snickler is also welcome to review 🤗

@snickler
Copy link
Collaborator

@snickler is also welcome to review 🤗

Yup I'm doing that now :)

Copy link
Collaborator

@stefansjfw stefansjfw left a comment

Choose a reason for hiding this comment

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

few more notes beside other comments:

  • what's the name of the arm build dir? Should it be added to .gitignore?
  • PowerToysSetpCustomActions proj doesn't have ARM64 targets. Needed or not?
  • version_architecture get_current_architecture() in version.cpp has ARM TODO

installer/PowerToysSetup/PowerToysBootstrapper.wixproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
tools/StylesReportTool/StylesReportTool.vcxproj Outdated Show resolved Hide resolved
@stefansjfw
Copy link
Collaborator

Also, searching for "VideoConferenceProxyFilter_ARM64" in entire project looks like it's missing in some places, comparing to "VideoConferenceProxyFilter_x64"

@snickler
Copy link
Collaborator

Also, searching for "VideoConferenceProxyFilter_ARM64" in entire project looks like it's missing in some places, comparing to "VideoConferenceProxyFilter_x64"

Yeah I noticed that also while building it. I'm going to check and see what's up with that.

@snickler
Copy link
Collaborator

@yuyoyuppe @stefansjfw are you able to compile StylesReportTool? On my VS 2022 I'm getting errors with the log function, regardless of whether I'm compiling using x64 or ARM64

1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &,const LONG &,const LONG &,const LONG &,const LONG &,const LONG &,const LONG &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const bool &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const BOOL &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,OLECHAR *const &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const std::chrono::system_clock::time_point &>::_Basic_format_string': call to immediate function is not a constant expression
1>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(128,31): error C7595: 'std::_Basic_format_string<wchar_t,const WCHAR (&)[256]>::_Basic_format_string': call to immediate function is not a constant expression

@stefansjfw
Copy link
Collaborator

are you able to compile StylesReportTool?

@snickler
Works for me . both on main and this branch

@yuyoyuppe
Copy link
Contributor Author

yuyoyuppe commented May 13, 2022

@stefansjfw thanks for the review!

Also, searching for "VideoConferenceProxyFilter_ARM64" in entire project looks like it's missing in some places, comparing to "VideoConferenceProxyFilter_x64"

good catch, added.

what's the name of the arm build dir? Should it be added to .gitignore?

done. it was ignored by something else before.

PowerToysSetpCustomActions proj doesn't have ARM64 targets. Needed or not?

no, wix doesn't support ARM64 yet, and this dll is being loaded by the installer. we build installer as x86 now.

version_architecture get_current_architecture() in version.cpp has ARM TODO

yes, CI and updating will be done as a separate PR, as well as vcredist cleanup (currently it's hardcoded)

@snickler works for me w/o issues. I've pushed a possible fix, please try again.

@yuyoyuppe yuyoyuppe requested a review from stefansjfw May 13, 2022 13:01
@snickler
Copy link
Collaborator

snickler commented May 13, 2022

Hmmm. @yuyoyuppe @stefansjfw. I still get the same error after pulling down the latest. I'm using the latest VS2022 preview, but here's output from running MSBuild in CLI.

C:\Repos\PowerToys\tools\StylesReportTool>msbuild -t:restore,build -p:Platform=arm64 -p:Configuration=Release -p:RestorePackagesConfig=true -m StylesReportTool.sln
Microsoft (R) Build Engine version 17.3.0-preview-22226-03+b6fc583d4 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 5/13/2022 9:10:56 AM.
     1>Project "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.sln" on node 1 (restore;build target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|arm64".
       _GetAllRestoreProjectPathItems:
         Determining projects to restore...
       Restore:
         Nothing to do. None of the projects specified contain packages to restore.
     1>Project "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.sln" (1) is building "C:\Repos\PowerToys\too
       ls\StylesReportTool\StylesReportTool.vcxproj" (2:6) on node 1 (default targets).
     2>InitializeBuildStatus:
         Touching "C:\Repos\PowerToys\tools\StylesReportTool\..\..\ARM64\Release\obj\StylesReportTool\StylesReportTool.
         tlog\unsuccessfulbuild".
       ClCompile:
         C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31424\bin\HostArm64\arm64\CL.exe /c
         /Zi /nologo /W3 /WX /diagnostics:column /sdl /MP /O2 /Oi /Oy- /GL /D NDEBUG /D _WINDOWS /D _ARM64_WINAPI_PARTI
         TION_DESKTOP_SDK_AVAILABLE=1 /D _UNICODE /D UNICODE /D NDEBUG /D _UNICODE /D UNICODE /Gm- /EHsc /MT /GS /Gy /f
         p:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++latest /permissive- /Yc"pch.h" /Fp"C:\Repos\PowerToys\to
         ols\StylesReportTool\..\..\ARM64\Release\obj\StylesReportTool\PowerToys.StylesReportTool.pch" /Fo"C:\Repos\Pow
         erToys\tools\StylesReportTool\..\..\ARM64\Release\obj\StylesReportTool\\" /Fd"C:\Repos\PowerToys\tools\StylesR
         eportTool\..\..\ARM64\Release\obj\StylesReportTool\vc143.pdb" /external:W0 /Gd /TP /analyze- /FC /errorReport:
         queue /await pch.cpp
         pch.cpp
         C:\Program Files\Microsoft Visual Studio\2022\Preview\VC\Tools\MSVC\14.33.31424\bin\HostArm64\arm64\CL.exe /c
         /Zi /nologo /W3 /WX /diagnostics:column /sdl /MP /O2 /Oi /Oy- /GL /D NDEBUG /D _WINDOWS /D _ARM64_WINAPI_PARTI
         TION_DESKTOP_SDK_AVAILABLE=1 /D _UNICODE /D UNICODE /D NDEBUG /D _UNICODE /D UNICODE /Gm- /EHsc /MT /GS /Gy /f
         p:precise /Zc:wchar_t /Zc:forScope /Zc:inline /std:c++latest /permissive- /Yu"pch.h" /Fp"C:\Repos\PowerToys\to
         ols\StylesReportTool\..\..\ARM64\Release\obj\StylesReportTool\PowerToys.StylesReportTool.pch" /Fo"C:\Repos\Pow
         erToys\tools\StylesReportTool\..\..\ARM64\Release\obj\StylesReportTool\\" /Fd"C:\Repos\PowerToys\tools\StylesR
         eportTool\..\..\ARM64\Release\obj\StylesReportTool\vc143.pdb" /external:W0 /Gd /TP /analyze- /FC /errorReport:
         queue /await StylesReportTool.cpp
         StylesReportTool.cpp
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &,const LONG &,const
       LONG &,const LONG &,const LONG &,const LONG &,const LONG &>::_Basic_format_string': call to immediate function i
       s not a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(157): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[37],std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator
       <wchar_t>>,LONG,LONG,LONG,LONG,LONG,LONG>(const FormatString (&),const std::basic_string<wchar_t,std::char_trait
       s<wchar_t>,std::allocator<wchar_t>> &,const LONG &,const LONG &,const LONG &,const LONG &,const LONG &,const LON
       G &)' being compiled [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [37]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &>::_Basic_format_str
       ing': call to immediate function is not a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\StylesR
       eportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(161): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[17],std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator
       <wchar_t>>>(const FormatString (&),const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wcha
       r_t>> &)' being compiled [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [17]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repos\PowerToys\too
       ls\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(169): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[48],>(const FormatString (&))' being compiled [C:\Repos\PowerToys\tool
       s\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [48]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const bool &>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repos\
       PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(172): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[23],bool>(const FormatString (&),const bool &)' being compiled [C:\Rep
       os\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [23]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const BOOL &>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repos\
       PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(275): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[41],BOOL>(const FormatString (&),const BOOL &)' being compiled [C:\Rep
       os\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [41]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,OLECHAR *const &>::_Basic_format_string': call to immediate function is not a constant expression [C:\Re
       pos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(285): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[23],OLECHAR*>(const FormatString (&),OLECHAR *const &)' being compiled
        [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [23]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const std::chrono::system_clock::time_point &>::_Basic_format_string': call to immediate function is not
        a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(313): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[14],std::chrono::system_clock::time_point>(const FormatString (&),cons
       t std::chrono::system_clock::time_point &)' being compiled [C:\Repos\PowerToys\tools\StylesReportTool\StylesRepo
       rtTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [14]
                 ]
     2>C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_string<
       wchar_t,const WCHAR (&)[256]>::_Basic_format_string': call to immediate function is not a constant expression [C
       :\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : failure was caused by a read o
       f a variable outside its lifetime [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): message : see usage of 'fmt' [C:\Repos\P
       owerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
       C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(320): message : see reference to function templat
       e instantiation 'void Logger::log<wchar_t[10],WCHAR[256]>(const FormatString (&),const WCHAR (&)[256])' being co
       mpiled [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
                 with
                 [
                     FormatString=wchar_t [10]
                 ]
     2>Done Building Project "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj" (default targets) --
       FAILED.
     1>Done Building Project "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.sln" (restore;build target(s))
        -- FAILED.

Build FAILED.

       "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.sln" (restore;build target) (1) ->
       "C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj" (default target) (2:6) ->
       (ClCompile target) ->
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &,const LONG &,cons
       t LONG &,const LONG &,const LONG &,const LONG &,const LONG &>::_Basic_format_string': call to immediate function
        is not a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>> &>::_Basic_format_s
       tring': call to immediate function is not a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\Style
       sReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repos\PowerToys\t
       ools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const bool &>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repo
       s\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const BOOL &>::_Basic_format_string': call to immediate function is not a constant expression [C:\Repo
       s\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,OLECHAR *const &>::_Basic_format_string': call to immediate function is not a constant expression [C:\
       Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const std::chrono::system_clock::time_point &>::_Basic_format_string': call to immediate function is n
       ot a constant expression [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]
         C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.cpp(129,31): error C7595: 'std::_Basic_format_strin
       g<wchar_t,const WCHAR (&)[256]>::_Basic_format_string': call to immediate function is not a constant expression
       [C:\Repos\PowerToys\tools\StylesReportTool\StylesReportTool.vcxproj]

    0 Warning(s)
    8 Error(s)

@yuyoyuppe
Copy link
Contributor Author

@snickler pushed another fix attempt. I'm on VS2022 x64 17.1.5.

@snickler
Copy link
Collaborator

@snickler pushed another fix attempt. I'm on VS2022 x64 17.1.5.

Still didn't work. I'm on VS2022 17.3.0 Preview 1.0. I'm going to try and compile this from my x64 device and see if it's any different.

@yuyoyuppe
Copy link
Contributor Author

Added perfect forwarding for log args, but I guess it won't fix it either :). Looking at the error more closely, perhaps the signature of std::format was changed? Here's mine:

template <class... _Types>
_NODISCARD wstring format(const wstring_view _Fmt, const _Types&... _Args) {
    return _STD vformat(_Fmt, _STD make_wformat_args(_Args...));
}

@snickler
Copy link
Collaborator

Added perfect forwarding for log args, but I guess it won't fix it either :). Looking at the error more closely, perhaps the signature of std::format was changed? Here's mine:

template <class... _Types>
_NODISCARD wstring format(const wstring_view _Fmt, const _Types&... _Args) {
    return _STD vformat(_Fmt, _STD make_wformat_args(_Args...));
}

Nope same error.

It's using MSVC 14.33.31424

template <class... _Types>
_NODISCARD string format(const _Fmt_string<_Types...> _Fmt, _Types&&... _Args) {
    return _STD vformat(_Fmt._Str, _STD make_format_args(_Args...));
}

template <class... _Types>
_NODISCARD wstring format(const _Fmt_wstring<_Types...> _Fmt, _Types&&... _Args) {
    return _STD vformat(_Fmt._Str, _STD make_wformat_args(_Args...));
}

template <class... _Types>
_NODISCARD string format(const locale& _Loc, const _Fmt_string<_Types...> _Fmt, _Types&&... _Args) {
    return _STD vformat(_Loc, _Fmt._Str, _STD make_format_args(_Args...));
}

template <class... _Types>
_NODISCARD wstring format(const locale& _Loc, const _Fmt_wstring<_Types...> _Fmt, _Types&&... _Args) {
    return _STD vformat(_Loc, _Fmt._Str, _STD make_wformat_args(_Args...));
}

@snickler
Copy link
Collaborator

Oh!

Got it! Thanks for sending me your format function @yuyoyuppe . I just switched it to call the vformat that it uses instead. Now I can compile

@github-actions
Copy link

github-actions bot commented May 13, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

vformat
wformat

Previously acknowledged words that are now absent BGSOUNDS BUILDARCH CLIENTPULL dispid DISPIDAMBIENTDLCONTROL DLACTIVEXCTLS DLCONTROL DLIMAGES DOWNLOADONLY epo FANCYZONESWINDOWSTYLES FORCEOFFLINE FRAMEDOWNLOAD gsuberland HFONT Htmdid ICore IDCANCEL IDOK INITDIALOG IReflect IWindows IXaml lamotile METACHARSET mirophone mshtmdid NETFX netstandard Nvidia otating Postion preperty Redist ruleset RUNACTIVEXCTLS serizalization settingsv Setttings sourceid testtrocess Toolchain VDId xbf XBind XInstance
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands

... in a clone of the git@github.com:yuyoyuppe/PowerToys.git repository
on the arm64_bootstrapper branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
perl -e '
my $new_expect_file=".github/actions/spell-check/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/microsoft/PowerToys/issues/comments/1126140604" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u
If the flagged items do not appear to be text

If items relate to a ...

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

  • binary file.

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

@yuyoyuppe
Copy link
Contributor Author

Nice!

@snickler
Copy link
Collaborator

With that change, I was able to build the installer and bootstrapper, then successfully install without issues.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

LGTM! Works very well.
Great work!

@jaimecbernardo jaimecbernardo requested a review from stefansjfw May 13, 2022 15:48
@jaimecbernardo
Copy link
Collaborator

Is every PR comment addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants