{"action":"created","issue":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/1692","labels_url":"https://api.github.com/repos/projectkudu/kudu/issues/1692/labels{/name}","comments_url":"https://api.github.com/repos/projectkudu/kudu/issues/1692/comments","events_url":"https://api.github.com/repos/projectkudu/kudu/issues/1692/events","html_url":"https://github.com/projectkudu/kudu/issues/1692","id":106304497,"number":1692,"title":"Git path is hard-coded to C:\\Program Files (x86)","user":{"login":"breiter","id":3965197,"avatar_url":"https://avatars.githubusercontent.com/u/3965197?v=3","gravatar_id":"","url":"https://api.github.com/users/breiter","html_url":"https://github.com/breiter","followers_url":"https://api.github.com/users/breiter/followers","following_url":"https://api.github.com/users/breiter/following{/other_user}","gists_url":"https://api.github.com/users/breiter/gists{/gist_id}","starred_url":"https://api.github.com/users/breiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breiter/subscriptions","organizations_url":"https://api.github.com/users/breiter/orgs","repos_url":"https://api.github.com/users/breiter/repos","events_url":"https://api.github.com/users/breiter/events{/privacy}","received_events_url":"https://api.github.com/users/breiter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-14T09:30:39Z","updated_at":"2015-09-14T17:16:26Z","closed_at":"2015-09-14T16:56:18Z","body":"Git path is hardcoded to C:\\Program Files (x86)\\Git in both the Kudu.Service.Web.csproj and Kudu.Core PathUtility.\r\n\r\nHowever, Git for Windows is now available in both x64 and x86 builds. The x64 build is preferred because it removes [some issues in the 32-bit version](https://github.com/git-for-windows/git/wiki/32-bit-issues). The x64 version of Git installs into C:\\Program Files\\ not C:\\Program Files (x86)\\.\r\n\r\nIn order to build and run Kudu s47 with Git 2.x (release) x64 the workaround I have found is to create a symbolic link between C:\\Program Files (x86)\\Git and C:\\Program Files\\Git.\r\n\r\nProposed solution:\r\n- PathUtility::ResolveGitPath() should be smarter about looking at C:\\Program Files and then C:\\Program Files (x86). It should cache the result of where it finds Git. \r\n- Note that the same problem potentially exists for Mercurial which appears to have both x64 and x86 builds available.\r\n- The generation of commit.txt by executing git as a subprocess of building Kudu.Service.Web.csproj should be performed with a shell script or just remove the absolute path and require git to be in the path."},"comment":{"url":"https://api.github.com/repos/projectkudu/kudu/issues/comments/140148536","html_url":"https://github.com/projectkudu/kudu/issues/1692#issuecomment-140148536","issue_url":"https://api.github.com/repos/projectkudu/kudu/issues/1692","id":140148536,"user":{"login":"breiter","id":3965197,"avatar_url":"https://avatars.githubusercontent.com/u/3965197?v=3","gravatar_id":"","url":"https://api.github.com/users/breiter","html_url":"https://github.com/breiter","followers_url":"https://api.github.com/users/breiter/followers","following_url":"https://api.github.com/users/breiter/following{/other_user}","gists_url":"https://api.github.com/users/breiter/gists{/gist_id}","starred_url":"https://api.github.com/users/breiter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breiter/subscriptions","organizations_url":"https://api.github.com/users/breiter/orgs","repos_url":"https://api.github.com/users/breiter/repos","events_url":"https://api.github.com/users/breiter/events{/privacy}","received_events_url":"https://api.github.com/users/breiter/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T17:16:26Z","updated_at":"2015-09-14T17:16:26Z","body":"Here's the build-time error that Visual Studio generates when trying to execute this part of Kudu.Services.Web.csproj post-build:\r\n\r\n```xml\r\n    <Message Text=\"Running post build events\" Importance=\"High\" />\r\n    <Exec Command=\"&quot;$(ProjectDir)\\updateNodeModules.cmd&quot; &quot;$(TargetDir)&quot;\" Condition=\" '$(BuildOutputsUpdated)' == 'true' \" />\r\n    <Exec Command=\"&quot;%PROGRAMFILES(X86)%\\Git\\bin\\git.exe&quot; rev-parse HEAD &gt; &quot;$(MsBuildProjectDirectory)\\commit.txt&quot;\" Condition=\" '$(BuildOutputsUpdated)' == 'true' \" />\r\n    <Copy SourceFiles=\"$(SolutionDir)\\Kudu.Console\\bin\\$(ConfigurationName)\\kudu.exe\" DestinationFolder=\"$(TargetDir)\" SkipUnchangedFiles=\"true\" />\r\n```\r\n\r\n```\r\n5>------ Rebuild All started: Project: Kudu.Services.Web, Configuration: Release Any CPU ------\r\n5>  Kudu.Services.Web -> G:\\projectkudu\\kudu\\Kudu.Services.Web\\bin\\Kudu.Services.Web.dll\r\n5>  Info: No event source classes needing registration found in G:\\projectkudu\\kudu\\Kudu.Services.Web\\bin\\Kudu.Services.Web.dll\r\n5>  Running post build events\r\n5>  Attempt 1 out of 5\r\n5>  kuduscript@0.1.13 node_modules\\kuduscript\r\n5>  Γö£ΓöÇΓöÇ streamline@0.4.11\r\n5>  ΓööΓöÇΓöÇ commander@1.1.1 (keypress@0.1.0)\r\n5>  Finished successfully.\r\n5>  The system cannot find the path specified.\r\n5>G:\\projectkudu\\kudu\\Kudu.Services.Web\\Kudu.Services.Web.csproj(290,5): error MSB3073: The command \"\"%PROGRAMFILES(X86)%\\Git\\bin\\git.exe\" rev-parse HEAD > \"G:\\projectkudu\\kudu\\Kudu.Services.Web\\commit.txt\"\" exited with code 3.\r\n```\r\n\r\n## Configuration\r\n- windows server 2012 r2, fully patched\r\n- visual studio 2015\r\n- nodejs 4.0 x64\r\n- git 2.5.2 x64\r\n- hg 3.5.1 x64\r\n\r\n```\r\nc:\\Program Files (x86)>mklink /d Git \"C:\\Program Files\\Git\"\r\nsymbolic link created for Git <<===>> C:\\Program Files\\Git\r\n```\r\n\r\n\"The system cannot find the path specified\" error goes away."}}