{"action":"closed","issue":{"url":"https://api.github.com/repos/Homebrew/brew/issues/6570","repository_url":"https://api.github.com/repos/Homebrew/brew","labels_url":"https://api.github.com/repos/Homebrew/brew/issues/6570/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/brew/issues/6570/comments","events_url":"https://api.github.com/repos/Homebrew/brew/issues/6570/events","html_url":"https://github.com/Homebrew/brew/issues/6570","id":504802717,"node_id":"MDU6SXNzdWU1MDQ4MDI3MTc=","number":6570,"title":"Homebrew Clang cannot find include directories","user":{"login":"ssbanerje","id":732178,"node_id":"MDQ6VXNlcjczMjE3OA==","avatar_url":"https://avatars3.githubusercontent.com/u/732178?v=4","gravatar_id":"","url":"https://api.github.com/users/ssbanerje","html_url":"https://github.com/ssbanerje","followers_url":"https://api.github.com/users/ssbanerje/followers","following_url":"https://api.github.com/users/ssbanerje/following{/other_user}","gists_url":"https://api.github.com/users/ssbanerje/gists{/gist_id}","starred_url":"https://api.github.com/users/ssbanerje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ssbanerje/subscriptions","organizations_url":"https://api.github.com/users/ssbanerje/orgs","repos_url":"https://api.github.com/users/ssbanerje/repos","events_url":"https://api.github.com/users/ssbanerje/events{/privacy}","received_events_url":"https://api.github.com/users/ssbanerje/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-10-09T17:56:04Z","updated_at":"2019-10-09T18:21:54Z","closed_at":"2019-10-09T18:21:54Z","author_association":"NONE","body":"Homebrew Clang does not search the correct include directories in MacOS Catalina.\r\n\r\n# What you were trying to do (and why)\r\nIf I try to compile the following C file after installing LLVM+Clang from homebrew\r\n```c\r\n#include <stdio.h>\r\n\r\nint main() {\r\nprintf(\"hi\");\r\n}\r\n```\r\n\r\n# What happened\r\nI get the error\r\n```\r\n» which clang                                                                                                                                                                                             1 ↵\r\n/usr/local/opt/llvm/bin/clang\r\n» clang test.c\r\nIn file included from test.c:1:\r\n/Library/Developer/CommandLineTools/usr/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found\r\n#include_next <stdio.h>\r\n              ^~~~~~~~~\r\n1 error generated.\r\n```\r\n\r\n# What you expected to happen\r\nThe program to compile.\r\n\r\nHowever, if I alias clang to the system clang, \r\n```\r\n» alias clang=/usr/bin/clang                                                                                                                                                                              1 ↵\r\n» clang test.c\r\n» ./a.out\r\nhi%\r\n```\r\n\r\nBy default the Homebrew clang has the following search paths\r\n```\r\n» echo | clang -E -Wp,-v -\r\nclang -cc1 version 9.0.0 based upon LLVM 9.0.0 default target x86_64-apple-darwin19.0.0\r\nignoring nonexistent directory \"/usr/include\"\r\n#include \"...\" search starts here:\r\n#include <...> search starts here:\r\n /usr/local/include\r\n /usr/local/Cellar/llvm/9.0.0/lib/clang/9.0.0/include\r\n /System/Library/Frameworks (framework directory)\r\n /Library/Frameworks (framework directory)\r\nEnd of search list.\r\n# 1 \"<stdin>\"\r\n# 1 \"<built-in>\" 1\r\n# 1 \"<built-in>\" 3\r\n# 352 \"<built-in>\" 3\r\n# 1 \"<command line>\" 1\r\n# 1 \"<built-in>\" 2\r\n# 1 \"<stdin>\" 2\r\n```\r\n\r\nThe system clang looks in different folders\r\n```\r\n» alias clang=/usr/bin/clang\r\n» echo | clang -E -Wp,-v -\r\nclang -cc1 version 11.0.0 (clang-1100.0.33.8) default target x86_64-apple-darwin19.0.0\r\nignoring nonexistent directory \"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include\"\r\nignoring nonexistent directory \"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks\"\r\n#include \"...\" search starts here:\r\n#include <...> search starts here:\r\n /usr/local/include\r\n /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include\r\n /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include\r\n /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include\r\n /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)\r\nEnd of search list.\r\n# 1 \"<stdin>\"\r\n# 1 \"<built-in>\" 1\r\n# 1 \"<built-in>\" 3\r\n# 362 \"<built-in>\" 3\r\n# 1 \"<command line>\" 1\r\n# 1 \"<built-in>\" 2\r\n# 1 \"<stdin>\" 2\r\n```\r\n\r\n\r\nHomebrew is updated to the latest version and doctor does not report any problems.\r\n\r\n```\r\n» brew -v                                                                                                                                                                                                 1 ↵\r\nHomebrew 2.1.13\r\nHomebrew/homebrew-core (git revision 4d523; last commit 2019-10-09)\r\nHomebrew/homebrew-cask (git revision c4f9d3; last commit 2019-10-09)\r\n\r\n» brew doctor\r\nYour system is ready to brew.\r\n\r\n» brew config\r\nHOMEBREW_VERSION: 2.1.13\r\nORIGIN: https://github.com/Homebrew/brew.git\r\nHEAD: aa043c1d678afd26f50156a83417c296cb9d5a4b\r\nLast commit: 24 hours ago\r\nCore tap ORIGIN: https://github.com/Homebrew/homebrew-core\r\nCore tap HEAD: 4d5233f01f792cb83661ccc1a6abfb139c168951\r\nCore tap last commit: 4 hours ago\r\nHOMEBREW_PREFIX: /usr/local\r\nHOMEBREW_VISUAL: nvim\r\nCPU: quad-core 64-bit broadwell\r\nHomebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby\r\nClang: 11.0 build 1100\r\nGit: 2.23.0 => /usr/local/bin/git\r\nCurl: 7.64.1 => /usr/bin/curl\r\nJava: 12.0.1, 1.8.0_131, 1.8.0_40\r\nmacOS: 10.15-x86_64\r\nCLT: 11.0.0.0.1.1567737322\r\nXcode: 11.1\r\nCLT headers: 11.0.0.0.1.1567737322\r\nXQuartz: 2.7.11 => /opt/X11\r\n```\r\n\r\n# Step-by-step reproduction instructions (by running brew commands)\r\n```\r\nbrew install llvm\r\nexport PATH=\"/usr/local/opt/llvm/bin:$PATH\"\r\nclang test.c\r\n```"}}
{"actor":{"display_login":"ssbanerje"}}