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

VS2017: clang-format-vs #189

Closed
smanders opened this issue May 18, 2018 · 11 comments
Closed

VS2017: clang-format-vs #189

smanders opened this issue May 18, 2018 · 11 comments
Assignees
Labels
Milestone

Comments

@smanders
Copy link
Owner

projects that don't build with Visual Studio 2017

  • boost1_63.build
  • llvmformat_msvc
  • nodev6.11.4 ("Looking for Visual Studio 2015 -- Failed to find Visual Studio installation.")

projects that depend on these

  • boost1_63_bld
  • clangformat_install (llvm)
  • fecpp_msvc (boost)
  • wxinclude_msvc (boost)
@smanders smanders added the bug label May 18, 2018
@smanders smanders added this to the current milestone May 18, 2018
This was referenced May 18, 2018
@smanders
Copy link
Owner Author

boost build support VS2017

@smanders
Copy link
Owner Author

it appears that the issue with llvmformat_msvc and clangformat_install is that we patch clang-format-vs externpro-archive/clang@v3.9.0...xp3.9.0 to specifically work with Visual Studio 14 (aka 2015)

clang-format-vs https://github.com/llvm-mirror/clang/tree/master/tools/clang-format-vs
appears to have some commits to update to VS 15.0 (aka 2017) that could be cherry-picked
https://github.com/llvm-mirror/clang/commits/master/tools/clang-format-vs

but now I'm considering how to do this: support both VS 2015 and VS 2017 with some kind of conditional patch support or via configure_file or something else -- based on which generator is being used to build externpro with

@smanders
Copy link
Owner Author

the current plan (thanks @ndrasmussen): build visual studio extension for either VS 2015 or VS 2017, but not both (at the same time)

initially I will only build/install the extension if the cmake generator is VS 2015 (which will help me verify that everything else is building correctly with VS 2017)

then I will update the clang patch https://github.com/smanders/externpro/blob/18.04.1/patches/clang.patch to support VS 2017 and then only build the extension if the cmake generator is VS 2017 -- if someone needs a VS 2015 clang-format extension they can get it from a current (18.04.1) or previous externpro install...

smanders pushed a commit that referenced this issue Jul 12, 2018
* also update clang.patch with cherry-pick commits from upstream clang-format-vs
* issue #189 (comment)
@smanders
Copy link
Owner Author

cherry-pick commit externpro-archive/clang@95e5b71#diff-5c3d2b45bd43872f6ee3ec5a95eb621a to support building clang-format VS extension with VS 2017 requires nuget.exe ("to pull in required assemblies" according to the commit message)

@smanders smanders mentioned this issue Jul 12, 2018
smanders pushed a commit that referenced this issue Jul 12, 2018
smanders pushed a commit that referenced this issue Jul 13, 2018
@smanders
Copy link
Owner Author

when building externpro (with XP_DEFAULT=OFF -DXP_PRO_LLVM=ON) I see the following error

Some errors occurred during migration. For more information, see the migration report:
C:\src\externpro\_bldx\xpbase\Source\llvm\tools\clang\tools\clang-format-vs\UgradeLog.htm

The "Migration Report" (UpgradeLog.htm) has the message:

ClangFormat\ClangFormate.csproj: The application which this project type is based on was not found. Please try this link for further information: http://go.microsoft.com/fwlink/?LinkID=299083&projecttype=82b43b9b-a64c-4715-b499-d71e9ca2bd60

but when trying the link I get

We can’t connect to the server at dotnetredir.azurewebsites.net

if I open the ClangFormat.sln in llvm/tools/clang/tools/clang-format-vs I get a dialog:

Install Missing Features
Visual Studio extension development
Create add-ons and extensions for Visual Studio, including new commands, code analyzers and tool windows.
The following projects will not be loaded unless you install the above feature:
..\ClangFormat\ClangFormat.csproj

@smanders
Copy link
Owner Author

after a delay of several hours waiting for IT to give me temporary admin privileges (Microsoft, will you ever add something as useful as sudo to Windows? Windows is such a pain to develop on...) to install the Visual Studio extension development, I was able to get further, but the build still failed...

9>  1>------ Build started: Project: ClangFormat, Configuration: Release Any CPU ------
9>  1>   The system cannot find the path specified.

again, opening the ClangFormat.sln in the source llvm/tools/clang/tools/clang-format-vs and building I see the same error with no further information... so what path can't the system find?

the Key.snk file in the project has a little warning icon next to it and when I attempt to open it:

The item 'Key.snk' does not exist in the project directory. It may have been removed, renamed or deleted.

looking in the project, it appears there is a PreBuildEvent
https://github.com/smanders/clang/blob/xp3.9.0/tools/clang-format-vs/ClangFormat/ClangFormat.csproj#L252

    <PreBuildEvent>if not exist $(ProjectDir)Key.snk ("$(FrameworkSDKDir)Bin\NETFX 4.6 Tools\sn.exe" -k $(ProjectDir)Key.snk)</PreBuildEvent>

and when I search for "NETFX 4.6" in Windows Explorer I don't find anything on this development VM... so I suspect this the path the system can't find

@smanders
Copy link
Owner Author

Searching for sn.exe on this Windows 10 development VM and I find it at C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools and looking at the Programs and Features under Control Panel, sure enough: Microsoft .NET Framework 4.6.1 SDK is installed, but 4.6 SDK is not... if I change the path from 4.6 to 4.6.1 it appears to build... patch coming

one interesting thing: https://stackoverflow.com/questions/37171351/where-is-the-visual-studio-macro-for-frameworksdkdir it appears to at least be someone's opinion that managed projects are not supposed to need the SDK and it's true that the FrameworkSDKDir does not show up in the Macros list (for me on this Windows 10 development VM)

smanders pushed a commit to externpro-archive/clang that referenced this issue Jul 13, 2018
@smanders smanders changed the title Visual Studio 2017: projects don't build VS2017: clang-format-vs Jul 17, 2018
@smanders
Copy link
Owner Author

renamed title of issue as the commits referenced here will all be related to getting clang-format-vs to build with Visual Studio 2017

@smanders smanders added update and removed bug labels Jul 17, 2018
@smanders smanders self-assigned this Jul 17, 2018
@smanders
Copy link
Owner Author

completed with commits to dev branch referenced above

@smanders
Copy link
Owner Author

previous clang-format-vs (Visual Studio extension) issue #112 (which also has a lot of valuable history and information)

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

No branches or pull requests

1 participant