Skip to content

fix: more readable error on missing ccmake#667

Merged
henryiii merged 2 commits intoscikit-build:mainfrom
Andrej730:ccmake-missing
Feb 3, 2026
Merged

fix: more readable error on missing ccmake#667
henryiii merged 2 commits intoscikit-build:mainfrom
Andrej730:ccmake-missing

Conversation

@Andrej730
Copy link
Contributor

@Andrej730 Andrej730 commented Dec 11, 2025

I've stumbled upon the error below, trying to use ccmake. Adding a bit more readable error for this case.

uv tool install cmake
# Installed 4 executables: ccmake, cmake, cpack, ctest
ccmake --version 
# Traceback (most recent call last):
#   File "<frozen runpy>", line 198, in _run_module_as_main
#   File "<frozen runpy>", line 88, in _run_code
#   File "C:\Users\Andrej\.local\bin\ccmake.exe\__main__.py", line 10, in <module>
#     sys.exit(ccmake())
#              ~~~~~~^^
#   File "L:\UV_TOOL_DIR\cmake\Lib\site-packages\cmake\__init__.py", line 53, in ccmake
#     _program_exit('ccmake', *sys.argv[1:])
#     ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "L:\UV_TOOL_DIR\cmake\Lib\site-packages\cmake\__init__.py", line 47, in _program_exit
#     raise SystemExit(_program(name, args))
#                      ~~~~~~~~^^^^^^^^^^^^
#   File "L:\UV_TOOL_DIR\cmake\Lib\site-packages\cmake\__init__.py", line 43, in _program
#     return subprocess.call([os.path.join(CMAKE_BIN_DIR, name), *args], close_fds=False)
#            ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "L:\UV_PYTHON_INSTALL_DIR\cpython-3.14.0-windows-x86_64-none\Lib\subprocess.py", line 395, in call
#     with Popen(*popenargs, **kwargs) as p:
#          ~~~~~^^^^^^^^^^^^^^^^^^^^^^
#   File "L:\UV_PYTHON_INSTALL_DIR\cpython-3.14.0-windows-x86_64-none\Lib\subprocess.py", line 1038, in __init__
#     self._execute_child(args, executable, preexec_fn, close_fds,
#     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#                         pass_fds, cwd, env,
#                         ^^^^^^^^^^^^^^^^^^^
#     ...<5 lines>...
#                         gid, gids, uid, umask,
#                         ^^^^^^^^^^^^^^^^^^^^^^
#                         start_new_session, process_group)
#                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "L:\UV_PYTHON_INSTALL_DIR\cpython-3.14.0-windows-x86_64-none\Lib\subprocess.py", line 1552, in _execute_child
#     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
#                        ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
#                              # no special security
#                              ^^^^^^^^^^^^^^^^^^^^^
#     ...<4 lines>...
#                              cwd,
#                              ^^^^
#                              startupinfo)
#                              ^^^^^^^^^^^^
# FileNotFoundError: [WinError 2] The system cannot find the file specified

@henryiii
Copy link
Contributor

henryiii commented Dec 11, 2025

If you ran cmake --version, why is it looking for ccmake? Also, according to the line above, it did install ccmake. (No issue with better error messages, but might be something fixable?)

@Andrej730
Copy link
Contributor Author

If you ran cmake --version, why is it looking for ccmake?

cmake --version was a mistake when typing example above, I meant ccmake --version, fixed.

Also, according to the line above, it did install ccmake. (No issue with better error messages, but might be something fixable?)

It did installed ccmake meaning ccmake.exe script as in project.scripts:

[project.scripts]
ccmake = "cmake:ccmake"
cmake = "cmake:cmake"
cpack = "cmake:cpack"
ctest = "cmake:ctest"

But the way this script works, it imports cmake module and executes corresponding ccmake method below:

def ccmake() -> NoReturn:
if not (Path(CMAKE_BIN_DIR) / "ccmake").exists():
raise FileNotFoundError(f"'ccmake' is not available in cmake installation at {CMAKE_BIN_DIR}.")
_program_exit('ccmake', *sys.argv[1:])

And ccmake.exe is not included in the package (at least on Windows) as probably part of #66 and also there are issues upstream (https://gitlab.kitware.com/cmake/cmake/-/issues/18053).

image

@henryiii
Copy link
Contributor

Ahh, excellent, thank you. We could make the entry points dynamic, but that would be nicer if PEP 808 is accepted. I had missed it isn't in the official distribution, which we use.

@Andrej730
Copy link
Contributor Author

Removing/adding entry point dynamically would be more proper solution, but I'm not familar with scikit build backend, so I'd rather keep this PR as just a clarified error message.

@henryiii henryiii merged commit 6d23b00 into scikit-build:main Feb 3, 2026
54 of 55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants