{"action":"created","comment":{"url":"https://api.github.com/repos/Carthage/Carthage/pulls/comments/198491612","pull_request_review_id":132427884,"id":198491612,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODQ5MTYxMg==","diff_hunk":"@@ -1289,14 +1290,78 @@ internal func frameworksInDirectory(_ directoryURL: URL) -> SignalProducer<URL,\n \t\t\t}\n \t\t\treturn frameworksInURL.count == 1\n \t\t}.filter { url in\n-\n-\t\t\tlet packageType: PackageType? = Bundle(url: url)?.packageType\n-\n+\t\t\t\n+\t\t\t// Try reading the Info.plist of the Framework\n+\t\t\tlet bundle = Bundle(url: url)\n+\t\t\tlet packageType: PackageType? = bundle?.packageType\n+\t\t\t\n \t\t\tswitch packageType {\n \t\t\tcase .framework?, .bundle?:\n \t\t\t\treturn true\n \t\t\tdefault:\n-\t\t\t\treturn false\n+\t\t\t\t// In case no Info.plist exists check the Mach-O fileType\n+\t\t\t\tguard let executablePath = bundle?\n+\t\t\t\t\t.executableURL?\n+\t\t\t\t\t.resolvingSymlinksInPath()\n+\t\t\t\t\t.path else {\n+\t\t\t\t\t\t\n+\t\t\t\t\treturn false\n+\t\t\t\t}\n+\t\t\t\t\n+\t\t\t\t// Read the Mach header with `objdump` and parse the output.\n+\t\t\t\t// The output is composed of one or more sets of lines like the following:\n+\t\t\t\t//\n+\t\t\t\t// Mach header\n+\t\t\t\t//      magic cputype  cpusubtype  caps    filetype ncmds sizeofcmds      flags\n+\t\t\t\t// 0xfeedfacf 16777223          3  0x00           1     8       1720 0x00002000\n+\t\t\t\t//\n+\t\t\t\t// See output structure at:\n+\t\t\t\t// https://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/MachODump.cpp?view=markup&pathrev=225383###see%C2%B7line%C2%B72745\n+\n+\t\t\t\tlet task = Task(\"/usr/bin/xcrun\", arguments: [\n+\t\t\t\t\t\"objdump\",\n+\t\t\t\t\t\"-macho\",\n+\t\t\t\t\t\"-private-header\",\n+\t\t\t\t\t\"-non-verbose\",\n+\t\t\t\t\texecutablePath\n+\t\t\t\t\t]\n+\t\t\t\t)\n+\t\t\t\tlet fileType = task.launch(standardInput: nil)\n+\t\t\t\t\t.ignoreTaskData()\n+\t\t\t\t\t.map { String(data: $0, encoding: .utf8) ?? \"\" }\n+\t\t\t\t\t.filter { !$0.isEmpty }\n+\t\t\t\t\t.flatMap(.merge) { (output: String) -> SignalProducer<String, NoError> in\n+\t\t\t\t\t\toutput.linesProducer\n+\t\t\t\t\t}.filter {\n+\t\t\t\t\t\t// Keep the lines with Mach-O magic number indefiers\n+\t\t\t\t\t\t$0.contains(String(format: \"%x\", MH_CIGAM))\n+\t\t\t\t\t\t\t|| $0.contains(String(format: \"%x\", MH_MAGIC))\n+\t\t\t\t\t\t\t|| $0.contains(String(format: \"%x\", MH_CIGAM_64))\n+\t\t\t\t\t\t\t|| $0.contains(String(format: \"%x\", MH_MAGIC_64))\n+\t\t\t\t\t}\n+\t\t\t\t\t.take(last: 1)\n+\t\t\t\t\t.filterMap { (magicLine: String) -> Int? in\n+\t\t\t\t\t\t\n+\t\t\t\t\t\tlet components = magicLine\n+\t\t\t\t\t\t\t.components(separatedBy: CharacterSet.whitespaces)\n+\t\t\t\t\t\t\t.filter { !$0.isEmpty }\n+\t\t\t\t\t\t// A Mach-O header has 8 components, see example lines in comments above\n+\t\t\t\t\t\tguard components.count == 8 else {\n+\t\t\t\t\t\t\treturn nil\n+\t\t\t\t\t\t}\n+\t\t\t\t\t\t\n+\t\t\t\t\t\t// The 4th component is the fileType\n+\t\t\t\t\t\treturn Int(components[4])\n+\t\t\t\t\t}\n+\t\t\t\t\t.filter {\n+\t\t\t\t\t\t$0 == MH_OBJECT // Carthage accepts static libraries\n+\t\t\t\t\t\t|| $0 == MH_BUNDLE // Bundles https://github.com/ResearchKit/ResearchKit/blob/1.3.0/ResearchKit/Info.plist#L15-L16\n+\t\t\t\t\t\t|| $0 == MH_DYLIB // or dynamic shared libraries\n+\t\t\t\t\t}\n+\t\t\t\t\t.single()?\n+\t\t\t\t\t.value\n+\n+\t\t\t\t\treturn fileType != nil","path":"Source/CarthageKit/Project.swift","position":87,"original_position":87,"commit_id":"a0c4a7e1ca774681b882f78ad5b68837447e9322","original_commit_id":"a0c4a7e1ca774681b882f78ad5b68837447e9322","user":{"login":"mdiep","id":1302,"node_id":"MDQ6VXNlcjEzMDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1302?v=4","gravatar_id":"","url":"https://api.github.com/users/mdiep","html_url":"https://github.com/mdiep","followers_url":"https://api.github.com/users/mdiep/followers","following_url":"https://api.github.com/users/mdiep/following{/other_user}","gists_url":"https://api.github.com/users/mdiep/gists{/gist_id}","starred_url":"https://api.github.com/users/mdiep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdiep/subscriptions","organizations_url":"https://api.github.com/users/mdiep/orgs","repos_url":"https://api.github.com/users/mdiep/repos","events_url":"https://api.github.com/users/mdiep/events{/privacy}","received_events_url":"https://api.github.com/users/mdiep/received_events","type":"User","site_admin":false},"body":"I'd want to see tests for this as well.","created_at":"2018-06-27T13:20:05Z","updated_at":"2018-06-27T13:20:50Z","html_url":"https://github.com/Carthage/Carthage/pull/2502#discussion_r198491612","pull_request_url":"https://api.github.com/repos/Carthage/Carthage/pulls/2502","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/comments/198491612"},"html":{"href":"https://github.com/Carthage/Carthage/pull/2502#discussion_r198491612"},"pull_request":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/2502"}},"in_reply_to_id":198490119},"pull_request":{"url":"https://api.github.com/repos/Carthage/Carthage/pulls/2502","id":197514764,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3NTE0NzY0","html_url":"https://github.com/Carthage/Carthage/pull/2502","diff_url":"https://github.com/Carthage/Carthage/pull/2502.diff","patch_url":"https://github.com/Carthage/Carthage/pull/2502.patch","issue_url":"https://api.github.com/repos/Carthage/Carthage/issues/2502","number":2502,"state":"open","locked":false,"title":"Use otool to determine whether a binary blob can be handled by Carthage","user":{"login":"blender","id":196761,"node_id":"MDQ6VXNlcjE5Njc2MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/196761?v=4","gravatar_id":"","url":"https://api.github.com/users/blender","html_url":"https://github.com/blender","followers_url":"https://api.github.com/users/blender/followers","following_url":"https://api.github.com/users/blender/following{/other_user}","gists_url":"https://api.github.com/users/blender/gists{/gist_id}","starred_url":"https://api.github.com/users/blender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blender/subscriptions","organizations_url":"https://api.github.com/users/blender/orgs","repos_url":"https://api.github.com/users/blender/repos","events_url":"https://api.github.com/users/blender/events{/privacy}","received_events_url":"https://api.github.com/users/blender/received_events","type":"User","site_admin":false},"body":"Some frameworks don't have `Info.plists` and are being currently rejected as binary dependencies.\r\n\r\nThis PR addresses #2500 and also makes sure that .version files are written.\r\n\r\n ","created_at":"2018-06-26T18:37:22Z","updated_at":"2018-06-27T13:20:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3798f76eec199326bad0e95145d12a3f999749f8","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jdhealy","id":782837,"node_id":"MDQ6VXNlcjc4MjgzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/782837?v=4","gravatar_id":"","url":"https://api.github.com/users/jdhealy","html_url":"https://github.com/jdhealy","followers_url":"https://api.github.com/users/jdhealy/followers","following_url":"https://api.github.com/users/jdhealy/following{/other_user}","gists_url":"https://api.github.com/users/jdhealy/gists{/gist_id}","starred_url":"https://api.github.com/users/jdhealy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdhealy/subscriptions","organizations_url":"https://api.github.com/users/jdhealy/orgs","repos_url":"https://api.github.com/users/jdhealy/repos","events_url":"https://api.github.com/users/jdhealy/events{/privacy}","received_events_url":"https://api.github.com/users/jdhealy/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Carthage/Carthage/pulls/2502/commits","review_comments_url":"https://api.github.com/repos/Carthage/Carthage/pulls/2502/comments","review_comment_url":"https://api.github.com/repos/Carthage/Carthage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Carthage/Carthage/issues/2502/comments","statuses_url":"https://api.github.com/repos/Carthage/Carthage/statuses/a0c4a7e1ca774681b882f78ad5b68837447e9322","head":{"label":"blender:fix/issue-2500","ref":"fix/issue-2500","sha":"a0c4a7e1ca774681b882f78ad5b68837447e9322","user":{"login":"blender","id":196761,"node_id":"MDQ6VXNlcjE5Njc2MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/196761?v=4","gravatar_id":"","url":"https://api.github.com/users/blender","html_url":"https://github.com/blender","followers_url":"https://api.github.com/users/blender/followers","following_url":"https://api.github.com/users/blender/following{/other_user}","gists_url":"https://api.github.com/users/blender/gists{/gist_id}","starred_url":"https://api.github.com/users/blender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blender/subscriptions","organizations_url":"https://api.github.com/users/blender/orgs","repos_url":"https://api.github.com/users/blender/repos","events_url":"https://api.github.com/users/blender/events{/privacy}","received_events_url":"https://api.github.com/users/blender/received_events","type":"User","site_admin":false},"repo":{"id":94572731,"node_id":"MDEwOlJlcG9zaXRvcnk5NDU3MjczMQ==","name":"Carthage","full_name":"blender/Carthage","owner":{"login":"blender","id":196761,"node_id":"MDQ6VXNlcjE5Njc2MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/196761?v=4","gravatar_id":"","url":"https://api.github.com/users/blender","html_url":"https://github.com/blender","followers_url":"https://api.github.com/users/blender/followers","following_url":"https://api.github.com/users/blender/following{/other_user}","gists_url":"https://api.github.com/users/blender/gists{/gist_id}","starred_url":"https://api.github.com/users/blender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blender/subscriptions","organizations_url":"https://api.github.com/users/blender/orgs","repos_url":"https://api.github.com/users/blender/repos","events_url":"https://api.github.com/users/blender/events{/privacy}","received_events_url":"https://api.github.com/users/blender/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/blender/Carthage","description":"A simple, decentralized dependency manager for Cocoa","fork":true,"url":"https://api.github.com/repos/blender/Carthage","forks_url":"https://api.github.com/repos/blender/Carthage/forks","keys_url":"https://api.github.com/repos/blender/Carthage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/blender/Carthage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/blender/Carthage/teams","hooks_url":"https://api.github.com/repos/blender/Carthage/hooks","issue_events_url":"https://api.github.com/repos/blender/Carthage/issues/events{/number}","events_url":"https://api.github.com/repos/blender/Carthage/events","assignees_url":"https://api.github.com/repos/blender/Carthage/assignees{/user}","branches_url":"https://api.github.com/repos/blender/Carthage/branches{/branch}","tags_url":"https://api.github.com/repos/blender/Carthage/tags","blobs_url":"https://api.github.com/repos/blender/Carthage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/blender/Carthage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/blender/Carthage/git/refs{/sha}","trees_url":"https://api.github.com/repos/blender/Carthage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/blender/Carthage/statuses/{sha}","languages_url":"https://api.github.com/repos/blender/Carthage/languages","stargazers_url":"https://api.github.com/repos/blender/Carthage/stargazers","contributors_url":"https://api.github.com/repos/blender/Carthage/contributors","subscribers_url":"https://api.github.com/repos/blender/Carthage/subscribers","subscription_url":"https://api.github.com/repos/blender/Carthage/subscription","commits_url":"https://api.github.com/repos/blender/Carthage/commits{/sha}","git_commits_url":"https://api.github.com/repos/blender/Carthage/git/commits{/sha}","comments_url":"https://api.github.com/repos/blender/Carthage/comments{/number}","issue_comment_url":"https://api.github.com/repos/blender/Carthage/issues/comments{/number}","contents_url":"https://api.github.com/repos/blender/Carthage/contents/{+path}","compare_url":"https://api.github.com/repos/blender/Carthage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/blender/Carthage/merges","archive_url":"https://api.github.com/repos/blender/Carthage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/blender/Carthage/downloads","issues_url":"https://api.github.com/repos/blender/Carthage/issues{/number}","pulls_url":"https://api.github.com/repos/blender/Carthage/pulls{/number}","milestones_url":"https://api.github.com/repos/blender/Carthage/milestones{/number}","notifications_url":"https://api.github.com/repos/blender/Carthage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/blender/Carthage/labels{/name}","releases_url":"https://api.github.com/repos/blender/Carthage/releases{/id}","deployments_url":"https://api.github.com/repos/blender/Carthage/deployments","created_at":"2017-06-16T18:52:05Z","updated_at":"2018-06-12T11:07:49Z","pushed_at":"2018-06-27T12:57:50Z","git_url":"git://github.com/blender/Carthage.git","ssh_url":"git@github.com:blender/Carthage.git","clone_url":"https://github.com/blender/Carthage.git","svn_url":"https://github.com/blender/Carthage","homepage":"","size":18377,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Carthage:master","ref":"master","sha":"c0086cfa67ecfa97d1597f59a1c7668aa45f385f","user":{"login":"Carthage","id":9146792,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDY3OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9146792?v=4","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"repo":{"id":25050844,"node_id":"MDEwOlJlcG9zaXRvcnkyNTA1MDg0NA==","name":"Carthage","full_name":"Carthage/Carthage","owner":{"login":"Carthage","id":9146792,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkxNDY3OTI=","avatar_url":"https://avatars1.githubusercontent.com/u/9146792?v=4","gravatar_id":"","url":"https://api.github.com/users/Carthage","html_url":"https://github.com/Carthage","followers_url":"https://api.github.com/users/Carthage/followers","following_url":"https://api.github.com/users/Carthage/following{/other_user}","gists_url":"https://api.github.com/users/Carthage/gists{/gist_id}","starred_url":"https://api.github.com/users/Carthage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carthage/subscriptions","organizations_url":"https://api.github.com/users/Carthage/orgs","repos_url":"https://api.github.com/users/Carthage/repos","events_url":"https://api.github.com/users/Carthage/events{/privacy}","received_events_url":"https://api.github.com/users/Carthage/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Carthage/Carthage","description":"A simple, decentralized dependency manager for Cocoa","fork":false,"url":"https://api.github.com/repos/Carthage/Carthage","forks_url":"https://api.github.com/repos/Carthage/Carthage/forks","keys_url":"https://api.github.com/repos/Carthage/Carthage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Carthage/Carthage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Carthage/Carthage/teams","hooks_url":"https://api.github.com/repos/Carthage/Carthage/hooks","issue_events_url":"https://api.github.com/repos/Carthage/Carthage/issues/events{/number}","events_url":"https://api.github.com/repos/Carthage/Carthage/events","assignees_url":"https://api.github.com/repos/Carthage/Carthage/assignees{/user}","branches_url":"https://api.github.com/repos/Carthage/Carthage/branches{/branch}","tags_url":"https://api.github.com/repos/Carthage/Carthage/tags","blobs_url":"https://api.github.com/repos/Carthage/Carthage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Carthage/Carthage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Carthage/Carthage/git/refs{/sha}","trees_url":"https://api.github.com/repos/Carthage/Carthage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Carthage/Carthage/statuses/{sha}","languages_url":"https://api.github.com/repos/Carthage/Carthage/languages","stargazers_url":"https://api.github.com/repos/Carthage/Carthage/stargazers","contributors_url":"https://api.github.com/repos/Carthage/Carthage/contributors","subscribers_url":"https://api.github.com/repos/Carthage/Carthage/subscribers","subscription_url":"https://api.github.com/repos/Carthage/Carthage/subscription","commits_url":"https://api.github.com/repos/Carthage/Carthage/commits{/sha}","git_commits_url":"https://api.github.com/repos/Carthage/Carthage/git/commits{/sha}","comments_url":"https://api.github.com/repos/Carthage/Carthage/comments{/number}","issue_comment_url":"https://api.github.com/repos/Carthage/Carthage/issues/comments{/number}","contents_url":"https://api.github.com/repos/Carthage/Carthage/contents/{+path}","compare_url":"https://api.github.com/repos/Carthage/Carthage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Carthage/Carthage/merges","archive_url":"https://api.github.com/repos/Carthage/Carthage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Carthage/Carthage/downloads","issues_url":"https://api.github.com/repos/Carthage/Carthage/issues{/number}","pulls_url":"https://api.github.com/repos/Carthage/Carthage/pulls{/number}","milestones_url":"https://api.github.com/repos/Carthage/Carthage/milestones{/number}","notifications_url":"https://api.github.com/repos/Carthage/Carthage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Carthage/Carthage/labels{/name}","releases_url":"https://api.github.com/repos/Carthage/Carthage/releases{/id}","deployments_url":"https://api.github.com/repos/Carthage/Carthage/deployments","created_at":"2014-10-10T19:54:55Z","updated_at":"2018-06-27T06:51:45Z","pushed_at":"2018-06-27T12:57:51Z","git_url":"git://github.com/Carthage/Carthage.git","ssh_url":"git@github.com:Carthage/Carthage.git","clone_url":"https://github.com/Carthage/Carthage.git","svn_url":"https://github.com/Carthage/Carthage","homepage":"","size":18422,"stargazers_count":11674,"watchers_count":11674,"language":"Swift","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1104,"mirror_url":null,"archived":false,"open_issues_count":180,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1104,"open_issues":180,"watchers":11674,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/2502"},"html":{"href":"https://github.com/Carthage/Carthage/pull/2502"},"issue":{"href":"https://api.github.com/repos/Carthage/Carthage/issues/2502"},"comments":{"href":"https://api.github.com/repos/Carthage/Carthage/issues/2502/comments"},"review_comments":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/2502/comments"},"review_comment":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Carthage/Carthage/pulls/2502/commits"},"statuses":{"href":"https://api.github.com/repos/Carthage/Carthage/statuses/a0c4a7e1ca774681b882f78ad5b68837447e9322"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mdiep"}}