{"action":"created","comment":{"url":"https://api.github.com/repos/apple/swift/pulls/comments/46779838","id":46779838,"diff_hunk":"@@ -1,18 +1,25 @@\n set(sources\n-  module.map\n+  module.map.in\n   )\n set(output_dir \"${SWIFTLIB_DIR}/glibc\")\n \n-set(commands\n-    COMMAND ${CMAKE_COMMAND} \"-E\" \"make_directory\" \"${output_dir}\")\n-set(outputs)\n+# Set correct paths to glibc headers\n+set(GLIBC_INCLUDE_PATH \"/usr/include\")\n+set(arch_dir \"x86_64-linux-gnu\")\n+if (EXISTS \"${GLIBC_INCLUDE_PATH}/${arch_dir}/sys\")\n+    set(GLIBC_ARCH_INCLUDE_PATH \"${GLIBC_INCLUDE_PATH}/${arch_dir}\")\n+elseif(EXISTS \"${GLIBC_INCLUDE_PATH}/sys\")\n+    set(GLIBC_ARCH_INCLUDE_PATH \"${GLIBC_INCLUDE_PATH}\")\n+else()\n+    message( FATAL_ERROR \"Glibc headers were not found.\" )\n+endif()\n+\n+# Substitute paths\n foreach(input ${sources})\n-  list(APPEND commands\n-      COMMAND\n-        \"${CMAKE_COMMAND}\" \"-E\" \"copy_if_different\"\n-        \"${CMAKE_CURRENT_SOURCE_DIR}/${input}\"\n-        \"${output_dir}/${input}\")\n-  list(APPEND outputs \"${output_dir}/${input}\")\n+    string(REGEX MATCH \"^(.*)\\\\.[^.]*$\" dummy ${input})","path":"stdlib/public/Glibc/CMakeLists.txt","position":29,"original_position":29,"commit_id":"1487d75a93a63a87d3e37b3a6d643053c00519ac","original_commit_id":"1487d75a93a63a87d3e37b3a6d643053c00519ac","user":{"login":"gribozavr","id":1120569,"avatar_url":"https://avatars.githubusercontent.com/u/1120569?v=3","gravatar_id":"","url":"https://api.github.com/users/gribozavr","html_url":"https://github.com/gribozavr","followers_url":"https://api.github.com/users/gribozavr/followers","following_url":"https://api.github.com/users/gribozavr/following{/other_user}","gists_url":"https://api.github.com/users/gribozavr/gists{/gist_id}","starred_url":"https://api.github.com/users/gribozavr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gribozavr/subscriptions","organizations_url":"https://api.github.com/users/gribozavr/orgs","repos_url":"https://api.github.com/users/gribozavr/repos","events_url":"https://api.github.com/users/gribozavr/events{/privacy}","received_events_url":"https://api.github.com/users/gribozavr/received_events","type":"User","site_admin":false},"body":"Please double-quote `\"${input}\"` for consistency, here and elsewhere.","created_at":"2015-12-07T00:56:23Z","updated_at":"2015-12-07T00:56:23Z","html_url":"https://github.com/apple/swift/pull/282#discussion_r46779838","pull_request_url":"https://api.github.com/repos/apple/swift/pulls/282","_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/comments/46779838"},"html":{"href":"https://github.com/apple/swift/pull/282#discussion_r46779838"},"pull_request":{"href":"https://api.github.com/repos/apple/swift/pulls/282"}}},"pull_request":{"url":"https://api.github.com/repos/apple/swift/pulls/282","id":52788067,"html_url":"https://github.com/apple/swift/pull/282","diff_url":"https://github.com/apple/swift/pull/282.diff","patch_url":"https://github.com/apple/swift/pull/282.patch","issue_url":"https://api.github.com/repos/apple/swift/issues/282","number":282,"state":"open","locked":false,"title":"Glibc module: detect location of glibc header files","user":{"login":"orobio","id":16155254,"avatar_url":"https://avatars.githubusercontent.com/u/16155254?v=3","gravatar_id":"","url":"https://api.github.com/users/orobio","html_url":"https://github.com/orobio","followers_url":"https://api.github.com/users/orobio/followers","following_url":"https://api.github.com/users/orobio/following{/other_user}","gists_url":"https://api.github.com/users/orobio/gists{/gist_id}","starred_url":"https://api.github.com/users/orobio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orobio/subscriptions","organizations_url":"https://api.github.com/users/orobio/orgs","repos_url":"https://api.github.com/users/orobio/repos","events_url":"https://api.github.com/users/orobio/events{/privacy}","received_events_url":"https://api.github.com/users/orobio/received_events","type":"User","site_admin":false},"body":"In the Glibc module map all sys/... header files had the following paths:\r\n/usr/include/x86_64-linux-gnu/sys/..., but some distros install them in\r\n/usr/include/sys/...\r\n\r\nI tried using relative paths and make the compiler find them, but apparently it doesn't work that way. Since the paths are already absolute I guess that's how it's supposed to be, so this seems the best solution to me. If someone has a better suggestion, please let me know. This is verified on Fedora 23 and Ubuntu 15.10.\r\n\r\nI'm new to clang, CMake and GitHub, so feel free to point out anything that could be improved.","created_at":"2015-12-06T19:33:28Z","updated_at":"2015-12-07T00:56:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6653c447d752e5544d29acaaca004069356787e1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apple/swift/pulls/282/commits","review_comments_url":"https://api.github.com/repos/apple/swift/pulls/282/comments","review_comment_url":"https://api.github.com/repos/apple/swift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apple/swift/issues/282/comments","statuses_url":"https://api.github.com/repos/apple/swift/statuses/1487d75a93a63a87d3e37b3a6d643053c00519ac","head":{"label":"orobio:detect-location-of-glibc-headers","ref":"detect-location-of-glibc-headers","sha":"1487d75a93a63a87d3e37b3a6d643053c00519ac","user":{"login":"orobio","id":16155254,"avatar_url":"https://avatars.githubusercontent.com/u/16155254?v=3","gravatar_id":"","url":"https://api.github.com/users/orobio","html_url":"https://github.com/orobio","followers_url":"https://api.github.com/users/orobio/followers","following_url":"https://api.github.com/users/orobio/following{/other_user}","gists_url":"https://api.github.com/users/orobio/gists{/gist_id}","starred_url":"https://api.github.com/users/orobio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orobio/subscriptions","organizations_url":"https://api.github.com/users/orobio/orgs","repos_url":"https://api.github.com/users/orobio/repos","events_url":"https://api.github.com/users/orobio/events{/privacy}","received_events_url":"https://api.github.com/users/orobio/received_events","type":"User","site_admin":false},"repo":{"id":47490250,"name":"swift","full_name":"orobio/swift","owner":{"login":"orobio","id":16155254,"avatar_url":"https://avatars.githubusercontent.com/u/16155254?v=3","gravatar_id":"","url":"https://api.github.com/users/orobio","html_url":"https://github.com/orobio","followers_url":"https://api.github.com/users/orobio/followers","following_url":"https://api.github.com/users/orobio/following{/other_user}","gists_url":"https://api.github.com/users/orobio/gists{/gist_id}","starred_url":"https://api.github.com/users/orobio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orobio/subscriptions","organizations_url":"https://api.github.com/users/orobio/orgs","repos_url":"https://api.github.com/users/orobio/repos","events_url":"https://api.github.com/users/orobio/events{/privacy}","received_events_url":"https://api.github.com/users/orobio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/orobio/swift","description":"The Swift Programming Language","fork":true,"url":"https://api.github.com/repos/orobio/swift","forks_url":"https://api.github.com/repos/orobio/swift/forks","keys_url":"https://api.github.com/repos/orobio/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/orobio/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/orobio/swift/teams","hooks_url":"https://api.github.com/repos/orobio/swift/hooks","issue_events_url":"https://api.github.com/repos/orobio/swift/issues/events{/number}","events_url":"https://api.github.com/repos/orobio/swift/events","assignees_url":"https://api.github.com/repos/orobio/swift/assignees{/user}","branches_url":"https://api.github.com/repos/orobio/swift/branches{/branch}","tags_url":"https://api.github.com/repos/orobio/swift/tags","blobs_url":"https://api.github.com/repos/orobio/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/orobio/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/orobio/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/orobio/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/orobio/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/orobio/swift/languages","stargazers_url":"https://api.github.com/repos/orobio/swift/stargazers","contributors_url":"https://api.github.com/repos/orobio/swift/contributors","subscribers_url":"https://api.github.com/repos/orobio/swift/subscribers","subscription_url":"https://api.github.com/repos/orobio/swift/subscription","commits_url":"https://api.github.com/repos/orobio/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/orobio/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/orobio/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/orobio/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/orobio/swift/contents/{+path}","compare_url":"https://api.github.com/repos/orobio/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/orobio/swift/merges","archive_url":"https://api.github.com/repos/orobio/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/orobio/swift/downloads","issues_url":"https://api.github.com/repos/orobio/swift/issues{/number}","pulls_url":"https://api.github.com/repos/orobio/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/orobio/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/orobio/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/orobio/swift/labels{/name}","releases_url":"https://api.github.com/repos/orobio/swift/releases{/id}","created_at":"2015-12-06T09:10:55Z","updated_at":"2015-12-06T09:11:12Z","pushed_at":"2015-12-06T16:12:09Z","git_url":"git://github.com/orobio/swift.git","ssh_url":"git@github.com:orobio/swift.git","clone_url":"https://github.com/orobio/swift.git","svn_url":"https://github.com/orobio/swift","homepage":"","size":58159,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"apple:master","ref":"master","sha":"814b3d2996b7df80d3f65761fe40cc96c4447571","user":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"repo":{"id":44838949,"name":"swift","full_name":"apple/swift","owner":{"login":"apple","id":10639145,"avatar_url":"https://avatars.githubusercontent.com/u/10639145?v=3","gravatar_id":"","url":"https://api.github.com/users/apple","html_url":"https://github.com/apple","followers_url":"https://api.github.com/users/apple/followers","following_url":"https://api.github.com/users/apple/following{/other_user}","gists_url":"https://api.github.com/users/apple/gists{/gist_id}","starred_url":"https://api.github.com/users/apple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apple/subscriptions","organizations_url":"https://api.github.com/users/apple/orgs","repos_url":"https://api.github.com/users/apple/repos","events_url":"https://api.github.com/users/apple/events{/privacy}","received_events_url":"https://api.github.com/users/apple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apple/swift","description":"The Swift Programming Language","fork":false,"url":"https://api.github.com/repos/apple/swift","forks_url":"https://api.github.com/repos/apple/swift/forks","keys_url":"https://api.github.com/repos/apple/swift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apple/swift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apple/swift/teams","hooks_url":"https://api.github.com/repos/apple/swift/hooks","issue_events_url":"https://api.github.com/repos/apple/swift/issues/events{/number}","events_url":"https://api.github.com/repos/apple/swift/events","assignees_url":"https://api.github.com/repos/apple/swift/assignees{/user}","branches_url":"https://api.github.com/repos/apple/swift/branches{/branch}","tags_url":"https://api.github.com/repos/apple/swift/tags","blobs_url":"https://api.github.com/repos/apple/swift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apple/swift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apple/swift/git/refs{/sha}","trees_url":"https://api.github.com/repos/apple/swift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apple/swift/statuses/{sha}","languages_url":"https://api.github.com/repos/apple/swift/languages","stargazers_url":"https://api.github.com/repos/apple/swift/stargazers","contributors_url":"https://api.github.com/repos/apple/swift/contributors","subscribers_url":"https://api.github.com/repos/apple/swift/subscribers","subscription_url":"https://api.github.com/repos/apple/swift/subscription","commits_url":"https://api.github.com/repos/apple/swift/commits{/sha}","git_commits_url":"https://api.github.com/repos/apple/swift/git/commits{/sha}","comments_url":"https://api.github.com/repos/apple/swift/comments{/number}","issue_comment_url":"https://api.github.com/repos/apple/swift/issues/comments{/number}","contents_url":"https://api.github.com/repos/apple/swift/contents/{+path}","compare_url":"https://api.github.com/repos/apple/swift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apple/swift/merges","archive_url":"https://api.github.com/repos/apple/swift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apple/swift/downloads","issues_url":"https://api.github.com/repos/apple/swift/issues{/number}","pulls_url":"https://api.github.com/repos/apple/swift/pulls{/number}","milestones_url":"https://api.github.com/repos/apple/swift/milestones{/number}","notifications_url":"https://api.github.com/repos/apple/swift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apple/swift/labels{/name}","releases_url":"https://api.github.com/repos/apple/swift/releases{/id}","created_at":"2015-10-23T21:15:07Z","updated_at":"2015-12-07T00:52:45Z","pushed_at":"2015-12-07T00:33:56Z","git_url":"git://github.com/apple/swift.git","ssh_url":"git@github.com:apple/swift.git","clone_url":"https://github.com/apple/swift.git","svn_url":"https://github.com/apple/swift","homepage":"","size":71946,"stargazers_count":19304,"watchers_count":19304,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2196,"mirror_url":null,"open_issues_count":47,"forks":2196,"open_issues":47,"watchers":19304,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apple/swift/pulls/282"},"html":{"href":"https://github.com/apple/swift/pull/282"},"issue":{"href":"https://api.github.com/repos/apple/swift/issues/282"},"comments":{"href":"https://api.github.com/repos/apple/swift/issues/282/comments"},"review_comments":{"href":"https://api.github.com/repos/apple/swift/pulls/282/comments"},"review_comment":{"href":"https://api.github.com/repos/apple/swift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apple/swift/pulls/282/commits"},"statuses":{"href":"https://api.github.com/repos/apple/swift/statuses/1487d75a93a63a87d3e37b3a6d643053c00519ac"}}}}