<div dir="ltr">Okay, I'll see if upgrading to the 2015 assemblies would allow the VSIX to keep working in older versions of VS.<div><br></div><div>Still waiting on an answer to this question:</div><div><br></div><div>> <font color="#212121" class="gmail_msg" style="color:rgb(33,33,33)">In either case, though, I must ask: how is the offical vsix that's available on <a href="http://llvm.org/builds/" class="gmail_msg" target="_blank">http://llvm.org/builds/</a> get built? Is it part of an automated Clang build, or is it built and uploaded manually? If it's automated, then having to download and point to nuget.exe won't work.</font></div><div><br></div><div>Thanks!</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 28 Nov 2016 at 13:04 Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Nov 25, 2016 at 6:58 PM, Antonio Maiorano <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>> wrote:<br class="gmail_msg">
> Ah, no, that's not what I meant. The required referenced assemblies are<br class="gmail_msg">
> versions that are normally installed with VS 2010.<br class="gmail_msg">
><br class="gmail_msg">
> The first time I worked on this, I had upgraded the referenced assemblies to<br class="gmail_msg">
> the ones that ship with VS 2015, but then there was question of whether or<br class="gmail_msg">
> not the VSIX would continue to work with VS 2010/2012/2013. I'm not sure if<br class="gmail_msg">
> it would work, but I guess I can try to figure that out.<br class="gmail_msg">
<br class="gmail_msg">
Let me know if you figure this one out. It sounds like it would<br class="gmail_msg">
simplify things a lot.<br class="gmail_msg">
<br class="gmail_msg">
> In any case, what I discovered is that the "right" way to do things to make<br class="gmail_msg">
> sure your extension compiles in future versions of VS is to use NuGet to<br class="gmail_msg">
> automatically pull in the required assemblies, or to check them in and<br class="gmail_msg">
> reference them directly. The former would be better except for the problem<br class="gmail_msg">
> of CLI builds as I described in my earlier email.<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> On Fri, 25 Nov 2016 at 21:47 Zachary Turner <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>> wrote:<br class="gmail_msg">
>><br class="gmail_msg">
>> Sorry, i think I misunderstood the original option 1. I interpreted it as<br class="gmail_msg">
>> just committing changes to the vsix manifest to reference a specific version<br class="gmail_msg">
>> of the assembly which we assume to be present since it should be<br class="gmail_msg">
>> automatically installed with vs 2015. Is this not possible? Can't we just<br class="gmail_msg">
>> point the manifest to the version installed with vs?<br class="gmail_msg">
>> On Fri, Nov 25, 2016 at 6:20 PM Antonio Maiorano <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>><br class="gmail_msg">
>> wrote:<br class="gmail_msg">
>>><br class="gmail_msg">
>>> Hi again,<br class="gmail_msg">
>>><br class="gmail_msg">
>>> I've made the changes so that the required assemblies are committed, so<br class="gmail_msg">
>>> now we can build the clang-format-vsix with just VS 2015. Since the patch<br class="gmail_msg">
>>> set is around 9 mb, I'm providing a link to it on my Dropbox (if you'd<br class="gmail_msg">
>>> rather I attach it, let me know):<br class="gmail_msg">
>>><br class="gmail_msg">
>>><br class="gmail_msg">
>>> <a href="https://dl.dropboxusercontent.com/u/10504225/llvm-patches/0001-Fix-VS2015-build-of-clang-format-vsix-by-committing-.patch" rel="noreferrer" class="gmail_msg" target="_blank">https://dl.dropboxusercontent.com/u/10504225/llvm-patches/0001-Fix-VS2015-build-of-clang-format-vsix-by-committing-.patch</a><br class="gmail_msg">
>>><br class="gmail_msg">
>>> Note that it's a git patch set, for which I followed the instructions<br class="gmail_msg">
>>> here.<br class="gmail_msg">
>>><br class="gmail_msg">
>>> Thanks.<br class="gmail_msg">
>>><br class="gmail_msg">
>>> On Thu, 24 Nov 2016 at 15:45 Antonio Maiorano <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>><br class="gmail_msg">
>>> wrote:<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> Okay, that's fine, I'll go for that and if all looks good, will attach a<br class="gmail_msg">
>>>> patch.<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> Thanks.<br class="gmail_msg">
>>>><br class="gmail_msg">
>>>> On Thu, 24 Nov 2016 at 15:09 Zachary Turner <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>> wrote:<br class="gmail_msg">
>>>>><br class="gmail_msg">
>>>>> I would use the first solution. We lock ourselves to specific versions<br class="gmail_msg">
>>>>> of vs, so i think it's fine to do the same with the assemblies and deal with<br class="gmail_msg">
>>>>> it only when we upgrade<br class="gmail_msg">
>>>>> On Thu, Nov 24, 2016 at 11:29 AM Antonio Maiorano <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>><br class="gmail_msg">
>>>>> wrote:<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> Hi Hans,<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> I saw that on September 15th, you checked in a change: clang-format VS<br class="gmail_msg">
>>>>>> plugin: upgrade the project files to VS2015.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> When I open the latest version of ClangFormat.sln on a machine that<br class="gmail_msg">
>>>>>> has only VS 2015, it doesn't build. The reason is that some of the<br class="gmail_msg">
>>>>>> referenced assemblies are from VS 2010.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> <Reference Include="Microsoft.VisualStudio.CoreUtility,<br class="gmail_msg">
>>>>>> Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,<br class="gmail_msg">
>>>>>> processorArchitecture=MSIL" /> <Reference<br class="gmail_msg">
>>>>>> Include="Microsoft.VisualStudio.Editor, Version=10.0.0.0, Culture=neutral,<br class="gmail_msg">
>>>>>> PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /><br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> What happens is that when building, these specific assemblies are not<br class="gmail_msg">
>>>>>> found. I suspect you have VS 2010 installed on your machine, which is why<br class="gmail_msg">
>>>>>> you don't get these build errors.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> The recommended way to handle this is to make use of NuGet to have it<br class="gmail_msg">
>>>>>> automatically download the required assemblies. I have made the changes<br class="gmail_msg">
>>>>>> locally to get this working, and it works great when building<br class="gmail_msg">
>>>>>> ClangFormat.sln from within Visual Studio; however, building from the CLI<br class="gmail_msg">
>>>>>> doesn't work out of the box because you must explicitly run 'nuget.exe<br class="gmail_msg">
>>>>>> restore ClangFormat.sln' before running msbuild (or devenv.exe in our case).<br class="gmail_msg">
>>>>>> The problem is that nuget.exe isn't something that's easily found/accessible<br class="gmail_msg">
>>>>>> on Windows, even once installed as an extension in VS. This is a known<br class="gmail_msg">
>>>>>> problem and the current best solution requires downloading and making<br class="gmail_msg">
>>>>>> nuget.exe available in PATH.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> So now i'm faced with figuring out how best to solve this so that the<br class="gmail_msg">
>>>>>> custom build step in this CMakeLists.txt that runs devenv doesn't fail:<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> devenv "${CMAKE_CURRENT_SOURCE_DIR}/ClangFormat.sln" /Build Release<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> There are a few options:<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> 1) Forget NuGet and just commit the referenced assemblies. This is the<br class="gmail_msg">
>>>>>> simplest solution, but is more annoying to manage if we want to upgrade the<br class="gmail_msg">
>>>>>> versions of these assemblies later.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> 2) Commit nuget.exe to the repo and just use it. This is simple<br class="gmail_msg">
>>>>>> enough, but I'm not sure how people feel about committing binaries, and it<br class="gmail_msg">
>>>>>> would be frozen at whatever version we commit.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> 3) Do some form of wget to grab the latest nuget.exe from<br class="gmail_msg">
>>>>>> "<a href="https://nuget.org/nuget.exe" rel="noreferrer" class="gmail_msg" target="_blank">https://nuget.org/nuget.exe</a>" in CMake and invoke it. I'm not yet sure<br class="gmail_msg">
>>>>>> what's the simplest way to do this. Powershell could be used, but there are<br class="gmail_msg">
>>>>>> security annoyances to deal with.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> That's all I can come up with so far. Would love to hear from you guys<br class="gmail_msg">
>>>>>> if you have any ideas or opinions on this. If you want I can send you a<br class="gmail_msg">
>>>>>> patch of what I've got so far if that helps.<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> Thanks,<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> Antonio Maiorano<br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>><br class="gmail_msg">
>>>>>> On Thu, 15 Sep 2016 at 19:35 Antonio Maiorano <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>><br class="gmail_msg">
>>>>>> wrote:<br class="gmail_msg">
>>>>>>><br class="gmail_msg">
>>>>>>> Sorry I haven't had a chance to get back to this. Things got busy at<br class="gmail_msg">
>>>>>>> work. I do plan to get back to this as I'm hoping to add some features to<br class="gmail_msg">
>>>>>>> this extension :)<br class="gmail_msg">
>>>>>>> On Thu, Sep 15, 2016 at 7:31 PM Zachary Turner <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>><br class="gmail_msg">
>>>>>>> wrote:<br class="gmail_msg">
>>>>>>>><br class="gmail_msg">
>>>>>>>> Strange.  FWIW you can dump all the variables that are present in<br class="gmail_msg">
>>>>>>>> your environment.  You need to go to Tools -> Options -> Projects and<br class="gmail_msg">
>>>>>>>> Solutions -> Build and Run and choose either Normal, Detailed, or Diagnostic<br class="gmail_msg">
>>>>>>>> for the MSBuild project build output verbosity.  Then in the output window<br class="gmail_msg">
>>>>>>>> you will get a ton of spam, some of which is the set of all MSBuild<br class="gmail_msg">
>>>>>>>> variables you can take advantage of.<br class="gmail_msg">
>>>>>>>><br class="gmail_msg">
>>>>>>>> On Thu, Sep 15, 2016 at 4:25 PM Hans Wennborg <<a href="mailto:hans@chromium.org" class="gmail_msg" target="_blank">hans@chromium.org</a>><br class="gmail_msg">
>>>>>>>> wrote:<br class="gmail_msg">
>>>>>>>>><br class="gmail_msg">
>>>>>>>>> When I first opened the solution in VS it prompted me to install it<br class="gmail_msg">
>>>>>>>>> and I did.<br class="gmail_msg">
>>>>>>>>><br class="gmail_msg">
>>>>>>>>> On Thu, Sep 15, 2016 at 4:17 PM, Zachary Turner<br class="gmail_msg">
>>>>>>>>> <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>> wrote:<br class="gmail_msg">
>>>>>>>>> > You may need to install the Visual Studio SDK.  Did you do that<br class="gmail_msg">
>>>>>>>>> > when you<br class="gmail_msg">
>>>>>>>>> > initially installed VS 2015?<br class="gmail_msg">
>>>>>>>>> ><br class="gmail_msg">
>>>>>>>>> > On Thu, Sep 15, 2016 at 4:15 PM Hans Wennborg <<a href="mailto:hans@chromium.org" class="gmail_msg" target="_blank">hans@chromium.org</a>><br class="gmail_msg">
>>>>>>>>> > wrote:<br class="gmail_msg">
>>>>>>>>> >><br class="gmail_msg">
>>>>>>>>> >> Well, on my machine $(SDKToolsDir) doesn't work :-( I suspect<br class="gmail_msg">
>>>>>>>>> >> the file<br class="gmail_msg">
>>>>>>>>> >> will need manual tweaking by whoever is trying to build the<br class="gmail_msg">
>>>>>>>>> >> plugin.<br class="gmail_msg">
>>>>>>>>> >><br class="gmail_msg">
>>>>>>>>> >> Anyway, I've updated the solution to build with VS2015 in<br class="gmail_msg">
>>>>>>>>> >> r281648 and<br class="gmail_msg">
>>>>>>>>> >> confirmed that it can still be used with older VS versions too.<br class="gmail_msg">
>>>>>>>>> >><br class="gmail_msg">
>>>>>>>>> >> Cheers,<br class="gmail_msg">
>>>>>>>>> >> Hans<br class="gmail_msg">
>>>>>>>>> >><br class="gmail_msg">
>>>>>>>>> >> On Thu, Aug 18, 2016 at 7:11 PM, Zachary Turner<br class="gmail_msg">
>>>>>>>>> >> <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>><br class="gmail_msg">
>>>>>>>>> >> wrote:<br class="gmail_msg">
>>>>>>>>> >> > The key.snk is generated when you build, the problem is the<br class="gmail_msg">
>>>>>>>>> >> > csproj file<br class="gmail_msg">
>>>>>>>>> >> > hardcodes the directory to the sdk instead of using the<br class="gmail_msg">
>>>>>>>>> >> > appropriate<br class="gmail_msg">
>>>>>>>>> >> > project<br class="gmail_msg">
>>>>>>>>> >> > system variable like $(SDKToolsDir)<br class="gmail_msg">
>>>>>>>>> >> ><br class="gmail_msg">
>>>>>>>>> >> > On Thu, Aug 18, 2016 at 7:09 PM Zachary Turner<br class="gmail_msg">
>>>>>>>>> >> > <<a href="mailto:zturner@google.com" class="gmail_msg" target="_blank">zturner@google.com</a>><br class="gmail_msg">
>>>>>>>>> >> > wrote:<br class="gmail_msg">
>>>>>>>>> >> >><br class="gmail_msg">
>>>>>>>>> >> >> Llvm doesn't support vs2012 anymore, as long as it supports<br class="gmail_msg">
>>>>>>>>> >> >> vs2013 it's<br class="gmail_msg">
>>>>>>>>> >> >> fine<br class="gmail_msg">
>>>>>>>>> >> >> On Thu, Aug 18, 2016 at 7:07 PM Antonio Maiorano<br class="gmail_msg">
>>>>>>>>> >> >> <<a href="mailto:amaiorano@gmail.com" class="gmail_msg" target="_blank">amaiorano@gmail.com</a>><br class="gmail_msg">
>>>>>>>>> >> >> wrote:<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> Hi,<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> What I meant by upgrade was simply making it build in VS<br class="gmail_msg">
>>>>>>>>> >> >>> 2015.<br class="gmail_msg">
>>>>>>>>> >> >>> However,<br class="gmail_msg">
>>>>>>>>> >> >>> you bring up a valid point about making sure the extension<br class="gmail_msg">
>>>>>>>>> >> >>> will<br class="gmail_msg">
>>>>>>>>> >> >>> continue to<br class="gmail_msg">
>>>>>>>>> >> >>> work in VS 2012. I will look into that. Like those<br class="gmail_msg">
>>>>>>>>> >> >>> references that go<br class="gmail_msg">
>>>>>>>>> >> >>> from<br class="gmail_msg">
>>>>>>>>> >> >>> 10 to 14 that point out; I wonder if instead I should be<br class="gmail_msg">
>>>>>>>>> >> >>> able to bring<br class="gmail_msg">
>>>>>>>>> >> >>> in<br class="gmail_msg">
>>>>>>>>> >> >>> those version 10 assemblies via NuGet. I'll take a closer<br class="gmail_msg">
>>>>>>>>> >> >>> look.<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> Part of my change, however, seems to imply that the<br class="gmail_msg">
>>>>>>>>> >> >>> extension (vsix)<br class="gmail_msg">
>>>>>>>>> >> >>> project would not build correctly even in VS 2012. For<br class="gmail_msg">
>>>>>>>>> >> >>> instance, the<br class="gmail_msg">
>>>>>>>>> >> >>> missing<br class="gmail_msg">
>>>>>>>>> >> >>> Key.snk file. I don't have VS 2012 installed at the moment,<br class="gmail_msg">
>>>>>>>>> >> >>> so I<br class="gmail_msg">
>>>>>>>>> >> >>> cannot<br class="gmail_msg">
>>>>>>>>> >> >>> validate.<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> Thanks,<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> Antonio<br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>><br class="gmail_msg">
>>>>>>>>> >> >>> On Thu, 18 Aug 2016 at 19:38 Hans Wennborg<br class="gmail_msg">
>>>>>>>>> >> >>> <<a href="mailto:hans@chromium.org" class="gmail_msg" target="_blank">hans@chromium.org</a>> wrote:<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> Hi Antonio,<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> On Wed, Aug 17, 2016 at 8:15 AM, Antonio Maiorano via<br class="gmail_msg">
>>>>>>>>> >> >>>> cfe-commits<br class="gmail_msg">
>>>>>>>>> >> >>>> <<a href="mailto:cfe-commits@lists.llvm.org" class="gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg">
>>>>>>>>> >> >>>> > This patch for clang-format-vs includes the following:<br class="gmail_msg">
>>>>>>>>> >> >>>> ><br class="gmail_msg">
>>>>>>>>> >> >>>> > - Upgrade to VS 2015, including .NET framework upgrade<br class="gmail_msg">
>>>>>>>>> >> >>>> > from 4.0 to<br class="gmail_msg">
>>>>>>>>> >> >>>> > 4.5, and<br class="gmail_msg">
>>>>>>>>> >> >>>> > upgrading Microsoft.VisualStudio references to v14<br class="gmail_msg">
>>>>>>>>> >> >>>> > versions<br class="gmail_msg">
>>>>>>>>> >> >>>> > - Fix build by removing dependency on "Key.snk" file<br class="gmail_msg">
>>>>>>>>> >> >>>> > which was<br class="gmail_msg">
>>>>>>>>> >> >>>> > never<br class="gmail_msg">
>>>>>>>>> >> >>>> > checked<br class="gmail_msg">
>>>>>>>>> >> >>>> > in (and not really required anyway)<br class="gmail_msg">
>>>>>>>>> >> >>>> > - Add ".vs" directory to svn ignore (new folder that VS<br class="gmail_msg">
>>>>>>>>> >> >>>> > 2015<br class="gmail_msg">
>>>>>>>>> >> >>>> > creates<br class="gmail_msg">
>>>>>>>>> >> >>>> > for<br class="gmail_msg">
>>>>>>>>> >> >>>> > user settings)<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> "What does "Upgrade to VS 2015 mean? Adding support for<br class="gmail_msg">
>>>>>>>>> >> >>>> running the<br class="gmail_msg">
>>>>>>>>> >> >>>> plugin in VS2015, or does it mean requiring VS2015 for<br class="gmail_msg">
>>>>>>>>> >> >>>> building?<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> +zturner: I thought the plugin already worked in VS 2015?<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> I mostly just build the plugin without knowing exactly how<br class="gmail_msg">
>>>>>>>>> >> >>>> this stuff<br class="gmail_msg">
>>>>>>>>> >> >>>> works, but looking at the patch I'm worried that you're<br class="gmail_msg">
>>>>>>>>> >> >>>> increasing<br class="gmail_msg">
>>>>>>>>> >> >>>> the<br class="gmail_msg">
>>>>>>>>> >> >>>> required version for building it? I see a bunch of values<br class="gmail_msg">
>>>>>>>>> >> >>>> going from<br class="gmail_msg">
>>>>>>>>> >> >>>> 10 (VS 2012) to 14 (VS 2015).<br class="gmail_msg">
>>>>>>>>> >> >>>><br class="gmail_msg">
>>>>>>>>> >> >>>> Thanks,<br class="gmail_msg">
>>>>>>>>> >> >>>> Hans<br class="gmail_msg">
</blockquote></div>