{"action":"created","comment":{"url":"https://api.github.com/repos/esy/esy/pulls/comments/201176919","pull_request_review_id":135627403,"id":201176919,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTE3NjkxOQ==","diff_hunk":"@@ -0,0 +1,77 @@\n+module System = EsyLib.System;\n+\n+/** \n+ * Helper method to get the root path of the 'esy-bash' node modules\n+ */\n+let getEsyBashRootPath = () => {\n+  open Run;\n+  let program = Sys.argv[0];\n+  let%bind program = realpath(v(program));\n+  let basedir = Fpath.parent(program);\n+  let resolution =\n+      EsyLib.NodeResolution.resolve(\n+        \"../../../../node_modules/esy-bash/package.json\",\n+        basedir,\n+      );\n+\n+  switch%bind (Run.coerceFrmMsgOnly(resolution)) {\n+    | Some(path) => Ok(Fpath.parent(path))\n+    | None => Error(`Msg(\"Unable to find 'esy-bash'\"))\n+  };\n+};\n+\n+/**\n+ * Helper method to get the `cygpath` utility path\n+ * Used for resolving paths\n+ */\n+let getCygPath = () => {\n+    open Run;\n+    let%bind rootPath = getEsyBashRootPath();\n+    Ok(Fpath.(rootPath / \".cygwin\" / \"bin\" / \"cygpath.exe\"));\n+};\n+\n+let getEsyBashPath = () => {\n+    open Run;\n+    let%bind rootPath = getEsyBashRootPath();\n+    Ok(Fpath.(rootPath / \"bin\" / \"esy-bash.js\"));\n+};\n+\n+/**\n+* Helper utility to normalize paths to a cygwin style,\n+* ie, \"C:\\temp\" -> \"/cygdrive/c/temp\"\n+* On non-Windows platforms, this is a noop\n+*/\n+let normalizePathForCygwin = (path) => {\n+    open Run;\n+    switch (System.host) {\n+        | System.Windows => {\n+            let%bind rootPath = getCygPath();\n+            let ic = Unix.open_process_in(Fpath.to_string(rootPath) ++ \" \\\"\" ++ path ++ \" \\\"\")","path":"esy-build-package/EsyBash.re","position":49,"original_position":49,"commit_id":"323dd31e4946d6d6003cd8e37ca21f50f0c7a528","original_commit_id":"323dd31e4946d6d6003cd8e37ca21f50f0c7a528","user":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"body":"@andreypopp , let me know if there is anything you'd like me to restructure or change here - first real `reason` code I've written, so I'm sure I did a lot of things wrong.","created_at":"2018-07-09T23:20:05Z","updated_at":"2018-07-09T23:20:05Z","html_url":"https://github.com/esy/esy/pull/233#discussion_r201176919","pull_request_url":"https://api.github.com/repos/esy/esy/pulls/233","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/esy/esy/pulls/comments/201176919"},"html":{"href":"https://github.com/esy/esy/pull/233#discussion_r201176919"},"pull_request":{"href":"https://api.github.com/repos/esy/esy/pulls/233"}}},"pull_request":{"url":"https://api.github.com/repos/esy/esy/pulls/233","id":199856268,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5ODU2MjY4","html_url":"https://github.com/esy/esy/pull/233","diff_url":"https://github.com/esy/esy/pull/233.diff","patch_url":"https://github.com/esy/esy/pull/233.patch","issue_url":"https://api.github.com/repos/esy/esy/issues/233","number":233,"state":"open","locked":false,"title":"[WIP] Windows Support: 'esy build' - Part 2 - rsync on windows","user":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"body":"After #232, the next blocker on Windows is the `rsync` command. The `rsync` command is used to relocate the source path prior to the build. The problem is that the `rsync` command is one `cygwin` utility that does not respect Windows paths. In addition, it's only available in the cygwin environment - it's not in the `PATH` by default.\r\n\r\nIn addition, this is the first command that we need to run in our `esy-bash` sandbox. On Windows, this executes the command in a cygwin shell. On other platforms, this just passes through to a bash shell.\r\n\r\nTo facilitate this, I added a helper method to run commands in the cygwin environment via the `EsyBash` module. This also contains helper methods for path conversion.\r\n\r\nFinally, I factored the `System.ml` module to a shared location so that its accessible to `esy-build-package` too - this helps in resolving the correct strategy per platform.","created_at":"2018-07-06T22:00:55Z","updated_at":"2018-07-09T23:20:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1eaa75485444846f05b6d12fe4149263e69df290","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/esy/esy/pulls/233/commits","review_comments_url":"https://api.github.com/repos/esy/esy/pulls/233/comments","review_comment_url":"https://api.github.com/repos/esy/esy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/esy/esy/issues/233/comments","statuses_url":"https://api.github.com/repos/esy/esy/statuses/323dd31e4946d6d6003cd8e37ca21f50f0c7a528","head":{"label":"bryphe:windows/esy-build-part-2","ref":"windows/esy-build-part-2","sha":"323dd31e4946d6d6003cd8e37ca21f50f0c7a528","user":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"repo":{"id":137964123,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc5NjQxMjM=","name":"esy","full_name":"bryphe/esy","owner":{"login":"bryphe","id":13532591,"node_id":"MDQ6VXNlcjEzNTMyNTkx","avatar_url":"https://avatars1.githubusercontent.com/u/13532591?v=4","gravatar_id":"","url":"https://api.github.com/users/bryphe","html_url":"https://github.com/bryphe","followers_url":"https://api.github.com/users/bryphe/followers","following_url":"https://api.github.com/users/bryphe/following{/other_user}","gists_url":"https://api.github.com/users/bryphe/gists{/gist_id}","starred_url":"https://api.github.com/users/bryphe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryphe/subscriptions","organizations_url":"https://api.github.com/users/bryphe/orgs","repos_url":"https://api.github.com/users/bryphe/repos","events_url":"https://api.github.com/users/bryphe/events{/privacy}","received_events_url":"https://api.github.com/users/bryphe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bryphe/esy","description":"package.json workflow for native development with Reason/OCaml","fork":true,"url":"https://api.github.com/repos/bryphe/esy","forks_url":"https://api.github.com/repos/bryphe/esy/forks","keys_url":"https://api.github.com/repos/bryphe/esy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bryphe/esy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bryphe/esy/teams","hooks_url":"https://api.github.com/repos/bryphe/esy/hooks","issue_events_url":"https://api.github.com/repos/bryphe/esy/issues/events{/number}","events_url":"https://api.github.com/repos/bryphe/esy/events","assignees_url":"https://api.github.com/repos/bryphe/esy/assignees{/user}","branches_url":"https://api.github.com/repos/bryphe/esy/branches{/branch}","tags_url":"https://api.github.com/repos/bryphe/esy/tags","blobs_url":"https://api.github.com/repos/bryphe/esy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bryphe/esy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bryphe/esy/git/refs{/sha}","trees_url":"https://api.github.com/repos/bryphe/esy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bryphe/esy/statuses/{sha}","languages_url":"https://api.github.com/repos/bryphe/esy/languages","stargazers_url":"https://api.github.com/repos/bryphe/esy/stargazers","contributors_url":"https://api.github.com/repos/bryphe/esy/contributors","subscribers_url":"https://api.github.com/repos/bryphe/esy/subscribers","subscription_url":"https://api.github.com/repos/bryphe/esy/subscription","commits_url":"https://api.github.com/repos/bryphe/esy/commits{/sha}","git_commits_url":"https://api.github.com/repos/bryphe/esy/git/commits{/sha}","comments_url":"https://api.github.com/repos/bryphe/esy/comments{/number}","issue_comment_url":"https://api.github.com/repos/bryphe/esy/issues/comments{/number}","contents_url":"https://api.github.com/repos/bryphe/esy/contents/{+path}","compare_url":"https://api.github.com/repos/bryphe/esy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bryphe/esy/merges","archive_url":"https://api.github.com/repos/bryphe/esy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bryphe/esy/downloads","issues_url":"https://api.github.com/repos/bryphe/esy/issues{/number}","pulls_url":"https://api.github.com/repos/bryphe/esy/pulls{/number}","milestones_url":"https://api.github.com/repos/bryphe/esy/milestones{/number}","notifications_url":"https://api.github.com/repos/bryphe/esy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bryphe/esy/labels{/name}","releases_url":"https://api.github.com/repos/bryphe/esy/releases{/id}","deployments_url":"https://api.github.com/repos/bryphe/esy/deployments","created_at":"2018-06-20T01:26:54Z","updated_at":"2018-07-06T21:55:01Z","pushed_at":"2018-07-09T23:18:04Z","git_url":"git://github.com/bryphe/esy.git","ssh_url":"git@github.com:bryphe/esy.git","clone_url":"https://github.com/bryphe/esy.git","svn_url":"https://github.com/bryphe/esy","homepage":"http://esy.sh","size":3128,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"esy:master","ref":"master","sha":"e7ba9006abbd27d1e44b029489260455b5c523f6","user":{"login":"esy","id":33266415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjY2NDE1","avatar_url":"https://avatars3.githubusercontent.com/u/33266415?v=4","gravatar_id":"","url":"https://api.github.com/users/esy","html_url":"https://github.com/esy","followers_url":"https://api.github.com/users/esy/followers","following_url":"https://api.github.com/users/esy/following{/other_user}","gists_url":"https://api.github.com/users/esy/gists{/gist_id}","starred_url":"https://api.github.com/users/esy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esy/subscriptions","organizations_url":"https://api.github.com/users/esy/orgs","repos_url":"https://api.github.com/users/esy/repos","events_url":"https://api.github.com/users/esy/events{/privacy}","received_events_url":"https://api.github.com/users/esy/received_events","type":"Organization","site_admin":false},"repo":{"id":107100376,"node_id":"MDEwOlJlcG9zaXRvcnkxMDcxMDAzNzY=","name":"esy","full_name":"esy/esy","owner":{"login":"esy","id":33266415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMzMjY2NDE1","avatar_url":"https://avatars3.githubusercontent.com/u/33266415?v=4","gravatar_id":"","url":"https://api.github.com/users/esy","html_url":"https://github.com/esy","followers_url":"https://api.github.com/users/esy/followers","following_url":"https://api.github.com/users/esy/following{/other_user}","gists_url":"https://api.github.com/users/esy/gists{/gist_id}","starred_url":"https://api.github.com/users/esy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esy/subscriptions","organizations_url":"https://api.github.com/users/esy/orgs","repos_url":"https://api.github.com/users/esy/repos","events_url":"https://api.github.com/users/esy/events{/privacy}","received_events_url":"https://api.github.com/users/esy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/esy/esy","description":"package.json workflow for native development with Reason/OCaml","fork":false,"url":"https://api.github.com/repos/esy/esy","forks_url":"https://api.github.com/repos/esy/esy/forks","keys_url":"https://api.github.com/repos/esy/esy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esy/esy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esy/esy/teams","hooks_url":"https://api.github.com/repos/esy/esy/hooks","issue_events_url":"https://api.github.com/repos/esy/esy/issues/events{/number}","events_url":"https://api.github.com/repos/esy/esy/events","assignees_url":"https://api.github.com/repos/esy/esy/assignees{/user}","branches_url":"https://api.github.com/repos/esy/esy/branches{/branch}","tags_url":"https://api.github.com/repos/esy/esy/tags","blobs_url":"https://api.github.com/repos/esy/esy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esy/esy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esy/esy/git/refs{/sha}","trees_url":"https://api.github.com/repos/esy/esy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esy/esy/statuses/{sha}","languages_url":"https://api.github.com/repos/esy/esy/languages","stargazers_url":"https://api.github.com/repos/esy/esy/stargazers","contributors_url":"https://api.github.com/repos/esy/esy/contributors","subscribers_url":"https://api.github.com/repos/esy/esy/subscribers","subscription_url":"https://api.github.com/repos/esy/esy/subscription","commits_url":"https://api.github.com/repos/esy/esy/commits{/sha}","git_commits_url":"https://api.github.com/repos/esy/esy/git/commits{/sha}","comments_url":"https://api.github.com/repos/esy/esy/comments{/number}","issue_comment_url":"https://api.github.com/repos/esy/esy/issues/comments{/number}","contents_url":"https://api.github.com/repos/esy/esy/contents/{+path}","compare_url":"https://api.github.com/repos/esy/esy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esy/esy/merges","archive_url":"https://api.github.com/repos/esy/esy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esy/esy/downloads","issues_url":"https://api.github.com/repos/esy/esy/issues{/number}","pulls_url":"https://api.github.com/repos/esy/esy/pulls{/number}","milestones_url":"https://api.github.com/repos/esy/esy/milestones{/number}","notifications_url":"https://api.github.com/repos/esy/esy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esy/esy/labels{/name}","releases_url":"https://api.github.com/repos/esy/esy/releases{/id}","deployments_url":"https://api.github.com/repos/esy/esy/deployments","created_at":"2017-10-16T08:34:28Z","updated_at":"2018-07-08T08:08:31Z","pushed_at":"2018-07-09T23:18:05Z","git_url":"git://github.com/esy/esy.git","ssh_url":"git@github.com:esy/esy.git","clone_url":"https://github.com/esy/esy.git","svn_url":"https://github.com/esy/esy","homepage":"http://esy.sh","size":2455,"stargazers_count":182,"watchers_count":182,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":68,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":68,"watchers":182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/esy/esy/pulls/233"},"html":{"href":"https://github.com/esy/esy/pull/233"},"issue":{"href":"https://api.github.com/repos/esy/esy/issues/233"},"comments":{"href":"https://api.github.com/repos/esy/esy/issues/233/comments"},"review_comments":{"href":"https://api.github.com/repos/esy/esy/pulls/233/comments"},"review_comment":{"href":"https://api.github.com/repos/esy/esy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/esy/esy/pulls/233/commits"},"statuses":{"href":"https://api.github.com/repos/esy/esy/statuses/323dd31e4946d6d6003cd8e37ca21f50f0c7a528"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"bryphe"}}