microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.54k stars 1.56k forks source link

Managed C++ (CLI/CX) support doesn't work on arm64 Windows #8191

Open Colengms opened 3 years ago

Colengms commented 3 years ago

The repro is to add the /ZW compiler arg, to a cl.exe configuration, with the arm64 Windows build.

The issue appears to be that we're looking for vcmeta.dll in either a x64 or x86 path, and this was not updated for arm64.

A related issue is that the user may not have installed build tools for all architectures. The code that looks for vcmeta.dll assume the built tools for the current platform's target architecture is available, but they may not be. If we're not able to find vcmeta.dll, we should display an error message instead of silently failing to set this up.

Also, it looks like an x86 lib output path is used to find platform.winmd. If the user hasn't installed x86 tools, this may not be available either.

Also, it looks like vcmeta.dll is needed for tag parsing. It looks like we copy vcmeta.dll into the Extensions bin directory for that (in a CMakeFiles.txt), but are not yet doing so for arm64 builds of the extension.

sean-mcmanus commented 7 months ago

I've changed it so that IntelliSense will look for the vcmeta.dll in the compiler's path.

platform.winmd is only available at the x86 path -- we just use that path to set the --using_directory.

vcmeta.dll for tag parsing should now be installed for Windows arm64.

sean-mcmanus commented 7 months ago

I was mistaken (forgot) -- this can't be supported because we rely on the .NET Framework which doesn't ship an arm64 mscoree.lib, so we'd need to upgrade to .NET Core.

sean-mcmanus commented 7 months ago

Okay -- arm64 mscoree.lib was added with .NET Framework 4.8.1 (in 2022).

sean-mcmanus commented 7 months ago

...need to get .NET Framework 4.8.1 on our build machine...

sean-mcmanus commented 1 month ago

As far as I can tell, platform.winmd is only available at that x86 path.

sean-mcmanus commented 2 weeks ago

We have a fix that seems to work, except it hits https://github.com/microsoft/vscode-cpptools/issues/12929 (which also repros for x64), but we're not sure if the root cause is the same, so we're holding this fix until we have time to investigate the other issue.