Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cversion attribute in <condition> element does not allow to change major version #273

Closed
ReinhardKeil opened this issue Jan 4, 2024 · 7 comments · Fixed by #281
Closed
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@ReinhardKeil
Copy link
Collaborator

ReinhardKeil commented Jan 4, 2024

The Cversion attribute in the <condition> element specifies a minimum version. The documentation is unspecific on behavior of major version changes. However with Semantic versioning the change of MAJOR version number implies an incompatible change. The CMSIS tools implement an algorithm that does not allow to cross MAJOR version (except when an explicit version range is specified with a maxVersion that has a higher major version).

The documentation needs clarification under:
https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/pdsc_conditions_pg.html#element_require

Questions:

  • there is an inconsistency of the version evaluation in element <requirements> elements. A pack with a higher major version is accepted. Can you confirm?
  • what is the best way to specify that a MAJOR version change is acceptable. Cversion=5.6.0:6 is accepted, but what is the actual behaviour.
@ReinhardKeil ReinhardKeil added bug Something isn't working documentation Improvements or additions to documentation labels Jan 4, 2024
@edriouk
Copy link

edriouk commented Jan 5, 2024

I can confirm that packs do not follow the MAJOR rule, they got accepted.
In the current implementation only an explicit range can be used to accept greater version.
for the given range Cversion=5.6.0:6 all components from 5.6.0 till 6.0.0 are accepted (6.0.1 gets rejected)

We can still modify most of the tools with:

  • user option (command line, preference setting) to ignore MAJOR rule
  • modify version range comparison to use open expressions like Cversion="5.6.0:" to explicitly ignore the MAJOR rule

@jkrech
Copy link
Member

jkrech commented Jan 5, 2024

I think the bit we are missing with version range minVer:maxVer is to be able to specify whether the specified maxVer is included or excluded. Currently it is included:
minVer:maxVer means minVer >= VERSION <= maxVer
In order to specify a dependency with a version that spans across multiple major versions

<accept ... Cversion="5.6.0" />
<accept ... Cversion="6.0.0" />
<accept ... Cversion="7.0.0" />

since

<accept ... Cversion="5.6.0:7.999.999" />

is a speculative hack.

In the CMSIS-Toolbox project format we have defined:
@~6 to specify that any version having major version 6 would match
versus
@>=6.0.0-0 which would accept any version with major version >=6 (no upper limit).
The challenge I am seeing is that any change/moidification will break compatibility.

@edriouk
Copy link

edriouk commented Jan 5, 2024

Please note that range "1.0.0:2.0.0-" effectively covers all 1.xx.xxx version and excludes any 2.0.0 (even pre-release)
It effectively does the same job as "1.0.0:1.999.999" but looks nicer.

@jkrech
Copy link
Member

jkrech commented Jan 5, 2024

@edriouk I had not thought about that !!!

Note: in order for the version to be schema compliant something needs to follow the -

1.0.0:2.0.0-0

@jkrech jkrech self-assigned this Jan 5, 2024
@ReinhardKeil
Copy link
Collaborator Author

@edriouk is it today possible to use Cversion=5.6.0:7.0.0- in all our tools? Will this be handled as described by you? If so, we add it also to the documentation, as this topic is a documentation issue.

@jkrech
Copy link
Member

jkrech commented Jan 9, 2024

Cversion:

Specifies a software component version

require Cversion: condition is true if version of component is equal or higher than requested but compatible. According to Semantic Versioning compatibility requires the major version to remain unchanged.

deny Cversion: condition is true if version of component is lower than requested.

Version ranges are specified with min_version:max_version. The condition is true if the version of the component is equal or higher than min_version and lower or equal than max_version. If min_version and max_version are equal the version must match exactly.

Only specifying the min_version Cversion="4.1.0" is identical to the version range Cversion="4.1.0:5.0.0-0"

@edriouk
Copy link

edriouk commented Jan 25, 2024

@ReinhardKeil , semantic versioning works consistently across our tools, including Cversion=5.6.0:7.0.0-
However, schema check will fail for such expression, Therefore Cversion=5.6.0:7.0.0-0 should be used

jkrech added a commit that referenced this issue Jan 30, 2024
…ition by components (#281)

Clarify that in conditions Cversion and Capiversion specified by
minVersion only only resolve to true for compatible versions, meaning
for the same major version value as specified in minVersion.
closing #273
closing #274

---------

Co-authored-by: Daniel Brondani <daniel.brondani@arm.com>
@jkrech jkrech closed this as completed Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
3 participants