Does running vcvarsall put nuget on the path?<br><br>What if we require the user to specify the path to nuget in some CMake variable?  -DMSVC_NUGET_PATH=foo?<br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 25, 2016 at 6:58 PM Antonio Maiorano <<a href="mailto:amaiorano@gmail.com">amaiorano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Ah, no, that's not what I meant. The required referenced assemblies are versions that are normally installed with VS 2010.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The first time I worked on this, I had upgraded the referenced assemblies to the ones that ship with VS 2015, but then there was question of whether or not the VSIX would continue to work with VS 2010/2012/2013. I'm not sure if it would work, but I guess I can try to figure that out.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">In any case, what I discovered is that the "right" way to do things to make sure your extension compiles in future versions of VS is to use NuGet to automatically pull in the required assemblies, or to check them in and reference them directly. The former would be better except for the problem of CLI builds as I described in my earlier email.</div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div></div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry, i think I misunderstood the original option 1.  I interpreted it as just committing changes to the vsix manifest to reference a specific version of the assembly which we assume to be present since it should be automatically installed with vs 2015.  Is this not possible?  Can't we just point the manifest to the version installed with vs?<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi again,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I've made the changes so that the required assemblies are committed, so now we can build the clang-format-vsix with just VS 2015. Since the patch set is around 9 mb, I'm providing a link to it on my Dropbox (if you'd rather I attach it, let me know):</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><a href="https://dl.dropboxusercontent.com/u/10504225/llvm-patches/0001-Fix-VS2015-build-of-clang-format-vsix-by-committing-.patch" 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></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Note that it's a git patch set, for which I followed the <a href="http://llvm.org/docs/GettingStarted.html#sending-patches-with-git" class="gmail_msg" target="_blank">instructions here</a>.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks.</div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Okay, that's fine, I'll go for that and if all looks good, will attach a patch.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks.</div></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I would use the first solution.  We lock ourselves to specific versions of vs, so i think it's fine to do the same with the assemblies and deal with it only when we upgrade<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div style="white-space:pre-wrap" 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 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 has only VS 2015, it doesn't build. The reason is that some of the referenced assemblies are from VS 2010.</div></div><div dir="ltr" class="gmail_msg"><div style="white-space:pre-wrap" class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span style="white-space:pre-wrap" class="gmail_msg">    <Reference Include="Microsoft.VisualStudio.CoreUtility, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
    <Reference Include="Microsoft.VisualStudio.Editor, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</span></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">What happens is that when building, these specific assemblies are not found. I suspect you have VS 2010 installed on your machine, which is why you don't get these build errors.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The <a href="http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html" class="gmail_msg" target="_blank">recommended way to handle this</a> is to make use of NuGet to have it automatically download the required assemblies. I have made the changes locally to get this working, and it works great when building ClangFormat.sln from within Visual Studio; however, building from the CLI doesn't work out of the box because you must explicitly run 'nuget.exe restore ClangFormat.sln' before running msbuild (or devenv.exe in our case). The problem is that nuget.exe isn't something that's easily found/accessible on Windows, even once installed as an extension in VS. This is a <a href="https://nuget.codeplex.com/workitem/3615" class="gmail_msg" target="_blank">known problem</a> and the <a href="http://stackoverflow.com/a/23935892/4039972" class="gmail_msg" target="_blank">current best solution requires downloading and making nuget.exe available in PATH</a>.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">So now i'm faced with figuring out how best to solve this so that the custom build step in <a href="https://github.com/llvm-mirror/clang/blob/master/tools/clang-format-vs/CMakeLists.txt" class="gmail_msg" target="_blank">this CMakeLists.txt</a> that runs devenv doesn't fail:<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><span style="color:rgb(51,51,51);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre-wrap" class="gmail_msg">devenv </span><span class="m_5889324703809105308m_8944622299725348455m_-5746525904139485551m_-6071246805249146965m_-7136708746972128609m_-4986737807420534328inbox-inbox-pl-s gmail_msg" style="box-sizing:border-box;color:rgb(24,54,145);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre-wrap">"<span class="m_5889324703809105308m_8944622299725348455m_-5746525904139485551m_-6071246805249146965m_-7136708746972128609m_-4986737807420534328inbox-inbox-pl-smi gmail_msg" style="box-sizing:border-box;color:rgb(51,51,51)">${CMAKE_CURRENT_SOURCE_DIR}</span>/ClangFormat.sln"</span><span style="color:rgb(51,51,51);font-family:consolas,"liberation mono",menlo,courier,monospace;font-size:12px;white-space:pre-wrap" class="gmail_msg"> /Build Release</span>  <br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">There are a few options:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">1) Forget NuGet and just commit the referenced assemblies. This is the simplest solution, but is more annoying to manage if we want to upgrade the versions of these assemblies later.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">2) Commit nuget.exe to the repo and just use it. This is simple enough, but I'm not sure how people feel about committing binaries, and it would be frozen at whatever version we commit.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">3) Do some form of wget to grab the latest nuget.exe from "<a href="https://nuget.org/nuget.exe" class="gmail_msg" target="_blank">https://nuget.org/nuget.exe</a>" in CMake and invoke it. I'm not yet sure what's the simplest way to do this. Powershell could be used, but there are security annoyances to deal with.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">That's all I can come up with so far. Would love to hear from you guys if you have any ideas or opinions on this. If you want I can send you a patch of what I've got so far if that helps.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks,</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Antonio Maiorano</div></div></div><div dir="ltr" class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg"><br class="gmail_msg"></div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry I haven't had a chance to get back to this. Things got busy at work. I do plan to get back to this as I'm hoping to add some features to this extension :)<br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Strange.  FWIW you can dump all the variables that are present in your environment.  You need to go to Tools -> Options -> Projects and Solutions -> Build and Run and choose either Normal, Detailed, or Diagnostic for the MSBuild project build output verbosity.  Then in the output window you will get a ton of spam, some of which is the set of all MSBuild variables you can take advantage of.</div><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" 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>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When I first opened the solution in VS it prompted me to install it and I did.<br class="gmail_msg">
