{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/buck/issues/245","labels_url":"https://api.github.com/repos/facebook/buck/issues/245/labels{/name}","comments_url":"https://api.github.com/repos/facebook/buck/issues/245/comments","events_url":"https://api.github.com/repos/facebook/buck/issues/245/events","html_url":"https://github.com/facebook/buck/issues/245","id":56938629,"number":245,"title":"PEX invocation doesn't work on all platforms","user":{"login":"davido","id":347173,"avatar_url":"https://avatars.githubusercontent.com/u/347173?v=3","gravatar_id":"","url":"https://api.github.com/users/davido","html_url":"https://github.com/davido","followers_url":"https://api.github.com/users/davido/followers","following_url":"https://api.github.com/users/davido/following{/other_user}","gists_url":"https://api.github.com/users/davido/gists{/gist_id}","starred_url":"https://api.github.com/users/davido/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davido/subscriptions","organizations_url":"https://api.github.com/users/davido/orgs","repos_url":"https://api.github.com/users/davido/repos","events_url":"https://api.github.com/users/davido/events{/privacy}","received_events_url":"https://api.github.com/users/davido/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-08T04:34:41Z","updated_at":"2015-03-02T16:32:03Z","closed_at":null,"body":"In the following example:\r\n\r\n```\r\npython_binary(\r\n  name = 'hello',\r\n  main = 'hello.py'\r\n)\r\n\r\ngenrule(\r\n  name = 'say_hello',\r\n  cmd_exe = 'python.exe $(exe //tools:hello) -o %OUT%',\r\n  out = '__say_hello__'\r\n)\r\n```\r\n\r\n`$(exe //tools:hello)` resolves in too many bash escape levels, that results in failing to call the PEX file:\r\n\r\n```\r\n[com.facebook.buck.shell.ShellStep] Command: cmd.exe /c python.exe 'C:\\Users\\david\\projects\\buck_test\\buck-out\\bin\\tools\\hello.pex' -o %OUT%\r\n[2015-02-08 05:27:55.857][debug][command:3ec609cc-a1ac-4051-a50a-9deef4052f64][tid:19][com.facebook.buck.step.DefaultStepRunner] StepStarted(genrule)\r\n[2015-02-08 05:27:55.888][debug][command:3ec609cc-a1ac-4051-a50a-9deef4052f64][tid:19][com.facebook.buck.step.DefaultStepRunner] StepFinished(genrule)\r\n[2015-02-08 05:27:55.890][warn ][command:3ec609cc-a1ac-4051-a50a-9deef4052f64][tid:14][com.facebook.buck.event.listener.LoggingBuildListener] python.exe: can't open file ''C:\\Users\\david\\projects\\buck_test\\buck-out\\bin\\tools\\hello.pex'': [Errno 22] Invalid argument\r\n```\r\nThis diff fixed this:\r\n```\r\n$ git diff src/com/facebook/buck/rules/macros/ExecutableMacroExpander.java\r\ndiff --git a/src/com/facebook/buck/rules/macros/ExecutableMacroExpander.java b/src/com/facebook/buck/rules/macros/ExecutableMacroExpander.java\r\nindex d7bcae7..5dbce49 100644\r\n--- a/src/com/facebook/buck/rules/macros/ExecutableMacroExpander.java\r\n+++ b/src/com/facebook/buck/rules/macros/ExecutableMacroExpander.java\r\n@@ -20,9 +20,7 @@ import com.facebook.buck.io.ProjectFilesystem;\r\n import com.facebook.buck.parser.BuildTargetParser;\r\n import com.facebook.buck.rules.BinaryBuildRule;\r\n import com.facebook.buck.rules.BuildRule;\r\n-import com.facebook.buck.util.Escaper;\r\n import com.google.common.base.Joiner;\r\n-import com.google.common.collect.Iterables;\r\n\r\n /**\r\n  * Resolves to the executable command for a build target referencing a {@link BinaryBuildRule}.\r\n@@ -43,9 +41,7 @@ public class ExecutableMacroExpander extends BuildTargetMacroExpander {\r\n     }\r\n     BinaryBuildRule binary = (BinaryBuildRule) rule;\r\n     return Joiner.on(' ').join(\r\n-        Iterables.transform(\r\n-            binary.getExecutableCommand(filesystem),\r\n-            Escaper.BASH_ESCAPER));\r\n+            binary.getExecutableCommand(filesystem));\r\n   }\r\n\r\n }\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/buck/issues/comments/76745174","html_url":"https://github.com/facebook/buck/issues/245#issuecomment-76745174","issue_url":"https://api.github.com/repos/facebook/buck/issues/245","id":76745174,"user":{"login":"sdwilsh","id":656602,"avatar_url":"https://avatars.githubusercontent.com/u/656602?v=3","gravatar_id":"","url":"https://api.github.com/users/sdwilsh","html_url":"https://github.com/sdwilsh","followers_url":"https://api.github.com/users/sdwilsh/followers","following_url":"https://api.github.com/users/sdwilsh/following{/other_user}","gists_url":"https://api.github.com/users/sdwilsh/gists{/gist_id}","starred_url":"https://api.github.com/users/sdwilsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdwilsh/subscriptions","organizations_url":"https://api.github.com/users/sdwilsh/orgs","repos_url":"https://api.github.com/users/sdwilsh/repos","events_url":"https://api.github.com/users/sdwilsh/events{/privacy}","received_events_url":"https://api.github.com/users/sdwilsh/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T16:32:03Z","updated_at":"2015-03-02T16:32:03Z","body":"I wonder if it's safe to use no escaper on Windows here?"}}