Open-CMSIS-Pack / devtools

Open-CMSIS-Pack development tools - C++
Apache License 2.0
73 stars 54 forks source link

[solution] Allow definition of minimal *compatible* pack version `@^` and `@~` #1687

Closed jkrech closed 3 days ago

jkrech commented 1 month ago

Describe The Problem To Be Solved Once a solution makes use of a feature that was introduced with a certain pack version, this version becomes the minimum required pack version in order to successfully build this application. According to Semantic Versioning, the compatibility of a pack is only guaranteed in case the <major> version stays unchanged. Once the <major> version increments the relying solution may start to fail.

Solution In order to prevent a solution to be built using a potentially incompatible pack version, a minimal compatible pack version can be specified

  packs:
    - pack: ARM::CMSIS@^6.0.1

This means the version of the ARM::CMSIS pack must be: 6.0.1 <= version < 7.0.0

Note that this notation is already supported by cpackget today:

  cpackget add "ARM::CMSIS^6.0.1"

A more restrictive version range qualifier is ~:

  packs:
    - pack: ARM::CMSIS@~6.0.1

This means the version of the ARM::CMSIS pack must be: 6.0.1 <= version < 6.1.0 - both major and minor version remain unchanged - which semantically means only newer patch versions = "bug fixes" are allowed.

ReinhardKeil commented 1 month ago

Please use the same syntax in the *.yml files as on cpackget command line

  packs:
    - pack: ARM::CMSIS~6.0.1
jkrech commented 2 weeks ago

Corrected Above! The correct syntax for cpackget add is @^6.0.1 for consistency the version delimiter @ should be used and ^ or >= as qualifier. (Note: The syntax cpackget add ARM::CMSIS~6.0.1 does not work for me (version 2.1.3)

In https://github.com/Open-CMSIS-Pack/cpackget/issues/336 the support for the qualifier ~ ARM::CMSIS@~6.0.1 is requested and documented here: https://github.com/ReinhardKeil/cmsis-toolbox/blob/main/docs/YML-Input-Format.md#pack-name-conventions

ReinhardKeil commented 2 weeks ago

Documentation done.

jkrech commented 3 days ago

Validated using nightly build of CMSIS-Toolbox 2024-09-09