Skip to content

[BugFix] Exit if neither modern nor legacy wheel dir not found#5367

Merged
SigureMo merged 4 commits intoPaddlePaddle:developfrom
cattidea:build/exit-if-neither-modern-nor-legacy-dir-not-found
Dec 4, 2025
Merged

[BugFix] Exit if neither modern nor legacy wheel dir not found#5367
SigureMo merged 4 commits intoPaddlePaddle:developfrom
cattidea:build/exit-if-neither-modern-nor-legacy-dir-not-found

Conversation

@SigureMo
Copy link
Member

@SigureMo SigureMo commented Dec 4, 2025

Motivation

💡 If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)

💡 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)

#5156 实现的根据 modern or legacy 目录结构来判断要以何种方式 copy 的逻辑在某些情况可能走到第三个分支,此时就会将根目录里的内容 copy 到 ops 目录,该问题可能是由于某些奇怪的缓存导致的,因为更新后无法复现所以在第三个分支退出以避免 copy 根目录导致的严重问题

Modifications

在 GPU/XPU 的目录结构判断逻辑的第三个分支直接退出,并添加清理构建目录的提示

Usage or Command

bash build.sh

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

Copilot AI review requested due to automatic review settings December 4, 2025 04:48
Copy link
Contributor

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 fixes a critical bug where the build script could incorrectly copy root directory contents to the ops directory when neither modern nor legacy wheel directory structures are found. The fix adds proper error handling to exit early with helpful messages.

  • Adds exit 1 to prevent dangerous root directory copying when directory structure detection fails
  • Provides informative error messages suggesting to clean build directories when compilation fails
  • Applied consistently to both GPU ops (build.sh) and XPU ops (custom_ops/xpu_ops/build.sh)

Reviewed changes

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

File Description
build.sh Adds exit and cleanup guidance when GPU ops directory structure is not found
custom_ops/xpu_ops/build.sh Adds exit and cleanup guidance when XPU ops directory structure is not found

SigureMo and others added 2 commits December 4, 2025 12:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@209006e). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5367   +/-   ##
==========================================
  Coverage           ?   59.40%           
==========================================
  Files              ?      325           
  Lines              ?    40273           
  Branches           ?     6097           
==========================================
  Hits               ?    23923           
  Misses             ?    14441           
  Partials           ?     1909           
Flag Coverage Δ
GPU 59.40% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SigureMo SigureMo merged commit f88c159 into PaddlePaddle:develop Dec 4, 2025
14 of 17 checks passed
@SigureMo SigureMo deleted the build/exit-if-neither-modern-nor-legacy-dir-not-found branch December 4, 2025 08:45
liyonghua0910 pushed a commit to liyonghua0910/FastDeploy that referenced this pull request Dec 5, 2025
…ePaddle#5367)

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

3 participants