Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/check_c_abi/check_c_abi/abi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#

Expand Down Expand Up @@ -287,6 +287,7 @@ def _analyze_struct_abi(
symbol=name,
location=old_struct.location,
)
continue

for (old_type, old_name), (new_type, new_name) in zip_longest(
old_struct.members,
Expand Down
9 changes: 8 additions & 1 deletion ci/check_c_abi/check_c_abi/tests/test_abi.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#

Expand Down Expand Up @@ -65,6 +65,13 @@ def test_struct():
errors = analyze_c_abi(old_abi, old_abi)
assert not errors

# removing a struct should return an error
new_abi = abi_from_str("")
errors = analyze_c_abi(old_abi, new_abi)
assert len(errors) == 1
assert errors[0].symbol == "Foo"
assert errors[0].error == "Struct has been removed"

# removing a field should return an error
new_abi = abi_from_str("""
struct Foo {
Expand Down
Loading