sonic-net / sonic-buildimage

Scripts which perform an installable binary image build for SONiC
Other
739 stars 1.43k forks source link

build fails in systemd-sonic-generator when SONIC_PROFILING_ON = y #8316

Open raphaelt-nvidia opened 3 years ago

raphaelt-nvidia commented 3 years ago

Description

When SONIC_PROFILING_ON = y, building sonic-buildimage fails with errors in systemd-sonic-generator. Some, but not all, of these errors are caused by bad formatting in a changelog file.

Steps to reproduce the issue:

  1. In rules/config, uncomment the line: SONIC_PROFILING_ON = y
  2. make configure PLATFORM=mellanox
  3. make target/sonic-mellanox.bin-clean
  4. make target/sonic-mellanox.bin

Describe the results you received:

With current master branch code:

make[3]: Entering directory '/sonic/src/systemd-sonic-generator' dh_gencontrol -- -v1.0.0 dpkg-gencontrol: warning: debian/changelog(l3): found end of file where expected more change data or trailer dpkg-gencontrol: warning: package systemd-sonic-generator: substitution variable ${shlibs:Depends} unused, but is defined make[3]: Leaving directory '/sonic/src/systemd-sonic-generator' dh_md5sums dh_builddeb dpkg-deb: building package 'systemd-sonic-generator' in '../systemd-sonic-generator_1.0.0_amd64.deb'. make[2]: Leaving directory '/sonic/src/systemd-sonic-generator' dpkg-genbuildinfo --build=binary --admindir=/sonic/dpkg/tmp.TZEMnqBdIi dpkg-genbuildinfo: warning: debian/changelog(l3): found end of file where expected more change data or trailer dpkg-genbuildinfo: warning: debian/changelog(l3): found end of file where expected more change data or trailer dpkg-genchanges --build=binary >../systemd-sonic-generator_1.0.0_amd64.changes dpkg-genchanges: warning: debian/changelog(l3): found end of file where expected more change data or trailer dpkg-genchanges: warning: debian/changelog(l3): found end of file where expected more change data or trailer dpkg-genchanges: warning: missing Section for binary package systemd-sonic-generator; using '-' dpkg-genchanges: warning: missing Priority for binary package systemd-sonic-generator; using '-' dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-source: warning: systemd-sonic-generator/debian/changelog(l3): found end of file where expected more change data or trailer dpkg-buildpackage: info: binary-only upload (no source included) mv ../systemd-sonic-generator_1.0.0amd64.deb /sonic/target/debs/buster/ rm ../systemd-sonic-generator-* ../systemd-sonic-generator rm: cannot remove '../systemd-sonic-generator-': No such file or directory make[1]: [Makefile:14: /sonic/target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb] Error 1 make[1]: Leaving directory '/sonic/src/systemd-sonic-generator' [ FAIL LOG END ] [ target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb ] make: [slave.mk:428: target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb] Error 1

Fixing the changelog file(1 space at start of line, 2 spaces before day) eliminates some, but not all, of the errors, and the build still fails.

diff --git a/src/systemd-sonic-generator/debian/changelog b/src/systemd-sonic-generator/debian/changelog index 1cc6c755e..17442f16b 100644 --- a/src/systemd-sonic-generator/debian/changelog +++ b/src/systemd-sonic-generator/debian/changelog @@ -1,3 +1,3 @@ systemd-sonic-generator (1.0.0) UNRELEASED; urgency=medium

make[3]: Entering directory '/sonic/src/systemd-sonic-generator' dh_gencontrol -- -v1.0.0 dpkg-gencontrol: warning: package systemd-sonic-generator: substitution variable ${shlibs:Depends} unused, but is defined make[3]: Leaving directory '/sonic/src/systemd-sonic-generator' dh_md5sums dh_builddeb dpkg-deb: building package 'systemd-sonic-generator' in '../systemd-sonic-generator_1.0.0_amd64.deb'. make[2]: Leaving directory '/sonic/src/systemd-sonic-generator' dpkg-genbuildinfo --build=binary --admindir=/sonic/dpkg/tmp.QpCJKXPbO0 dpkg-genchanges --build=binary >../systemd-sonic-generator_1.0.0_amd64.changes dpkg-genchanges: warning: missing Section for binary package systemd-sonic-generator; using '-' dpkg-genchanges: warning: missing Priority for binary package systemd-sonic-generator; using '-' dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) mv ../systemd-sonic-generator_1.0.0amd64.deb /sonic/target/debs/buster/ rm ../systemd-sonic-generator-* ../systemd-sonic-generator rm: cannot remove '../systemd-sonic-generator-': No such file or directory make[1]: [Makefile:14: /sonic/target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb] Error 1 make[1]: Leaving directory '/sonic/src/systemd-sonic-generator' [ FAIL LOG END ] [ target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb ] make: [slave.mk:429: target/debs/buster/systemd-sonic-generator_1.0.0_amd64.deb] Error 1

Describe the results you expected:

Build completes with no errors.

Output of show version:

N/A

Output of show techsupport:

N/A

Additional information you deem important (e.g. issue happens only occasionally):

make_log.txt

zhangyanzhao commented 3 years ago

Do you still need help or this one has been handled by yourself? @raphaelt-nvidia

raphaelt-nvidia commented 3 years ago

Still need help. The fix I did in pending PR#8317 eliminates some of the errors but not all. The remaining errors are shown in the lower part of my description. The problem seems to be around here:

mv ../systemd-sonic-generator_1.0.0amd64.deb /sonic/target/debs/buster/ rm ../systemd-sonic-generator-* ../systemd-sonic-generator rm: cannot remove '../systemd-sonic-generator-': No such file or directory

There seems to be an assumption that after moving systemd-sonic-generator_1.0.0_amd64.deb, there are still some files of the form systemd-sonic-generator-* to be removed, but no such files are found. I am not familiar with the context on which such an assumption is based.