Skip to content
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

Provide build flag to disable compilation of yang dependent interfaces #3

Closed
wants to merge 1 commit into from

Conversation

vivekrnv
Copy link
Owner

@vivekrnv vivekrnv commented Jan 31, 2024

Why i did it

libswsscommon depends on libyang deb. libyang is deprecated in bookworm. This wouldn't be a problem for buildimage because libyang is compiled from source in buildimage.

However, this is causing a problem in upgrading one of our app-extensions to bookworm. This app-extension is built separately and not part of buildimage infra.

Thus provide a build flag to disable compilation of libyang dependent interfaces such as DecoratorTable etc. Please note, there is no change in the default behavior

How did i verify

vkarri@6c5cda5d64fa:/sonic/src/sonic-swss-common$ debuild -b -us -uc -Pnopython2,noyangmod 
vkarri@6c5cda5d64fa:/sonic/src$ sudo dpkg -i libswsscommon_1.0.0_amd64.deb vkarri@6c5cda5d64fa:/sonic/src$ sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb 
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import DecoratorSubscriberStateTable" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'DecoratorSubscriberStateTable' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py) 
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import DecoratorTable" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'DecoratorTable' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py) 
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import YangDefaultDecorator" 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'YangDefaultDecorator' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py) 

vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import SubscriberStateTable, ProducerStateTable, Table, DBConnector"

Default Behavior:

vkarri@6c5cda5d64fa:/sonic$ make -f slave.mk target/debs/bookworm/python3-swsscommon_1.0.0_amd64.deb-install
vkarri@6c5cda5d64fa:/sonic$ python3 -c "from swsscommon.swsscommon import DecoratorSubscriberStateTable, DecoratorTable, YangDefaultDecorator"
vkarri@6c5cda5d64fa:/sonic$

@vivekrnv vivekrnv changed the title Provide build flag to disable compilation of libyang dependent interfaces Provide build flag to disable compilation of yang dependent interfaces Jan 31, 2024
@vivekrnv vivekrnv force-pushed the disable_yang_modules branch 2 times, most recently from 8642389 to 0f9f8b2 Compare January 31, 2024 22:14
…aces

vkarri@6c5cda5d64fa:/sonic/src/sonic-swss-common$ debuild -b -us -uc -Pnopython2,noyangmod
vkarri@6c5cda5d64fa:/sonic/src$ sudo dpkg -i libswsscommon_1.0.0_amd64.deb
vkarri@6c5cda5d64fa:/sonic/src$ sudo dpkg -i python3-swsscommon_1.0.0_amd64.deb
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import DecoratorSubscriberStateTable, DecoratorTable, YangDefaultDecorator"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'DecoratorSubscriberStateTable' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py)
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import DecoratorTable, YangDefaultDecorator"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'DecoratorTable' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py)
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import YangDefaultDecorator"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'YangDefaultDecorator' from 'swsscommon.swsscommon' (/usr/lib/python3/dist-packages/swsscommon/swsscommon.py)
vkarri@6c5cda5d64fa:/sonic/src$ python3 -c "from swsscommon.swsscommon import SubscriberStateTable, ProducerStateTable, Table, DBConnector"

<Default Behavior>
vkarri@6c5cda5d64fa:/sonic$ make -f slave.mk target/debs/bookworm/python3-swsscommon_1.0.0_amd64.deb-install
vkarri@6c5cda5d64fa:/sonic$ python3 -c "from swsscommon.swsscommon import DecoratorSubscriberStateTable, DecoratorTable, YangDefaultDecorator"
vkarri@6c5cda5d64fa:/sonic$

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
@vivekrnv vivekrnv closed this Feb 1, 2024
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.

3 participants