Add vLLM-metax vllm metax cmake presets validate compiler#308
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces validation for the CUDA compiler path in tools/generate_cmake_presets.py by raising a FileNotFoundError if the path is empty or does not exist, and adds a corresponding unit test. The reviewer suggested improving this check by using os.path.isfile instead of os.path.exists to prevent directories from passing the validation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if not nvcc_path or not os.path.exists(nvcc_path): | ||
| raise FileNotFoundError(f"CUDA compiler not found: {nvcc_path}") |
There was a problem hiding this comment.
Using os.path.exists only checks if the path exists, which could be True even if the user accidentally provides a directory path (e.g., /usr/local/cuda/bin/) instead of the actual compiler executable. To prevent CMake from failing later with a cryptic error, use os.path.isfile to ensure the path points to a file.
| if not nvcc_path or not os.path.exists(nvcc_path): | |
| raise FileNotFoundError(f"CUDA compiler not found: {nvcc_path}") | |
| if not nvcc_path or not os.path.isfile(nvcc_path): | |
| raise FileNotFoundError(f"CUDA compiler not found: {nvcc_path}") |
Summary
Validation
Review notes