Skip to content

Adapt CFFI bindings for libyang v5 (soversion 5.0.0+)#169

Open
precla wants to merge 1 commit intoCESNET:masterfrom
precla:so5
Open

Adapt CFFI bindings for libyang v5 (soversion 5.0.0+)#169
precla wants to merge 1 commit intoCESNET:masterfrom
precla:so5

Conversation

@precla
Copy link
Copy Markdown

@precla precla commented Apr 2, 2026

Update cdefs.h, source.c and Python call sites to match the libyang 4.2.2 -> 5.0.0 API changes:

  • parent field type changed from lyd_node_inner* to lyd_node* across all node structs
  • lyd_any_value_str gained a LYD_FORMAT parameter
  • lys_find_child signature was reworked
  • lyd_node_any lost the union lyd_any_value/LYD_ANYDATA_VALUETYPE fields
  • removed LYD_NEW_VAL_BIN and LYS_GETNEXT_WITHSCHEMAMOUNT which are not exiting anymore in libyang

@tbsuht
Copy link
Copy Markdown

tbsuht commented Apr 10, 2026

thanks, I'm also interested in v5!

can someone review the changes? @rjarry @choppsv1 @jeremie6wind @samuel-gauthier

@einstux
Copy link
Copy Markdown

einstux commented Apr 27, 2026

Ping? Anyone here, any help needed?

@precla
Copy link
Copy Markdown
Author

precla commented Apr 28, 2026

the activity is low in this repo, so i guess it will take some time until someone responds

@samuel-gauthier
Copy link
Copy Markdown
Collaborator

samuel-gauthier commented Apr 28, 2026

Sorry for the delay, we will have a look before the end of May. Thanks for your work, much appreciated.
In the meantime, can you merge the three commits into one? Git tooling (bisect) works better when the tests work with every commit.

Adapt CFFI bindings for libyang v5 (soversion 5.0.0+)

Update cdefs.h, source.c, and Python call sites to match the libyang
4.2.2 -> 5.0.0 API changes:
- parent field type changed from lyd_node_inner* to lyd_node* across
  all node structs
- lyd_any_value_str gained a LYD_FORMAT parameter
- lys_find_child signature was reworked
- lyd_node_any lost the union lyd_any_value/LYD_ANYDATA_VALUETYPE fields
- LYD_NEW_VAL_BIN / LYS_GETNEXT_WITHSCHEMAMOUNT removed

tests: fix failures caused by libyang v5 changes

Add missing ietf-inet-types YANG module to the test search path, as
libyang v5 no longer resolves it automatically. Update the module data
callback test to handle the ietf-inet-types dependency, and adjust
expected error paths to match libyang v5 output.

Signed-off-by: Antonio Prcela <antonio.prcela@gmail.com>
@precla
Copy link
Copy Markdown
Author

precla commented Apr 28, 2026

done

thanks for the update on when it will be reviewed

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.

4 participants