← Back to Pull requests

Fix quilt patch paths for nested package sources #29148

Open
unknown opened this pull request with 398 lines diff across 4 files
View on GitHub
unknown unknown commented on Aug 22, 2026 13:11 UTC
Author

Description of PR

Summary:
Fixes #29140.

slave.mk assumes quilt patches always live at <SRC_PATH>.patch. This does not work when a package's SRC_PATH points to a subdirectory inside a git submodule, because the corresponding patch directory would also need to live inside that submodule and therefore cannot be tracked by sonic-buildimage.

Add an optional per-package _PATCH_PATH override while preserving <SRC_PATH>.patch as the default for backward compatibility.

Use the override for nested package sources under sonic-platform-daemons and sonic-genl-packet, with a separate patch directory for each source package.

Type of change

  • Bug fix

  • Testbed and Framework(new/improvement)

  • New Test case

  • Test case improvement
  • Back port request

  • 202311

  • 202405

  • 202411

  • 202505

  • 202511

  • 202512

  • 202605
  • Tested branch

  • master

  • 202311

  • 202405

  • 202411

  • 202505

  • 202511

  • 202512

  • 202605

  • N/A
  • Test result

    Validated the patch-path handling with GNU Make and quilt without requiring a full SONiC image build:

  • Legacy <SRC_PATH>.patch layout: quilt push/pop succeeded and restored the original source.

  • Explicit nested _PATCH_PATH layout: quilt push/pop succeeded and restored the original source.

  • Python-wheel recipe shape was tested with .ONESHELL and pushd occurring before the patch existence check.

  • Verified .pc cleanup after quilt pop.

  • Verified an incorrectly scoped patch fails to apply as expected.

  • git diff --check passes.
  • Approach

    What is the motivation for this PR?

    Packages such as sonic-xcvrd use a source path inside the sonic-platform-daemons submodule:

    src/sonic-platform-daemons/sonic-xcvrd

    The existing quilt convention therefore looks for:

    src/sonic-platform-daemons/sonic-xcvrd.patch

    which is inside the submodule working tree and cannot be maintained by the parent sonic-buildimage repository.

    How did you do it?

    Add resolve_patch_path and resolve_patch_abspath helpers.

    If <package>_PATCH_PATH is defined, quilt uses that directory. Otherwise the existing <SRC_PATH>.patch behavior is preserved.

    For example, sonic-xcvrd patches can now be tracked under:

    src/sonic-platform-daemons.patch/sonic-xcvrd

    Other nested packages use the same package-specific layout under sonic-platform-daemons.patch or sonic-genl-packet.patch.

    All patch existence checks use an absolute resolved path so behavior is independent of the recipe's current working directory.

    How did you verify/test it?

    Tested both the existing patch-directory convention and the new nested-source override using real quilt push/pop operations.

    Also specifically tested the Python wheel recipe execution pattern, where the build changes directory to SRC_PATH before checking and applying patches.

    Any platform specific information?

    No. The build-system change is generic.

    Supported testbed topology if it's a new test case?

    N/A

    Documentation

    No user-facing documentation change required. The new _PATCH_PATH mechanism is documented inline in the build helper and recipe.

    Diff: 398 lines (+298 / -100) across 4 files Reviewer: dlanov Review duration: 106354m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 398 lines diff across 4 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.358
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #29148"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 50.2% (MEDIUM) · Higher = larger blast radius
    50.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.8% · Safe to merge
    27.8%