-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SWIGPYTHON to improve SWIG for GO wrapper. #714
Conversation
Build failed, seems the change not work.
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.
goext/swsscommon.i
Outdated
@@ -0,0 +1,13 @@ | |||
%module swsscommon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to reuse pyext/swsscommon.i? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
.azure-pipelines/build-template.yml
Outdated
@@ -138,6 +138,9 @@ jobs: | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goext/Makefile
Outdated
.PHONY: all check clean | ||
|
||
all: | ||
-$(LN) -s ../pyext/swsscommon.i swsscommon.i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. |
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.
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]
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)