For me "make install" when using cmake fails with: Install the project... -- Install configuration: "" -- Installing: /usr/local/./include CMake Error at cmake_install.cmake:36 (FILE): file Problem setting permissions on directory "/usr/local/./include" Indeed I don't have permission to change permissions on /usr/local/./include. And why would I need to? There's no problem installing files inside that directory, and setting their permissions. I think the fact that cmake is trying to set permissions on /usr/local/include is a bug.
Is this an LLVM bug though, or a cmake bug?
I don't know - cmake is an opaque mystery to me. How can I tell?
I CCed Doug in the hopes he would know.
This seems likely to be this CMake bug: http://public.kitware.com/Bug/view.php?id=10978
Created attachment 11949 [details] LLVM patch to avoid setting include/ permissions
Created attachment 11950 [details] Clang patch to avoid setting include/ permissions
This is actually a bug in LLVM and Clang's CMake code and not in CMake. The install(DIRECTORY) command documents how it sets permissions on directories, and it is consistent with the behavior observed here. We should not ask CMake to install the top-level "include/" directory for us because it is not exclusive to LLVM or Clang. Instead we should ask it only to handle the "include/llvm", "include/llvm-c", "include/clang", and "include/clang-c" subdirectories. I've just attached a patch to LLVM and another to Clang to fix this issue.
(In reply to comment #7) > This is actually a bug in LLVM and Clang's CMake code and not in CMake. The > install(DIRECTORY) command documents how it sets permissions on directories, > and it is consistent with the behavior observed here. We should not ask > CMake to install the top-level "include/" directory for us because it is not > exclusive to LLVM or Clang. Instead we should ask it only to handle the > "include/llvm", "include/llvm-c", "include/clang", and "include/clang-c" > subdirectories. > > I've just attached a patch to LLVM and another to Clang to fix this issue. Can you post it to the commit list for review? (Or use Phabricator to do so?) Thanks for tracking down the root cause of this issue.
(In reply to comment #8) > Can you post it to the commit list for review? http://thread.gmane.org/gmane.comp.compilers.llvm.cvs/173963
I had been missing this PR for long time, ... :( Fixed in r201075 and r201076. I have confirmed Brad fixed this issue with prerequisites: - root owns PREFIX. - subdirectories, bin, include, lib, and share are owned by root but writable to installer. (in this case, me)