Use SWIGPYTHON to improve SWIG for GO wrapper.#714
Merged
ganglyu merged 8 commits intosonic-net:masterfrom Nov 25, 2022
ganglyu:improve_swig_macro
Merged
Use SWIGPYTHON to improve SWIG for GO wrapper.#714ganglyu merged 8 commits intosonic-net:masterfrom ganglyu:improve_swig_macro
ganglyu merged 8 commits intosonic-net:masterfrom
ganglyu:improve_swig_macro
Conversation
liuh-80
previously approved these changes
Nov 22, 2022
Build failed, seems the change not work.
liuh-80
reviewed
Nov 22, 2022
liuh-80
previously approved these changes
Nov 22, 2022
Contributor
suggest add a minimal go unit test in swss-common repo. The useful test case may be sonicdbconfig init In reply to: 1323630042 In reply to: 1323630042 Refers to: common/dbconnector.h:38 in f2fb1c0. [](commit_id = f2fb1c0, deletion_comment = False) |
Add unit test for SonicDBConfig init.
qiluo-msft
reviewed
Nov 23, 2022
goext/swsscommon.i
Outdated
| @@ -0,0 +1,13 @@ | |||
| %module swsscommon | |||
Contributor
There was a problem hiding this comment.
Is it possible to reuse pyext/swsscommon.i? #Closed
Contributor
Author
There was a problem hiding this comment.
pyext/swsscommon.i is designed for python, and it has embedded python code:
https://github.com/sonic-net/sonic-swss-common/blob/master/pyext/swsscommon.i#L108
I think use another swig file will be better.
qiluo-msft
reviewed
Nov 23, 2022
.azure-pipelines/build-template.yml
Outdated
| pytest --cov=. --cov-report=xml | ||
| mv coverage.xml tests/coverage.xml | ||
| gcovr -r ./ -e ".*/swsscommon_wrap.cpp" --exclude-unreachable-branches --exclude-throw-branches -x --xml-pretty -o coverage.xml | ||
| redis-cli FLUSHALL |
Contributor
qiluo-msft
reviewed
Nov 23, 2022
goext/Makefile
Outdated
| .PHONY: all check clean | ||
|
|
||
| all: | ||
| -$(LN) -s ../pyext/swsscommon.i swsscommon.i |
liuh-80
reviewed
Nov 24, 2022
liuh-80
approved these changes
Nov 24, 2022
Contributor
|
Looks good to me. |
StormLiangMS
pushed a commit
to StormLiangMS/sonic-swss-common
that referenced
this pull request
Dec 11, 2022
Why I did it Use SWIG to generate GO wrapper for sonic-swss-common, and SWIG report syntax error for "%pythoncode%". Related lines are only used for python wrapper, so we should use "#ifdef SWIGPYTHON". How I did it Use SWIGPYTHON to improve SWIG for python wrapper. How to verify it Build succeed and pass all UT.
StormLiangMS
added a commit
that referenced
this pull request
Dec 11, 2022
Cherry-pick from master branch f312634 - Install swsscommon.i with libswsscommon-dev (Install swsscommon.i with libswsscommon-dev #717) (6 minutes ago) [ganglv] 61b7888 - Use SWIGPYTHON to improve SWIG for GO wrapper. (Use SWIGPYTHON to improve SWIG for GO wrapper. #714) (6 minutes ago) [ganglv] 1c10dac - Add decorator for Yang default value. (Add decorator for Yang default value. #713) (6 minutes ago) [Hua Liu]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Use SWIG to generate GO wrapper for sonic-swss-common, and SWIG report syntax error for "%pythoncode%".
Related lines are only used for python wrapper, so we should use "#ifdef SWIGPYTHON".
How I did it
Use SWIGPYTHON to improve SWIG for python wrapper.
How to verify it
Build succeed and pass all UT.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Use SWIGPYTHON to improve SWIG, and then SWIG can generate GO wrapper.
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)