Skip to content

Upgrade to open62541 version 1.5.4#87

Open
sgoll wants to merge 17 commits into
mainfrom
open62541-1.5
Open

Upgrade to open62541 version 1.5.4#87
sgoll wants to merge 17 commits into
mainfrom
open62541-1.5

Conversation

@sgoll
Copy link
Copy Markdown
Contributor

@sgoll sgoll commented Dec 22, 2025

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.

@sgoll
Copy link
Copy Markdown
Contributor Author

sgoll commented Dec 22, 2025

This is draft until open62541 1.5.0 has been released.

Co-authored-by: Sebastian Goll <goll@hmi-project.com>
@uklotzde uklotzde changed the title Upgrade to open62541 version 1.5.0 Upgrade to open62541 version 1.5.3 Mar 19, 2026
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)
@uklotzde uklotzde marked this pull request as ready for review March 28, 2026 11:22
@uklotzde uklotzde added this to the v0.6.0 milestone Mar 28, 2026
@uklotzde uklotzde requested a review from Copilot March 28, 2026 11:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 vsnprintf helper 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.

Comment thread wrapper.h
Comment on lines +25 to +47
// 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;
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
// 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.
*/

Copilot uses AI. Check for mistakes.
Comment thread CHANGELOG.md Outdated
Comment on lines +12 to +13
- Breaking: Upgrade to open62541 version
[1.5.3](https://github.com/open62541/open62541/releases/tag/v1.5.3).
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@uklotzde
Copy link
Copy Markdown
Collaborator

@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.

@uklotzde uklotzde changed the title Upgrade to open62541 version 1.5.3 Upgrade to open62541 version 1.5.4 Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants