Skip to content

Commit bf87eb4

Browse files
authored
Update call git clean on debian/rules (sonic-net#825)
When making build sairedis directory could be polluted by previous build which was configured without '--enable-syncd=no', and that created makefiles for previous build for example binary-syncd target, next when dh clean is executed for target binary-sairedis, it's executing existing configure with previous parameters by executing "./bin/bash ./config.status .recheck", this don't contain --enable-syncd=no, and this requires libsai to be present for configuration, this will cause configure to fail, but dh clean will ignore that error and continue next commands. Because of this, make distclean was not executed, and directory contains previous build artifacts like _pysairedis.la in pyext directory, which was from stretch build, and points to different python version 3.5 vs 3.7 on buster, and since _pysairedis.la exists, it's content are used to pass that python library to link stage of python build. To workaround this, we can export shell variable to disable libsai requirement, and distclean will succeed, but there still be left artifacts in syncd directory and others conditioned in Makefile.am Signed-off-by: kcudnik <[email protected]>
1 parent d821bc0 commit bf87eb4

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

configure.ac

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ AC_ARG_ENABLE(syncd,
5252
no) syncd=false ;;
5353
*) AC_MSG_ERROR(bad value ${enableval} for --enable-syncd) ;;
5454
esac],[syncd=true])
55+
AS_IF([test "x${ENABLESYNCD}" = "xno" ],[syncd=false],[])
5556
AM_CONDITIONAL(SYNCD, test x$syncd = xtrue)
5657
AM_COND_IF([SYNCD], [
5758
AM_COND_IF([SAIVS], [], [AC_CHECK_LIB([sai], [main], [AC_MSG_NOTICE(libsai found)], [AC_MSG_ERROR(libsai is required for syncd)])

debian/rules

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ binary: binary-syncd-rpc binary-syncd
3939

4040
binary-sairedis:
4141
echo '--enable-syncd=no' > /tmp/syncd-build
42-
dh clean --with autotools-dev
42+
ENABLESYNCD=no dh clean --with autotools-dev
4343
dh build -N syncd -N syncd-dbg -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev
4444
dh binary -N syncd -N syncd-dbg -N syncd-rpc -N syncd-rpc-dbg -N syncd-vs -N syncd-vs-dbg --with autotools-dev
4545

python/Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ install: all
88
check:
99
true
1010

11-
.PHONY: clean
11+
.PHONY: clean distclean
1212

1313
clean:
1414
rm -f *.o *~
1515
rm -rf build
1616

17+
distclean:
18+
rm -f *.o *~
19+
rm -rf build

0 commit comments

Comments
 (0)