Skip to content

fix: Make the ShibokenHelpers.cmake patch safe to re-run - #1434

Merged
cedrik-fuoco-adsk merged 1 commit into
AcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:fix-pyside6-shiboken-patch-rerun
Oct 2, 2026
Merged

cedrik-fuoco-adsk merged 1 commit into
AcademySoftwareFoundation:mainfrom
cedrik-fuoco-adsk:fix-pyside6-shiboken-patch-rerun

Conversation

@cedrik-fuoco-adsk

@cedrik-fuoco-adsk cedrik-fuoco-adsk commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

fix: Make the ShibokenHelpers.cmake patch safe to re-run

Linked issues

None. Found on the macOS CI job of #1427 (run 36735866190).

Summarize your change.

make_pyside6.py now skips the ShibokenHelpers.cmake Clang warning patch when the source tree is already patched, and only renames the file to .old once the replacement is known to apply.

Describe the reason for the change.

CI restores _build/_deps from the dependency cache. That cache can hold a PySide6 source tree that an earlier run already patched. The patch step only matched the unpatched block, so it raised:

RuntimeError: Failed to patch .../ShibokenHelpers.cmake: the expected compiler-id block was not found.

It also renamed ShibokenHelpers.cmake to .old before checking, so a failed match left the file missing and broke every later run on the same tree.

Describe what you have tested and on which operating system.

macOS: ran the patch logic against a temporary source tree:

  • clean file: patched, .old backup written
  • already patched: skipped, file unchanged
  • unexpected content: RuntimeError, ShibokenHelpers.cmake left in place

Add a list of changes, and note any that might need special attention during the review.

  • src/build/make_pyside6.py: read the file in place, return early if -Wno-cast-function-type-mismatch is already present, and rename to .old only after the replacement succeeds. The patch is the last step of prepare(), so the early return skips nothing else.

make_pyside6.py raised "expected compiler-id block was not found" when
the PySide6 source tree was already patched, which happens when CI
restores _build/_deps from its dependency cache. It also renamed the
file to .old before checking, so a failed match left
ShibokenHelpers.cmake missing for every later run.

Skip the patch when the Clang -Wno-cast-function-type-mismatch line is
already present, and only rename the file once the replacement is
known to apply.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
@cedrik-fuoco-adsk
cedrik-fuoco-adsk marked this pull request as ready for review September 30, 2026 20:03

@bernie-laberge bernie-laberge 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.

LGTM

@cedrik-fuoco-adsk
cedrik-fuoco-adsk merged commit 838bf2e into AcademySoftwareFoundation:main Oct 2, 2026
20 checks passed
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