<br class="gmail_msg">
On Thu, Sep 15, 2016 at 4:17 PM, Zachary Turner <<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 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>> wrote:<br class="gmail_msg">
>><br class="gmail_msg">
>> Well, on my machine $(SDKToolsDir) doesn't work :-( I suspect the file<br class="gmail_msg">
>> will need manual tweaking by whoever is trying to build the plugin.<br class="gmail_msg">
>><br class="gmail_msg">
>> Anyway, I've updated the solution to build with VS2015 in 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 <<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 csproj file<br class="gmail_msg">
>> > hardcodes the directory to the sdk instead of using the 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 <<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 vs2013 it's<br class="gmail_msg">
>> >> fine<br class="gmail_msg">
>> >> On Thu, Aug 18, 2016 at 7:07 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,<br class="gmail_msg">
>> >>><br class="gmail_msg">
>> >>> What I meant by upgrade was simply making it build in VS 2015.<br class="gmail_msg">
>> >>> However,<br class="gmail_msg">
>> >>> you bring up a valid point about making sure the extension will<br class="gmail_msg">
>> >>> continue to<br class="gmail_msg">
>> >>> work in VS 2012. I will look into that. Like those 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 able to bring<br class="gmail_msg">
>> >>> in<br class="gmail_msg">
>> >>> those version 10 assemblies via NuGet. I'll take a closer look.<br class="gmail_msg">
>> >>><br class="gmail_msg">
>> >>> Part of my change, however, seems to imply that the extension (vsix)<br class="gmail_msg">
>> >>> project would not build correctly even in VS 2012. For instance, the<br class="gmail_msg">
>> >>> missing<br class="gmail_msg">
>> >>> Key.snk file. I don't have VS 2012 installed at the moment, 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 <<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 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 from 4.0 to<br class="gmail_msg">
>> >>>> > 4.5, and<br class="gmail_msg">
>> >>>> > upgrading Microsoft.VisualStudio references to v14 versions<br class="gmail_msg">
>> >>>> > - Fix build by removing dependency on "Key.snk" file 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 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 running the<br class="gmail_msg">
>> >>>> plugin in VS2015, or does it mean requiring VS2015 for 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 this stuff<br class="gmail_msg">
>> >>>> works, but looking at the patch I'm worried that you're increasing<br class="gmail_msg">
>> >>>> the<br class="gmail_msg">
>> >>>> required version for building it? I see a bunch of values 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>
</blockquote></div></blockquote></div></div></div></blockquote></div>
</blockquote></div></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>