Skip to content

Add a CMakePresets.json file with some common presets. #5804

Open

Activity

  1. added
    quality of life 😊
    on May 7, 2021
  2. self-assigned this
    on May 7, 2021
  3. added
    infrastructure
    on May 11, 2021
  4. added this to the Infrastructure Fixit milestone on Jun 2, 2022
  5. ScottTodd commented on Mar 9, 2023

    @ScottTodd
    Member

    Here's a draft of a presets file: https://gist.github.com/ScottTodd/dd4100b22d085723baa3679a7cfbf544

    Some impressions:

    Inheritance is only sufficient for certain setups. Others would need composition/optionality/scripting support. For example: if I want to make some setting (e.g. which backends to build, whether to use ccache) optional, I would need to create two configure presets: setting_enabled and setting_disabled. To then build, I would need to create a matching build preset for each: setting_enabled and setting_disabled. That leads to a state space explosion if build presets then include other options.

    Branching by platform (e.g. IREE_ENABLE_LLD, IREE_BUILD_TRACY, -DCMAKE_C_COMPILER=clang vs MSVC) won't really work effectively because of that inheritance setup.

    "workflow presets" let you group configure -> build -> test -> etc. steps. They can only be used with a shared configure step though, so you can't have a crosscompilation workflow that runs configure (host) -> build (host) -> install -> configure (target) -> build (target).

    Now... we may be able to create something workable with:

    • a base configure/build preset in CMakePresets.json that sets a minimal list of options (-DIREE_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo, etc.)
    • some common presets that we currently have scripts for (build_runtime.sh, build_runtime_small.sh)
    • a script that helps generate a platform-specific CMakeUserPresets.json, maybe with some CLI magic for "do you want to use ccache? which backends do you want?"
  6. GMNGeoffrey commented on Apr 10, 2023

    @GMNGeoffrey
    Member

    Even if the configs are totally flat, I think they would be quite useful. If we end up with a bunch of repetition we could even do our own composition in a somewhat-sane language like Python and then generate a bunch of json files

  7. benvanik commented on Apr 10, 2023

    @benvanik
    CollaboratorAuthor

    Regardless of what we do as long as this is CMakePresets.json.template or something then we can land an iterate. One of the many major issues with presets is that the presence of the file will trigger most IDE's/editors to switch to using them and if your configuration isn't supported it gets really painful (nothing will work until you delete the file or go set environment variables before launching the editor, which sucks). This would let us side-step some of the hierarchy issues to start as we could have a template for primarily compiler + host runtime usage and one or more for specific runtime/cross-compiling usage.

  8. moved this from Not Started to Needs Scheduling in (Deprecated) IREEon May 19, 2023
  9. moved this from Needs Scheduling to Backlog in (Deprecated) IREEon Aug 29, 2023
  10. ScottTodd commented on Dec 15, 2023

    @ScottTodd
    Member

    #15581 added a few presets to build_tools/cmake/presets/. Still need to have a few people give them a try and offer feedback (see Stella's request on Discord here), then advertise them in our docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infrastructurequality of life 😊

Type

No type

Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions