pywatchman build does not make proper use of `CMAKE_INSTALL_PREFIX`
- Dominant language
- C++
- Stars
- 13.7k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
I recently updated Homebrew's version of Watchman (cf. https://github.com/Homebrew/homebrew-core/pull/78595) where I encountered a strange bug in the way the pywatchman build seems to make use of `CMAKE_INSTALL_PREFIX`.
I built Watchman by invoking CMake directly instead of using the `getdeps.py` script since we (Homebrew) have a policy of using Homebrew dependencies where available. When invoking CMake, we define `CMAKE_INSTALL_PREFIX` in order to specify the install prefix. This prefix should look something like `${HOMEBREW_PREFIX}/Cellar/watchman/2021.05.31.00`.
It builds fine, except that I discovered that pywatchman was being installed into `${CMAKE_INSTALL_PREFIX}/${HOMEBREW_PREFIX}`. (See [workaround](https://github.com/Homebrew/homebrew-core/blob/7033ad8c4acca1e821274c0f3323b0a4b7e8971e/Formula/watchman.rb#L42-L45).) Not really sure why that's happening, but I imagine that specifying `CMAKE_INSTALL_PREFIX` should just Do The Right Thing here.
This looks like the relevant code:
https://github.com/facebook/watchman/blob/b14b0bdfc9ec8e163df9df4f42fa8a51eb3bbd63/CMakeLists.txt#L390-L395
However, I fail to see how the Python call here ends up with the odd install prefix I mention above.
Contributor guide
Assessment
This issue has not been assessed yet.