aztec-2.0 icon indicating copy to clipboard operation
aztec-2.0 copied to clipboard

feat: enhance clarity of version requirements in bootstrap script

Open joaolago1113 opened this issue 1 year ago • 0 comments

Summary:

This pull request enhances the bootstrap script to provide more informative error messages and improve user experience. The changes include adding checks for the CMake version, the availability of the Ninja build tool, and the compatibility of the compiler version.

Background:

In the existing setup of the bootstrap scripts, error messages related to CMake version, Ninja availability, and compiler version compatibility were not clear, leading to potential confusion for users.

Changes Proposed:

  1. Added the function, check_cmake_version, to the cpp/bootstrap.sh script. This function checks if CMake is installed, extracts the required CMake version from CMakePresets.json, and compares it against the currently installed version. It provides a clear error message if the installed version is below the required threshold.

  2. Added a check for the availability of the Ninja build tool using command -v ninja. If Ninja is not installed, the script provides a clear error message to prompt users to install Ninja.

  3. Introduced the check_compiler_version function to verify the compatibility of the compiler version specified in CMakePresets.json. This function ensures that the installed compiler (e.g., GCC or Clang) meets the minimum version requirements defined in the README.md of clang >= 16 or gcc >= 10.

With these changes, users will receive informative error messages in the following scenarios:

  • When the CMake version is insufficient:

    CMake version is lower than the required version 3.24.1 for CMakePresets.json
    Please update CMake to at least this version.
    
  • When Ninja is not installed:

    Ninja is not installed. Please install Ninja before proceeding.
    
  • When the compiler version is incompatible (compiler checked depending on the PRESET):

    clang version is not sufficient (15.0 < 16)
    

Testing:

The updated scripts have been thoroughly tested with various CMake versions, Ninja availability, and compiler versions to ensure that the error messages are displayed correctly and only when necessary.

joaolago1113 avatar Jan 28 '24 19:01 joaolago1113