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

boards: add support for string board revisions #67078

Conversation

feilongfl
Copy link
Contributor

@feilongfl feilongfl commented Dec 30, 2023

add support for string board revisions
with chapter a-zA-Z0-9.

The string format now supports revisions for arbitrary strings (including letters, numbers, and dots). However, this format does not support version comparison with HIGHEST_REVISION. Instead, use VALID_REVISIONS for version comparison.

todo:

  • add document

add support for string board revisions
with chapter `a-zA-Z0-9.`

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
@thedjnK
Copy link
Collaborator

thedjnK commented Dec 30, 2023

Before continuing with this, get approval from @tejlmand as I believe support for this was purposely omitted

@thedjnK thedjnK requested a review from tejlmand December 30, 2023 15:07
@tejlmand
Copy link
Collaborator

tejlmand commented Jan 3, 2024

it was mainly omitted because there is no direct need for it at the time, and there is a preference that we should have code which is used within the project, else it's prone to bit-rot.

That said, string as a type is a bit more custom, as two string revisions cannot be directly compared but must use (or imply) EXACT.

But what if someone is actually having a sensible string, like alpha, beta, gamma, delta`, etc.
Then you could actually compare revisions, but not as a greater than string comparison.

This is why we also support a custom revision.cmake implementation, ref: `https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html#custom-revision-cmake-files

This means that testing against a custom list of strings can easily be done as, while at the same time allow users to do more complex testing / adjustments:

set(REVISIONS alpha beta gamma)
if(NOT BOARD_REVISION IN_LIST REVISIONS)
  message(FATAL_ERROR "Invalid revision used, please choose: ${REVISIONS }")
endif()

So strings as revision is supported by Zephyr today, but not supported in the board revision helper function, as the simple case can be just as easily done directly in the revision.cmake file, and more complex cases of matching is harder to do for various types of strings.

Copy link

github-actions bot commented Mar 4, 2024

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Mar 4, 2024
@github-actions github-actions bot closed this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants