[SONiC] Rebuild Swss Container Using Existing Object Files

358 views
Skip to first unread message

Runming Wu

unread,
Feb 22, 2022, 1:24:51 PM2/22/22
to sonicp...@googlegroups.com
Hi:

When we build the target/docker-orchagent.gz (including target/debs/buster/swss_1.0.0_amd64.deb for buster) target in the sonic-buildimage repo, we can see that object files are generated in src/sonic-swss sub-dir. However, if we rebuild the debian target, all object files are rebuilt as well even if the code does not change. This costs time in our development work.

Is there an option to not rebuild all object files when we rebuild swss debian? Or any pointer in where we can change this behavior? Thanks.

Runming Wu

flyse...@gmail.com

unread,
Feb 24, 2022, 10:20:57 PM2/24/22
to sonicproject
Hi Runming,

In current sonic-buildimage build process, it will use dh-make to clean/build the debian file for the target.
If you need a increment build in the development process, you can try the following procedure.

1. Enter the slave build container in your target debian version, take buster for example
 # BLDENV=buster NOSTRETCH=1 NOBULLSEYE=1 make sonic-slave-bash
The above command can start a build container and then mount the source folder into it, the build environment should be ready to use

2. Build needed object files according to the submodule, take sonic-swss for example
change the folder and make
cd src/sonic-swss
make
In this stage, you can modify the code and re-build to make sure no error happens

3. Build debian files
Most of the submodule already has related debian build config file, execute the command to build binary only without clean/compile
fakeroot make -f debian/rules binary
After the build, the debian file should be ready (but it will not move to the target folder automatically)

Hope the above process helps,
Jimi



Runming Wu 在 2022年2月23日 星期三上午2:24:51 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages