Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,926
    • Issues 3,926
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21310
Closed
Open
Created Oct 14, 2020 by Craig Scott@craig.scottMaintainer

Presets-related error messages don't provide enough information

When there is a problem with a CMakePresets.json or CMakeUserPresets.json file, the error messages that are generated are not very helpful. If the JSON file contains any sort of syntax error, you get no help with where in the file the error came from. All you get in the error message is something like this:

Could not read presets from /Some/Path/Blah: JSON parse error

JSON syntax errors can be very difficult to find manually without any guidance on where the error is located. Can the JSON parsing CMake uses provide a line number, JSON path or something similar to help the user locate the problem?

A related but slightly different variant of this is when the JSON syntax is valid, but the contents are rejected by CMake. For example, if you happen to use a wrong data type, such as giving a quoted "true" instead of just true to the hidden field of a configurePresets entry, you get told a preset is invalid, but not which preset or why it is invalid. The error message in such cases is just this:

Could not read presets from /Some/Path/Blah: Invalid preset
Edited Nov 25, 2021 by Craig Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking