Skip to content

preserve order of ports in PortsList. Solves issue #851 - #870

Closed
facontidavide wants to merge 1 commit into
masterfrom
preserve_port_order
Closed

facontidavide wants to merge 1 commit into
masterfrom
preserve_port_order

Conversation

@facontidavide

Copy link
Copy Markdown
Collaborator

This check is probably NOT binary compatible, nor API compatible

@facontidavide

Copy link
Copy Markdown
Collaborator Author

Unfortunately, if I merge this, I need to create BT.CPP 5.0, because EVERYONE will be obliged to recompile their applications.

Still unsure what to do

@facontidavide

Copy link
Copy Markdown
Collaborator Author

Closing in favor of #1260. Changing PortsList into an ordered container breaks API/ABI, so for 4.x the model XML now sorts ports by direction and then by name. That makes the order shown in Groot2 deterministic. Keeping the exact order of providedPorts() remains a candidate for 5.0.

facontidavide added a commit that referenced this pull request Oct 26, 2026
PortsList is an unordered_map, so writeTreeNodesModelXML() emitted the
ports in hash order, which differs across builds and shows up in Groot2.
Sort them by direction (input, output, inout), then by name, as was done
before d5ea17b.

Keeping the order of providedPorts() would need to change the PortsList
type (#870), which breaks API/ABI; this is the compatible subset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant