Skip to content

[build] drop debian python3-scapy dependency from p4c and use locally built scapy wheel#27890

Open
yijingyan2 wants to merge 1 commit into
sonic-net:masterfrom
yijingyan2:p4lang-scapy
Open

[build] drop debian python3-scapy dependency from p4c and use locally built scapy wheel#27890
yijingyan2 wants to merge 1 commit into
sonic-net:masterfrom
yijingyan2:p4lang-scapy

Conversation

@yijingyan2

Copy link
Copy Markdown
Contributor

Why I did it

p4lang-p4c currently depends on Debian python3-scapy in both Build-Depends and Depends. In SONiC, scapy is built and provided as a local Python wheel with patches, drop debian python3-scapy dependency from p4c and use locally built scapy wheel instead.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Added a new p4c patch to remove python3-scapy from debian/control Build-Depends and Depends.
  • Wired that patch into the p4lang source build sequence so it is always applied during p4c package build.
  • Added p4c wheel dependency on SCAPY in p4lang rules so scapy is satisfied through SONiC wheel flow.
  • Removed python3-scapy from trixie slave image package list to avoid relying on distro scapy.

How to verify it

Which release branch to backport (provide reason below if selected)

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202605

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Yijing Yan <yijingyan@microsoft.com>
Copilot AI review requested due to automatic review settings June 15, 2026 02:41
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the p4lang/p4c build and packaging flow in sonic-buildimage to stop depending on the Debian python3-scapy package and instead rely on SONiC’s locally built scapy Python wheel, aligning p4c with the existing “use wheel-provided Python deps” approach already used for other Python modules.

Changes:

  • Add and apply a new p4c patch to remove python3-scapy from debian/control (both Build-Depends and Depends).
  • Ensure p4lang-p4c pulls in SONiC’s scapy wheel via $(P4LANG_P4C)_WHEEL_DEPENDS.
  • Remove python3-scapy from the trixie slave image package list to avoid relying on the distro package there.

Reviewed changes

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

File Description
src/p4lang/p4lang-p4c.patch/remove-scapy-from-debian-dependency.patch Drops python3-scapy from p4c Debian build/runtime dependency lists via patch.
src/p4lang/Makefile Applies the new patch during the p4c source build sequence.
sonic-slave-trixie/Dockerfile.j2 Removes python3-scapy from trixie build slave apt package installs.
rules/p4lang.mk Adds scapy wheel dependency for p4lang-p4c to satisfy scapy via SONiC wheel flow.

@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605.
Added label(s) for branch(es) 202605.

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants