{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/comments/61803797","id":61803797,"diff_hunk":"@@ -42,9 +55,31 @@ srcdir(dep) = joinpath(depsdir(dep),\"src\")\n libdir(provider, dep) = [libdir(dep), libdir(dep)*\"32\", libdir(dep)*\"64\"]\n bindir(provider, dep) = bindir(dep)\n \n-successful_validate(l,p) = true\n+successful_validate(l, p=nothing) = true\n+\n+function BinDeps.isexecutable(filepath)\n+    if isfile(filepath)\n+        res = false\n+        @unix_only begin\n+            res = ccall(:access, Cint, (Ptr{Uint8}, Cint), filepath, 1) == 0\n+        end\n+        # unfortunately there is no easy way to tell if this process can execute a file on Windows","path":"src/dependencies.jl","position":58,"original_position":58,"commit_id":"6edc6c29f38d72e2ad203f05bd2fc6e14bc60db6","original_commit_id":"6edc6c29f38d72e2ad203f05bd2fc6e14bc60db6","user":{"login":"iamed2","id":3131001,"avatar_url":"https://avatars.githubusercontent.com/u/3131001?v=3","gravatar_id":"","url":"https://api.github.com/users/iamed2","html_url":"https://github.com/iamed2","followers_url":"https://api.github.com/users/iamed2/followers","following_url":"https://api.github.com/users/iamed2/following{/other_user}","gists_url":"https://api.github.com/users/iamed2/gists{/gist_id}","starred_url":"https://api.github.com/users/iamed2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamed2/subscriptions","organizations_url":"https://api.github.com/users/iamed2/orgs","repos_url":"https://api.github.com/users/iamed2/repos","events_url":"https://api.github.com/users/iamed2/events{/privacy}","received_events_url":"https://api.github.com/users/iamed2/received_events","type":"User","site_admin":false},"body":"The best we could do is ensure the file type ends with one of the PATHEXT extensions, and optionally check files that end in \".exe\" for the executable marker (`MZ`). I'll implement that.","created_at":"2016-05-02T21:02:27Z","updated_at":"2016-05-02T21:02:27Z","html_url":"https://github.com/JuliaLang/BinDeps.jl/pull/214#discussion_r61803797","pull_request_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/comments/61803797"},"html":{"href":"https://github.com/JuliaLang/BinDeps.jl/pull/214#discussion_r61803797"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214","id":68420462,"html_url":"https://github.com/JuliaLang/BinDeps.jl/pull/214","diff_url":"https://github.com/JuliaLang/BinDeps.jl/pull/214.diff","patch_url":"https://github.com/JuliaLang/BinDeps.jl/pull/214.patch","issue_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/214","number":214,"state":"open","locked":false,"title":"WIP: Depend on executables, implements #213","user":{"login":"iamed2","id":3131001,"avatar_url":"https://avatars.githubusercontent.com/u/3131001?v=3","gravatar_id":"","url":"https://api.github.com/users/iamed2","html_url":"https://github.com/iamed2","followers_url":"https://api.github.com/users/iamed2/followers","following_url":"https://api.github.com/users/iamed2/following{/other_user}","gists_url":"https://api.github.com/users/iamed2/gists{/gist_id}","starred_url":"https://api.github.com/users/iamed2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamed2/subscriptions","organizations_url":"https://api.github.com/users/iamed2/orgs","repos_url":"https://api.github.com/users/iamed2/repos","events_url":"https://api.github.com/users/iamed2/events{/privacy}","received_events_url":"https://api.github.com/users/iamed2/received_events","type":"User","site_admin":false},"body":"Users can now declare `executable_dependency` and have it work just like `library_dependency`. \r\n\r\nUnfortunately as far as I can tell there is no easy way in Julia to check if a file is executable on Windows. However, I ensured that files with `PATHEXT` executable extensions are preferred. \r\n\r\nCurrently `install` will write a variable `_exec` to deps.jl which contains a dictionary of dependency names and paths to executables. Please let me know if there is a better way. I mostly left `load_dependencies` alone, so it still gives tuples where the second element is the path. It's not clear whether including `deps.jl` or calling `load_dependencies` is preferred, and the results for doing either are undocumented. If someone knows the recommended way to approach this, I can document it. \r\n\r\nIt's unclear to me how to test this new feature. Would the best approach be to just create and run a build script with an arbitrary executable dependency? The current approach seems to use build scripts from other packages, but since it's a new feature, no packages are using it. I have been testing with my build script for the unreleased EphemeralPG.\r\n\r\nWork left:\r\n- [ ] Document `executable_dependency` and the recommended way of loading dependencies\r\n- [ ] Adapt the Autotools build process for executable dependencies\r\n- [ ] Test\r\n- [ ] Fix or get around https://github.com/JuliaLang/Compat.jl/issues/187 (currently causing 0.4 failure)\r\n\r\nThis is here in WIP state so I can get comments sooner rather than later.","created_at":"2016-04-29T19:18:44Z","updated_at":"2016-05-02T21:02:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"34226c0ebe91c5d1dbe107ad39cec6742b0e1ded","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/214/comments","statuses_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/statuses/6edc6c29f38d72e2ad203f05bd2fc6e14bc60db6","head":{"label":"invenia:execdeps","ref":"execdeps","sha":"6edc6c29f38d72e2ad203f05bd2fc6e14bc60db6","user":{"login":"invenia","id":5262440,"avatar_url":"https://avatars.githubusercontent.com/u/5262440?v=3","gravatar_id":"","url":"https://api.github.com/users/invenia","html_url":"https://github.com/invenia","followers_url":"https://api.github.com/users/invenia/followers","following_url":"https://api.github.com/users/invenia/following{/other_user}","gists_url":"https://api.github.com/users/invenia/gists{/gist_id}","starred_url":"https://api.github.com/users/invenia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invenia/subscriptions","organizations_url":"https://api.github.com/users/invenia/orgs","repos_url":"https://api.github.com/users/invenia/repos","events_url":"https://api.github.com/users/invenia/events{/privacy}","received_events_url":"https://api.github.com/users/invenia/received_events","type":"Organization","site_admin":false},"repo":{"id":57405271,"name":"BinDeps.jl","full_name":"invenia/BinDeps.jl","owner":{"login":"invenia","id":5262440,"avatar_url":"https://avatars.githubusercontent.com/u/5262440?v=3","gravatar_id":"","url":"https://api.github.com/users/invenia","html_url":"https://github.com/invenia","followers_url":"https://api.github.com/users/invenia/followers","following_url":"https://api.github.com/users/invenia/following{/other_user}","gists_url":"https://api.github.com/users/invenia/gists{/gist_id}","starred_url":"https://api.github.com/users/invenia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/invenia/subscriptions","organizations_url":"https://api.github.com/users/invenia/orgs","repos_url":"https://api.github.com/users/invenia/repos","events_url":"https://api.github.com/users/invenia/events{/privacy}","received_events_url":"https://api.github.com/users/invenia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/invenia/BinDeps.jl","description":"Tool for building binary dependencies for Julia modules","fork":true,"url":"https://api.github.com/repos/invenia/BinDeps.jl","forks_url":"https://api.github.com/repos/invenia/BinDeps.jl/forks","keys_url":"https://api.github.com/repos/invenia/BinDeps.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/invenia/BinDeps.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/invenia/BinDeps.jl/teams","hooks_url":"https://api.github.com/repos/invenia/BinDeps.jl/hooks","issue_events_url":"https://api.github.com/repos/invenia/BinDeps.jl/issues/events{/number}","events_url":"https://api.github.com/repos/invenia/BinDeps.jl/events","assignees_url":"https://api.github.com/repos/invenia/BinDeps.jl/assignees{/user}","branches_url":"https://api.github.com/repos/invenia/BinDeps.jl/branches{/branch}","tags_url":"https://api.github.com/repos/invenia/BinDeps.jl/tags","blobs_url":"https://api.github.com/repos/invenia/BinDeps.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/invenia/BinDeps.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/invenia/BinDeps.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/invenia/BinDeps.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/invenia/BinDeps.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/invenia/BinDeps.jl/languages","stargazers_url":"https://api.github.com/repos/invenia/BinDeps.jl/stargazers","contributors_url":"https://api.github.com/repos/invenia/BinDeps.jl/contributors","subscribers_url":"https://api.github.com/repos/invenia/BinDeps.jl/subscribers","subscription_url":"https://api.github.com/repos/invenia/BinDeps.jl/subscription","commits_url":"https://api.github.com/repos/invenia/BinDeps.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/invenia/BinDeps.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/invenia/BinDeps.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/invenia/BinDeps.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/invenia/BinDeps.jl/contents/{+path}","compare_url":"https://api.github.com/repos/invenia/BinDeps.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/invenia/BinDeps.jl/merges","archive_url":"https://api.github.com/repos/invenia/BinDeps.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/invenia/BinDeps.jl/downloads","issues_url":"https://api.github.com/repos/invenia/BinDeps.jl/issues{/number}","pulls_url":"https://api.github.com/repos/invenia/BinDeps.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/invenia/BinDeps.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/invenia/BinDeps.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/invenia/BinDeps.jl/labels{/name}","releases_url":"https://api.github.com/repos/invenia/BinDeps.jl/releases{/id}","deployments_url":"https://api.github.com/repos/invenia/BinDeps.jl/deployments","created_at":"2016-04-29T18:34:06Z","updated_at":"2016-04-29T18:34:06Z","pushed_at":"2016-04-29T18:42:34Z","git_url":"git://github.com/invenia/BinDeps.jl.git","ssh_url":"git@github.com:invenia/BinDeps.jl.git","clone_url":"https://github.com/invenia/BinDeps.jl.git","svn_url":"https://github.com/invenia/BinDeps.jl","homepage":null,"size":221,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaLang:master","ref":"master","sha":"875bcb12cef432ab4db721790f85ca30b89036ac","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":7580113,"name":"BinDeps.jl","full_name":"JuliaLang/BinDeps.jl","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/BinDeps.jl","description":"Tool for building binary dependencies for Julia modules","fork":false,"url":"https://api.github.com/repos/JuliaLang/BinDeps.jl","forks_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/forks","keys_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/teams","hooks_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/events","assignees_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/tags","blobs_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/subscription","commits_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/merges","archive_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/downloads","issues_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/releases{/id}","deployments_url":"https://api.github.com/repos/JuliaLang/BinDeps.jl/deployments","created_at":"2013-01-12T20:28:29Z","updated_at":"2016-04-25T14:54:36Z","pushed_at":"2016-04-29T19:18:45Z","git_url":"git://github.com/JuliaLang/BinDeps.jl.git","ssh_url":"git@github.com:JuliaLang/BinDeps.jl.git","clone_url":"https://github.com/JuliaLang/BinDeps.jl.git","svn_url":"https://github.com/JuliaLang/BinDeps.jl","homepage":null,"size":254,"stargazers_count":19,"watchers_count":19,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":40,"mirror_url":null,"open_issues_count":55,"forks":40,"open_issues":55,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214"},"html":{"href":"https://github.com/JuliaLang/BinDeps.jl/pull/214"},"issue":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/214"},"comments":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/issues/214/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/pulls/214/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/BinDeps.jl/statuses/6edc6c29f38d72e2ad203f05bd2fc6e14bc60db6"}}}}