Skip to content

Conversation

@liushilongbuaa
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 26, 2025 12:43
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds debug commands to Azure Pipeline build templates to diagnose disk space issues when package builds fail. The changes wrap the dpkg-buildpackage commands with error handling that displays disk usage statistics before exiting.

  • Adds disk usage debugging to three build pipeline templates
  • Displays directory sizes for key system directories when builds fail
  • Filters output to show gigabyte-sized directories for quick diagnosis

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
.azure-pipelines/build-template.yml Adds disk space debug output on build failure for sonic-swss-common compilation with coverage
.azure-pipelines/build-swss-template.yml Adds disk space debug output on build failure for sonic-swss compilation
.azure-pipelines/build-sairedis-template.yml Adds disk space debug output on build failure for sairedis package build

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rm ../*.deb || true
./autogen.sh
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc)
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1}
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space before closing brace. The shell syntax requires a space or semicolon before the closing brace in command groups. This should be exit 1 } or exit 1; }.

Suggested change
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1}
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1 }

Copilot uses AI. Check for mistakes.
rm ../*.deb || true
./autogen.sh
DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' DEB_CXXFLAGS_APPEND="-coverage -fprofile-abs-path" DEB_LDFLAGS_APPEND="-coverage -fprofile-abs-path" dpkg-buildpackage -Pnopython2 -us -uc -b -j$(nproc)
DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' DEB_CXXFLAGS_APPEND="-coverage -fprofile-abs-path" DEB_LDFLAGS_APPEND="-coverage -fprofile-abs-path" dpkg-buildpackage -Pnopython2 -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1 }
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grep G command will fail if no gigabyte-sized directories are found, which could mask the original build failure. Consider using grep G || true to ensure the debug output always completes, or remove the grep filter entirely to show all directory sizes.

Suggested change
DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' DEB_CXXFLAGS_APPEND="-coverage -fprofile-abs-path" DEB_LDFLAGS_APPEND="-coverage -fprofile-abs-path" dpkg-buildpackage -Pnopython2 -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1 }
DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' DEB_CXXFLAGS_APPEND="-coverage -fprofile-abs-path" DEB_LDFLAGS_APPEND="-coverage -fprofile-abs-path" dpkg-buildpackage -Pnopython2 -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G || true ; exit 1 }

Copilot uses AI. Check for mistakes.
rm ../*.deb || true
./autogen.sh
dpkg-buildpackage -us -uc -b -j$(nproc)
dpkg-buildpackage -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1 }
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grep G command will fail if no gigabyte-sized directories are found, which could mask the original build failure. Consider using grep G || true to ensure the debug output always completes, or remove the grep filter entirely to show all directory sizes.

Suggested change
dpkg-buildpackage -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1 }
dpkg-buildpackage -us -uc -b -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G || true ; exit 1 }

Copilot uses AI. Check for mistakes.
rm ../*.deb || true
./autogen.sh
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc)
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1}
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grep G command will fail if no gigabyte-sized directories are found, which could mask the original build failure. Consider using grep G || true to ensure the debug output always completes, or remove the grep filter entirely to show all directory sizes.

Suggested change
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G ; exit 1}
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -us -uc -Psyncd,vs,nopython2 -j$(nproc) || { sudo du -sh /bin /lib /run /var /usr /home; sudo du -sh /var/lib/* /var/log | grep G || true ; exit 1}

Copilot uses AI. Check for mistakes.
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

2 participants