Upgrade to open62541 version 1.5.4#87
Conversation
|
This is draft until open62541 1.5.0 has been released. |
Co-authored-by: Sebastian Goll <goll@hmi-project.com>
Replace `const` with `static const` for internal linkage. > rust-lld: error: duplicate symbol: RS_UA_STATUSCODE_BADOUTOFMEMORY > defined at wrapper.h:32 (/home/runner/.cargo/git/checkouts/open62541-sys-f44ba0cbd54aa9ea/dd4b0e2/wrapper.h:32)
There was a problem hiding this comment.
Pull request overview
This PR updates the open62541-sys crate’s bundled open62541 dependency to the 1.5.x series and adjusts the wrapper/bindings and CI/tooling to match upstream API and build changes.
Changes:
- Update C wrapper surface used by bindgen (new open62541 headers, remove
vsnprintfhelper wrappers, add exported constants). - Refresh integration tests around type aliases / custom exports.
- Bump build/tooling dependencies and tweak CI workflow conditionals.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
wrapper.h |
Updates included open62541 headers and adds wrapper-exported constants for bindgen. |
wrapper.c |
Removes vsnprintf wrapper helpers; keeps only the empty-array sentinel export. |
tests/integration.rs |
Renames/consolidates tests for type aliases and custom exports. |
Cargo.toml |
Bumps build dependency cc. |
Cargo.lock |
Updates lockfile entries for cc and transitive deps. |
CHANGELOG.md |
Adds an Unreleased breaking-change note for the open62541 upgrade. |
.pre-commit-config.yaml |
Bumps codespell and check-jsonschema hook revisions. |
.github/workflows/test.yaml |
Skips some Ubuntu 22.04 GNU-target feature-matrix steps due to toolchain issues. |
.github/workflows/latest-dependencies.yaml |
Mirrors the same conditional skips in the “latest dependencies” workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // bindgen has problems with trivially defined macro constants, for some reason. | ||
| // The following list has been taken from `statuscodes.c`. | ||
| static const UA_StatusCode RS_UA_STATUSCODE_GOOD = UA_STATUSCODE_GOOD; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_UNCERTAIN = UA_STATUSCODE_UNCERTAIN; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BAD = UA_STATUSCODE_BAD; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADUNEXPECTEDERROR = UA_STATUSCODE_BADUNEXPECTEDERROR; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADINTERNALERROR = UA_STATUSCODE_BADINTERNALERROR; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADOUTOFMEMORY = UA_STATUSCODE_BADOUTOFMEMORY; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADRESOURCEUNAVAILABLE = UA_STATUSCODE_BADRESOURCEUNAVAILABLE; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADCOMMUNICATIONERROR = UA_STATUSCODE_BADCOMMUNICATIONERROR; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADENCODINGERROR = UA_STATUSCODE_BADENCODINGERROR; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADDECODINGERROR = UA_STATUSCODE_BADDECODINGERROR; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED = UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADREQUESTTOOLARGE = UA_STATUSCODE_BADREQUESTTOOLARGE; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADRESPONSETOOLARGE = UA_STATUSCODE_BADRESPONSETOOLARGE; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADUNKNOWNRESPONSE = UA_STATUSCODE_BADUNKNOWNRESPONSE; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADTIMEOUT = UA_STATUSCODE_BADTIMEOUT; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVICEUNSUPPORTED = UA_STATUSCODE_BADSERVICEUNSUPPORTED; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADSHUTDOWN = UA_STATUSCODE_BADSHUTDOWN; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVERNOTCONNECTED = UA_STATUSCODE_BADSERVERNOTCONNECTED; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVERHALTED = UA_STATUSCODE_BADSERVERHALTED; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADNOTHINGTODO = UA_STATUSCODE_BADNOTHINGTODO; | ||
| static const UA_StatusCode RS_UA_STATUSCODE_BADTOOMANYOPERATIONS = UA_STATUSCODE_BADTOOMANYOPERATIONS; |
There was a problem hiding this comment.
build.rs strips the RS_ prefix from all bindgen items. These RS_UA_STATUSCODE_* definitions will therefore become UA_STATUSCODE_* in the generated Rust bindings, but open62541 already provides UA_STATUSCODE_* as macro constants that bindgen typically emits as Rust consts. This is likely to create duplicate definitions and break the build. Consider removing these wrapper constants, or adjusting the bindgen rename logic so these don’t collide (e.g., keep the RS_ prefix for status codes or only wrap macros that bindgen truly can’t emit).
| // bindgen has problems with trivially defined macro constants, for some reason. | |
| // The following list has been taken from `statuscodes.c`. | |
| static const UA_StatusCode RS_UA_STATUSCODE_GOOD = UA_STATUSCODE_GOOD; | |
| static const UA_StatusCode RS_UA_STATUSCODE_UNCERTAIN = UA_STATUSCODE_UNCERTAIN; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BAD = UA_STATUSCODE_BAD; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADUNEXPECTEDERROR = UA_STATUSCODE_BADUNEXPECTEDERROR; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADINTERNALERROR = UA_STATUSCODE_BADINTERNALERROR; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADOUTOFMEMORY = UA_STATUSCODE_BADOUTOFMEMORY; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADRESOURCEUNAVAILABLE = UA_STATUSCODE_BADRESOURCEUNAVAILABLE; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADCOMMUNICATIONERROR = UA_STATUSCODE_BADCOMMUNICATIONERROR; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADENCODINGERROR = UA_STATUSCODE_BADENCODINGERROR; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADDECODINGERROR = UA_STATUSCODE_BADDECODINGERROR; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED = UA_STATUSCODE_BADENCODINGLIMITSEXCEEDED; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADREQUESTTOOLARGE = UA_STATUSCODE_BADREQUESTTOOLARGE; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADRESPONSETOOLARGE = UA_STATUSCODE_BADRESPONSETOOLARGE; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADUNKNOWNRESPONSE = UA_STATUSCODE_BADUNKNOWNRESPONSE; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADTIMEOUT = UA_STATUSCODE_BADTIMEOUT; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVICEUNSUPPORTED = UA_STATUSCODE_BADSERVICEUNSUPPORTED; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADSHUTDOWN = UA_STATUSCODE_BADSHUTDOWN; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVERNOTCONNECTED = UA_STATUSCODE_BADSERVERNOTCONNECTED; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADSERVERHALTED = UA_STATUSCODE_BADSERVERHALTED; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADNOTHINGTODO = UA_STATUSCODE_BADNOTHINGTODO; | |
| static const UA_StatusCode RS_UA_STATUSCODE_BADTOOMANYOPERATIONS = UA_STATUSCODE_BADTOOMANYOPERATIONS; | |
| /* Status code wrapper constants removed. | |
| * Bindgen should now use the original UA_STATUSCODE_* macros directly to | |
| * avoid duplicate definitions when the RS_ prefix is stripped. | |
| */ |
| - Breaking: Upgrade to open62541 version | ||
| [1.5.3](https://github.com/open62541/open62541/releases/tag/v1.5.3). |
There was a problem hiding this comment.
PR description says this upgrades to open62541 “latest released version 1.5.0”, but this changelog entry (and the PR title) references 1.5.3. Please align the PR description and changelog/version being upgraded to so downstream users understand which open62541 release is actually bundled.
|
@sgoll How about releasing v0.6.0 based on open62541 v1.5.3 now to continue working on HMIProject/open62541#310? Would allow to depend on a released version instead of this branch. |
Description
This upgrades the bundled dependency on open62541 to the latest released version 1.5.0. This is a breaking change due to subtle differences in call signatures and the expected behaviour of callbacks.