Skip to content

Fix compilation on Buster#1449

Merged
kcudnik merged 2 commits intosonic-net:masterfrom
saiarcot895:fix-buster-compilation
Oct 30, 2024
Merged

Fix compilation on Buster#1449
kcudnik merged 2 commits intosonic-net:masterfrom
saiarcot895:fix-buster-compilation

Conversation

@saiarcot895
Copy link
Copy Markdown
Contributor

@saiarcot895 saiarcot895 commented Oct 29, 2024

There are two issues causing compilation failures of sairedis on Buster. Since the SONiC PTF container is still based on Buster, sairedis still needs to compile for Buster.

For the first issue, when generating Python bindings through SWIG on Buster, the sai_struct_member_info_t and sai_object_type_info_t struct cause issues during compilation on Buster. The errors stem from function pointers being used, but I'm not certain on the exact reason why these two specific structs have issues.

Instead of debugging further at this point, skip these two structs for now. We won't need it in the near future. Alternatively, once the Buster build is no longer needed, these lines can be removed.

For the second issue, the TestSyncd.cpp file uses the MOCK_METHOD macro. However, this macro is available only from version 1.10 of gmock, but Buster has version 1.8.1. As a simple fix, check to see if MOCK_METHOD is defined; if not, then don't compile this test.

ADO: 30055338

When generating Python bindings through SWIG on Buster, the
sai_struct_member_info_t and sai_object_type_info_t struct cause issues
during compilation on Buster. The errors stem from function pointers
being used, but I'm not certain on the exact reason why these two
specific structs have issues.

Instead of debugging further at this point, skip these two structs for
now. We won't need it in the near future. Alternatively, once the Buster
build is no longer needed (the PTF container currently is on Buster),
these lines can be removed.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@saiarcot895 saiarcot895 requested a review from kcudnik October 29, 2024 20:07
Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
@saiarcot895 saiarcot895 changed the title Skip two structs from the SWIG bindings that cause issues on Buster Fix compilation on Buster Oct 29, 2024
@kcudnik
Copy link
Copy Markdown
Collaborator

kcudnik commented Oct 30, 2024

Swig4 solves this issue, r3cently i fixed that. In codeql build pipeline

@saiarcot895
Copy link
Copy Markdown
Contributor Author

This issue is specifically for the Buster build, where swig 4.0 isn't available, and an older version of gmock is used. See also the failures in sonic-net/sonic-buildimage#20540.

@kcudnik kcudnik merged commit e394ced into sonic-net:master Oct 30, 2024
@saiarcot895 saiarcot895 deleted the fix-buster-compilation branch October 30, 2024 15:57
shiraez pushed a commit to Marvell-switching/sonic-sairedis that referenced this pull request Dec 12, 2024
There are two issues causing compilation failures of sairedis on Buster. Since the SONiC PTF container is still based on Buster, sairedis still needs to compile for Buster.

For the first issue, when generating Python bindings through SWIG on Buster, the sai_struct_member_info_t and sai_object_type_info_t struct cause issues during compilation on Buster. The errors stem from function pointers being used, but I'm not certain on the exact reason why these two specific structs have issues.

Instead of debugging further at this point, skip these two structs for now. We won't need it in the near future. Alternatively, once the Buster build is no longer needed, these lines can be removed.

For the second issue, the TestSyncd.cpp file uses the MOCK_METHOD macro. However, this macro is available only from version 1.10 of gmock, but Buster has version 1.8.1. As a simple fix, check to see if MOCK_METHOD is defined; if not, then don't compile this test.

ADO: 30055338
shiraez pushed a commit to Marvell-switching/sonic-sairedis that referenced this pull request Dec 12, 2024
There are two issues causing compilation failures of sairedis on Buster. Since the SONiC PTF container is still based on Buster, sairedis still needs to compile for Buster.

For the first issue, when generating Python bindings through SWIG on Buster, the sai_struct_member_info_t and sai_object_type_info_t struct cause issues during compilation on Buster. The errors stem from function pointers being used, but I'm not certain on the exact reason why these two specific structs have issues.

Instead of debugging further at this point, skip these two structs for now. We won't need it in the near future. Alternatively, once the Buster build is no longer needed, these lines can be removed.

For the second issue, the TestSyncd.cpp file uses the MOCK_METHOD macro. However, this macro is available only from version 1.10 of gmock, but Buster has version 1.8.1. As a simple fix, check to see if MOCK_METHOD is defined; if not, then don't compile this test.

ADO: 30055338
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.

2 participants