Add vLLM-metax vllm metax cmake presets no prompt#306
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a --no-prompt option to generate_presets in tools/generate_cmake_presets.py to support non-interactive execution, raising a RuntimeError if nvcc cannot be automatically detected. It also adds a corresponding unit test. The review feedback points out an important edge case: if --no-prompt is enabled but --force-overwrite is not, the script will still block on an interactive prompt if the output file already exists. A code suggestion is provided to raise a RuntimeError early in this scenario to prevent hanging in non-interactive environments.
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.
| def generate_presets( | ||
| output_path="CMakeUserPresets.json", | ||
| force_overwrite=False, | ||
| no_prompt=False, | ||
| ): |
There was a problem hiding this comment.
When --no-prompt is enabled, the script should run completely non-interactively. However, if the output file (e.g., CMakeUserPresets.json) already exists and --force-overwrite is not specified, the script will still block on the interactive input() prompt on line 160. In non-interactive environments like CI/CD pipelines, this will cause the script to hang or crash with an EOFError.
To prevent this, we should check if the file exists and raise a RuntimeError early when no_prompt is True and force_overwrite is False.
| def generate_presets( | |
| output_path="CMakeUserPresets.json", | |
| force_overwrite=False, | |
| no_prompt=False, | |
| ): | |
| def generate_presets( | |
| output_path="CMakeUserPresets.json", | |
| force_overwrite=False, | |
| no_prompt=False, | |
| ): | |
| if no_prompt and not force_overwrite: | |
| project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | |
| if os.path.exists(os.path.join(project_root, output_path)): | |
| raise RuntimeError( | |
| f"File '{output_path}' already exists. Use --force-overwrite " | |
| "or run without --no-prompt to overwrite it." | |
| ) |
Summary
Validation
Review notes