Skip to content

Upgrade to zcbor 0.6.0 #51219

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

Merged
merged 5 commits into from
Oct 19, 2022

Conversation

oyvindronningstad
Copy link
Collaborator

No description provided.

@zephyrbot zephyrbot requested a review from SeppoTakalo October 12, 2022 14:11
@zephyrbot zephyrbot added manifest west manifest-zcbor DNM This PR should not be merged (Do Not Merge) labels Oct 12, 2022
@zephyrbot
Copy link
Collaborator

zephyrbot commented Oct 12, 2022

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
zcbor zephyrproject-rtos/zcbor@a0d6981 zephyrproject-rtos/[email protected] zephyrproject-rtos/[email protected]

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@oyvindronningstad oyvindronningstad requested review from de-nordic and removed request for SeppoTakalo October 12, 2022 14:12
@oyvindronningstad
Copy link
Collaborator Author

cc @VeijoPesonen

rlubos
rlubos previously approved these changes Oct 12, 2022
Comment on lines 52 to 51
((((*input)._record_bt >= INT64_MIN) &&
((*input)._record_bt <= INT64_MAX)) ||
((((*input)._record_bt >= -9223372036854775807LL) &&
((*input)._record_bt <= 9223372036854775807LL)) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the switch from defines to literals?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines are to be reverted back, as you already noticed. INT64_MIN and INT64_MAX shall be used.

Copy link
Contributor

@VeijoPesonen VeijoPesonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array size calculation coming from ZCBOR side is a nice addition.

Comment on lines 52 to 51
((((*input)._record_bt >= INT64_MIN) &&
((*input)._record_bt <= INT64_MAX)) ||
((((*input)._record_bt >= -9223372036854775807LL) &&
((*input)._record_bt <= 9223372036854775807LL)) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two lines are to be reverted back, as you already noticed. INT64_MIN and INT64_MAX shall be used.

@VeijoPesonen
Copy link
Contributor

@jheiskan81 Please review.

@rlubos
Copy link
Collaborator

rlubos commented Oct 13, 2022

@oyvindronningstad Out of curiosity, I was under the impression that this code was autogenerated and there's not much room for modifications?

@oyvindronningstad
Copy link
Collaborator Author

@rlubos The generated code is formatted with clang-format, and then a patch is applied.

@@ -37,9 +36,8 @@ static bool encode_repeated_record_bn(zcbor_state_t *state, const struct record_
bool tmp_result = ((((zcbor_int32_put(state, (-2)))) &&
(zcbor_tstr_encode(state, (&(*input)._record_bn)))));

if (!tmp_result) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this clang rules different than normal zephyr. I was wondering that {
} is mandatory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the clang-format automatically uses the zephyr rules.

VeijoPesonen
VeijoPesonen previously approved these changes Oct 17, 2022
Copy link
Contributor

@VeijoPesonen VeijoPesonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

changes for Zephyr:

* In the zcbor codebase, the ``ARRAY_SIZE`` macro has been renamed to
``ZCBOR_ARRAY_SIZE`` to not collide with Zephyr's ``ARRAY_SIZE_`` macro.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``ZCBOR_ARRAY_SIZE`` to not collide with Zephyr's ``ARRAY_SIZE_`` macro.
``ZCBOR_ARRAY_SIZE`` to not collide with Zephyr's ``ARRAY_SIZE`` macro.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to

:c:macro:`ARRAY_SIZE`

@@ -253,7 +253,7 @@ manifest:
revision: e8920192b66db4f909eb9cd3f155d5245c1ae825
path: modules/lib/uoscore-uedhoc
- name: zcbor
revision: a0d6981f14d4001d6f0d608d1a427f9bc6bb6d02
revision: 0.6.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this not be a commit ID?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have tags now on zcbor fork. The tags are the same as in upstream.

Brings a few quality-of-life improvements for Zephyr, notably:
- No more collision with ARRAY_SIZE()
- C++ improvements

Add entry in release notes.

Signed-off-by: Øyvind Rønningstad <[email protected]>
Since it's better at resolving conflicts.
Commit regenerated files before applying patch.

Signed-off-by: Øyvind Rønningstad <[email protected]>
zcbor 0.6.0 has changed the argument order to put code/convert/validate
first.

Signed-off-by: Øyvind Rønningstad <[email protected]>
Also do clang-format and apply patch.

Signed-off-by: Øyvind Rønningstad <[email protected]>
File created by commiting changes and running

  git diff HEAD~1.. > lwm2m_senml_cbor.patch

Signed-off-by: Øyvind Rønningstad <[email protected]>
@carlescufi carlescufi requested review from jheiskan81, rlubos, VeijoPesonen and de-nordic and removed request for jheiskan81 and VeijoPesonen October 19, 2022 14:04
@carlescufi carlescufi merged commit 1e88e7c into zephyrproject-rtos:main Oct 19, 2022
@de-nordic
Copy link
Collaborator

@carlescufi You gave me 1minute to approve ;). I know that I am to slow with reviews, but at least give me a chance :D.
Just kidding: I have already approved yesterday, and there were no changes.

@oyvindronningstad oyvindronningstad deleted the zcbor-0.6.0 branch October 20, 2022 09:51
saininav pushed a commit to saininav/meta-zephyr that referenced this pull request Apr 20, 2023
The West manifest in  Zephyr 3.3 contains a tag (instead of a SHA) for
zcbor [1]. OE standard practice is to always specifiy revisions using
SHAs, so in the Jinja template, use the new resolve_revision filter to
resolve any tags.

[1] zephyrproject-rtos/zephyr#51219 (comment)

Signed-off-by: Peter Hoyes <[email protected]>
Signed-off-by: Naveen Saini <[email protected]>
saininav pushed a commit to saininav/meta-zephyr that referenced this pull request May 30, 2023
The West manifest in  Zephyr 3.3 contains a tag (instead of a SHA) for
zcbor [1]. OE standard practice is to always specifiy revisions using
SHAs, so in the Jinja template, use the new resolve_revision filter to
resolve any tags.

[1] zephyrproject-rtos/zephyr#51219 (comment)

Signed-off-by: Peter Hoyes <[email protected]>
Signed-off-by: Naveen Saini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants