{"action":"created","issue":{"url":"https://api.github.com/repos/janestreet/jbuilder/issues/322","repository_url":"https://api.github.com/repos/janestreet/jbuilder","labels_url":"https://api.github.com/repos/janestreet/jbuilder/issues/322/labels{/name}","comments_url":"https://api.github.com/repos/janestreet/jbuilder/issues/322/comments","events_url":"https://api.github.com/repos/janestreet/jbuilder/issues/322/events","html_url":"https://github.com/janestreet/jbuilder/issues/322","id":272748044,"number":322,"title":"Support spaces in ocamllex path","user":{"login":"Chris00","id":1255665,"avatar_url":"https://avatars2.githubusercontent.com/u/1255665?v=4","gravatar_id":"","url":"https://api.github.com/users/Chris00","html_url":"https://github.com/Chris00","followers_url":"https://api.github.com/users/Chris00/followers","following_url":"https://api.github.com/users/Chris00/following{/other_user}","gists_url":"https://api.github.com/users/Chris00/gists{/gist_id}","starred_url":"https://api.github.com/users/Chris00/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chris00/subscriptions","organizations_url":"https://api.github.com/users/Chris00/orgs","repos_url":"https://api.github.com/users/Chris00/repos","events_url":"https://api.github.com/users/Chris00/events{/privacy}","received_events_url":"https://api.github.com/users/Chris00/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-11-09T22:25:24Z","updated_at":"2017-11-16T21:36:47Z","closed_at":"2017-11-15T20:23:02Z","author_association":"CONTRIBUTOR","body":"When looking for `ocamllex` using Windows `PATH`, one may well end up with a name such as `C:\\Program Files/OCaml\\bin\\ocamllex.opt.exe` (with spaces).  Thus the line `exec \"%s -q %s\" ocamllex src` fails as the executable name is misunderstood.  Strangely using `Filename.quote ocamllex` [does not work](https://ci.appveyor.com/project/Chris00/ocaml-appveyor/build/1.0.190#L5118).  (@dra27 any idea why?)"},"comment":{"url":"https://api.github.com/repos/janestreet/jbuilder/issues/comments/345070464","html_url":"https://github.com/janestreet/jbuilder/issues/322#issuecomment-345070464","issue_url":"https://api.github.com/repos/janestreet/jbuilder/issues/322","id":345070464,"user":{"login":"fdopen","id":6636667,"avatar_url":"https://avatars2.githubusercontent.com/u/6636667?v=4","gravatar_id":"","url":"https://api.github.com/users/fdopen","html_url":"https://github.com/fdopen","followers_url":"https://api.github.com/users/fdopen/followers","following_url":"https://api.github.com/users/fdopen/following{/other_user}","gists_url":"https://api.github.com/users/fdopen/gists{/gist_id}","starred_url":"https://api.github.com/users/fdopen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdopen/subscriptions","organizations_url":"https://api.github.com/users/fdopen/orgs","repos_url":"https://api.github.com/users/fdopen/repos","events_url":"https://api.github.com/users/fdopen/events{/privacy}","received_events_url":"https://api.github.com/users/fdopen/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T21:36:47Z","updated_at":"2017-11-16T21:36:47Z","author_association":"NONE","body":"> Fortunately (here), we can get away without having to put Windows-specific code in the bootstrap, as the only thing which needs to be quoted is the command,\r\n\r\nThat's enough. Already the command (ocamllex, ocamlopt,...) could contain a wrong character, so additional quotes around the whole command line are necessary. Test it yourself:\r\n\r\n```ocaml\r\nlet cygwin_dir = \"C:\\\\cygwin\" in\r\nlet dubious_name = \"test(a)\" in\r\nlet (//) = Filename.concat in\r\nlet test_dir = cygwin_dir // \"tmp\" // dubious_name in\r\nUnix.mkdir test_dir 0o755;\r\nlet echo = Filename.concat test_dir \"echo.exe\" in\r\nlet copy_cmd = Printf.sprintf \"copy %s %s\" (Filename.quote (cygwin_dir // \"bin\" // \"echo.exe\")) (Filename.quote echo) in\r\nassert (Sys.command copy_cmd = 0);\r\nassert (Sys.file_exists echo);\r\nassert (0 = Sys.command (Printf.sprintf \"\\\"%s Hello\\\"\" (Filename.quote echo))); (* ok! *)\r\nassert (0 = Sys.command (Printf.sprintf \"%s Hello\" (Filename.quote echo))); (* not ok! *)\r\n```\r\n"}}
{"actor":{"display_login":"fdopen"}}