ycm-core/ycmd

Python 3.10.* compile support

onionyst opened this issue · 1 comments

cpp/CMakeLists.txt says ycmd supports Python 3.10:

find_package( Python3 3.6...3.10 REQUIRED COMPONENTS Interpreter Development )

While Python 3.10 successfully compiles ycmd, Python 3.10.1 is rejected by this find_package check. I wonder if we can relax this restriction if later Python 3.10 versions are tested okay.

Compile log with Python 3.10.1 on macOS 12.0.1 (M1)

$ cd ~/.vim/bundle/YouCompleteMe
$ python3.10 install.py --clang-completer --go-completer --java-completer --ts-completer --system-libclang

Generating ycmd build configuration...-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Python3: Found unsuitable version "3.10.1", required range
  is "3.6...3.10" (found
  /Library/Frameworks/Python.framework/Versions/3.10/bin/python3.10, found
  components: Interpreter Development Development.Module Development.Embed)
Call Stack (most recent call first):
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:592 (_FPHSA_FAILURE_MESSAGE)
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPython/Support.cmake:3166 (find_package_handle_standard_args)
  /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPython3.cmake:490 (include)
  CMakeLists.txt:235 (find_package)


-- Configuring incomplete, errors occurred!
See also "/private/var/folders/51/p8vdz3c53gd27dfbgsrswwzh0000gn/T/ycm_build_v2ke2mnf/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/51/p8vdz3c53gd27dfbgsrswwzh0000gn/T/ycm_build_v2ke2mnf/CMakeFiles/CMakeError.log".

FAILED

ERROR: the build failed.

NOTE: it is *highly* unlikely that this is a bug but rather that this is a problem with the configuration of your system or a missing dependency. Please carefully read CONTRIBUTING.md and if you're sure that it is a bug, please raise an issue on the issue tracker, including the entire output of this script (with --verbose) and the invocation line used to run it.

The installation failed; please see above for the actual error. In order to get more information, please re-run the command, adding the --verbose flag. If you think this is a bug and you raise an issue, you MUST include the *full verbose* output.

Thanks, I can repro with 3.10.1.

I noticed actually that we have another problem: Version ranges are only supported on Make 3.19 or later, but we're using them with min version 3.14:

A version range with the format versionMin...[<]versionMax where versionMin and versionMax have the same format and constraints on components being integers as the single version. By default, both end points are included. By specifying <, the upper end point will be excluded. Version ranges are only supported with CMake 3.19 or later.

I think the solution is to just say we support 3.6 as a minimum, which is essentially the truth.

I'll make a PR.