"file INSTALL cannot find <file>" 尝试使用 Homebrew 安装 CMake 时

"file INSTALL cannot find <file>" when attempting to install CMake with Homebrew

问题

在 MacOS 10.13 上 运行 brew install cmake 安装 CMake 失败。 CMake 是我需要通过 Homebrew 安装的其他包的依赖项。

我看到的错误是:

/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f Source/CMakeFiles/ctest.dir/build.make Source/CMakeFiles/ctest.dir/build
make[2]: Nothing to be done for `Source/CMakeFiles/ctest.dir/build'.
[100%] Built target ctest
[100%] Built target documentation
/private/tmp/cmake-20210518-66635-xtovhf/cmake-3.20.2/Bootstrap.cmk/cmake -E cmake_progress_start /tmp/cmake-20210518-66635-xtovhf/cmake-3.20.2/CMakeFiles 0
/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 preinstall
make[1]: Nothing to be done for `preinstall'.
Install the project...
bin/cmake -P cmake_install.cmake
-- Install configuration: "Release"
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmsys/Copyright.txt
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmlibrhash/COPYING
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmzstd/LICENSE
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmliblzma/COPYING
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmlibarchive/COPYING
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/doc/cmake/cmlibuv/LICENSE
-- Installing: /usr/local/Cellar/cmake/3.20.2/bin/ccmake
-- Installing: /usr/local/Cellar/cmake/3.20.2/bin/cmake
-- Installing: /usr/local/Cellar/cmake/3.20.2/bin/ctest
-- Installing: /usr/local/Cellar/cmake/3.20.2/bin/cpack
-- Installing: /usr/local/Cellar/cmake/3.20.2/share/cmake/include/cmCPluginAPI.h
CMake Error at Utilities/Sphinx/cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/tmp/cmake-20210518-66635-xtovhf/cmake-3.20.2/Utilities/Sphinx/man/ccmake.1":
  No such file or directory.
Call Stack (most recent call first):
  Utilities/cmake_install.cmake:47 (include)
  cmake_install.cmake:102 (include)


以下是 Homebrew 日志中的一些信息,可能有用也可能没用:

HOMEBREW_VERSION: 3.1.7
ORIGIN: https://github.com/Homebrew/brew
HEAD: 92cf9047191393a2d624c64fc28d9595309ba273
Last commit: 7 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d419775e7df0949c2e1d4facc437f52eef8b9f67
Core tap last commit: 4 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 12
HOMEBREW_NO_BOOTSNAP: set
Homebrew Ruby: 2.6.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3_2/bin/ruby
CPU: dodeca-core 64-bit kabylake
Clang: 10.0.0 build 1000
Git: 2.17.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
macOS: 10.13.6-x86_64
CLT: 10.1.0.0.1.1539992718
Xcode: 10.1

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j12
CMAKE_PREFIX_PATH: /usr/local/opt/sphinx-doc:/usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.13
HOMEBREW_GIT: git
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Homebrew/Library/Homebrew/shims/mac/super:/usr/local/opt/sphinx-doc/bin:/usr/bin:/bin:/usr/sbin:/sbin

我不明白为什么会出现“文件安装找不到”错误,因为安装脚本应该处理此 /tmp/xxxxx 文件的生成、删除或移动。如果这是 PATH 问题或其他问题,我希望在日志中看到它。

我试过的

我尝试寻找 CMake 安装位置以查看 cmake_install 文件到底在做什么,但找不到它。

我今天也遇到了这个问题。

我认为这与此处提到的补丁有关:https://gitlab.kitware.com/cmake/cmake/-/issues/22192

重新安装 sphinx-doc 后我的问题消失了:

brew reinstall sphinx-doc

我想这就是它的作用——希望它对你有用。